diff --git a/.fernignore b/.fernignore index 4afbcfbf5..17a5ec1f5 100644 --- a/.fernignore +++ b/.fernignore @@ -6,4 +6,9 @@ LICENSE.md # Patch src/main/java/com/merge/api/core/MergeApiApiError.java -src/main/java/com/merge/legacy \ No newline at end of file +src/main/java/com/merge/legacy + +# Fern is working on a fix to our code, which will automatically handle the logic we +# added to QueryStringMapper.java. Once that is fixed, we can remove this file from +# .fernignore. +src/main/java/com/merge/api/core/QueryStringMapper.java diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 552eeb53d..08da8b1f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Java id: setup-jre @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Java id: setup-jre @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Java id: setup-jre diff --git a/build.gradle b/build.gradle index bf63dd2c4..66b7a8f44 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ java { group = 'dev.merge' -version = '1.1.1' +version = '2.0.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -71,7 +71,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.merge' artifactId = 'merge-java-client' - version = '1.1.1' + version = '2.0.0' from components.java pom { licenses { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index a4b76b953..1b33c55ba 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cea7a793a..ca025c83a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f3b75f3b0..23d15a936 100755 --- a/gradlew +++ b/gradlew @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -205,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9b42019c7..5eed7ee84 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/sample-app/src/main/java/sample/App.java b/sample-app/src/main/java/sample/App.java index 7102bf6ac..e443a5fd0 100644 --- a/sample-app/src/main/java/sample/App.java +++ b/sample-app/src/main/java/sample/App.java @@ -8,6 +8,6 @@ public final class App { public static void main(String[] args) { - // import com.merge.api.MergeApiClient + // import com.merge.api.AsyncMergeApiClient } } diff --git a/src/main/java/com/merge/api/AsyncMergeApiClient.java b/src/main/java/com/merge/api/AsyncMergeApiClient.java new file mode 100644 index 000000000..fba90deab --- /dev/null +++ b/src/main/java/com/merge/api/AsyncMergeApiClient.java @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api; + +import com.merge.api.accounting.AsyncAccountingClient; +import com.merge.api.ats.AsyncAtsClient; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import com.merge.api.crm.AsyncCrmClient; +import com.merge.api.filestorage.AsyncFileStorageClient; +import com.merge.api.hris.AsyncHrisClient; +import com.merge.api.ticketing.AsyncTicketingClient; +import java.util.function.Supplier; + +public class AsyncMergeApiClient { + protected final ClientOptions clientOptions; + + protected final Supplier atsClient; + + protected final Supplier accountingClient; + + protected final Supplier crmClient; + + protected final Supplier fileStorageClient; + + protected final Supplier hrisClient; + + protected final Supplier ticketingClient; + + public AsyncMergeApiClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.atsClient = Suppliers.memoize(() -> new AsyncAtsClient(clientOptions)); + this.accountingClient = Suppliers.memoize(() -> new AsyncAccountingClient(clientOptions)); + this.crmClient = Suppliers.memoize(() -> new AsyncCrmClient(clientOptions)); + this.fileStorageClient = Suppliers.memoize(() -> new AsyncFileStorageClient(clientOptions)); + this.hrisClient = Suppliers.memoize(() -> new AsyncHrisClient(clientOptions)); + this.ticketingClient = Suppliers.memoize(() -> new AsyncTicketingClient(clientOptions)); + } + + public AsyncAtsClient ats() { + return this.atsClient.get(); + } + + public AsyncAccountingClient accounting() { + return this.accountingClient.get(); + } + + public AsyncCrmClient crm() { + return this.crmClient.get(); + } + + public AsyncFileStorageClient fileStorage() { + return this.fileStorageClient.get(); + } + + public AsyncHrisClient hris() { + return this.hrisClient.get(); + } + + public AsyncTicketingClient ticketing() { + return this.ticketingClient.get(); + } + + public static AsyncMergeApiClientBuilder builder() { + return new AsyncMergeApiClientBuilder(); + } +} diff --git a/src/main/java/com/merge/api/AsyncMergeApiClientBuilder.java b/src/main/java/com/merge/api/AsyncMergeApiClientBuilder.java new file mode 100644 index 000000000..2b08f24a7 --- /dev/null +++ b/src/main/java/com/merge/api/AsyncMergeApiClientBuilder.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Environment; +import okhttp3.OkHttpClient; + +public final class AsyncMergeApiClientBuilder { + private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); + + private String apiKey = null; + + private String accountToken = null; + + private Environment environment = Environment.PRODUCTION; + + /** + * Sets apiKey + */ + public AsyncMergeApiClientBuilder apiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Sets accountToken + */ + public AsyncMergeApiClientBuilder accountToken(String accountToken) { + this.accountToken = accountToken; + return this; + } + + public AsyncMergeApiClientBuilder environment(Environment environment) { + this.environment = environment; + return this; + } + + /** + * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. + */ + public AsyncMergeApiClientBuilder timeout(int timeout) { + this.clientOptionsBuilder.timeout(timeout); + return this; + } + + /** + * Sets the maximum number of retries for the client. Defaults to 2 retries. + */ + public AsyncMergeApiClientBuilder maxRetries(int maxRetries) { + this.clientOptionsBuilder.maxRetries(maxRetries); + return this; + } + + /** + * Sets the underlying OkHttp client + */ + public AsyncMergeApiClientBuilder httpClient(OkHttpClient httpClient) { + this.clientOptionsBuilder.httpClient(httpClient); + return this; + } + + public AsyncMergeApiClient build() { + if (apiKey == null) { + throw new RuntimeException("Please provide apiKey"); + } + this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.apiKey); + if (accountToken != null) { + this.clientOptionsBuilder.addHeader("X-Account-Token", this.accountToken); + } + clientOptionsBuilder.environment(this.environment); + return new AsyncMergeApiClient(clientOptionsBuilder.build()); + } +} diff --git a/src/main/java/com/merge/api/MergeApiClient.java b/src/main/java/com/merge/api/MergeApiClient.java index 61a58b09f..972e6641e 100644 --- a/src/main/java/com/merge/api/MergeApiClient.java +++ b/src/main/java/com/merge/api/MergeApiClient.java @@ -3,14 +3,14 @@ */ package com.merge.api; +import com.merge.api.accounting.AccountingClient; +import com.merge.api.ats.AtsClient; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; -import com.merge.api.resources.accounting.AccountingClient; -import com.merge.api.resources.ats.AtsClient; -import com.merge.api.resources.crm.CrmClient; -import com.merge.api.resources.filestorage.FilestorageClient; -import com.merge.api.resources.hris.HrisClient; -import com.merge.api.resources.ticketing.TicketingClient; +import com.merge.api.crm.CrmClient; +import com.merge.api.filestorage.FileStorageClient; +import com.merge.api.hris.HrisClient; +import com.merge.api.ticketing.TicketingClient; import java.util.function.Supplier; public class MergeApiClient { @@ -18,48 +18,48 @@ public class MergeApiClient { protected final Supplier atsClient; - protected final Supplier crmClient; + protected final Supplier accountingClient; - protected final Supplier filestorageClient; + protected final Supplier crmClient; - protected final Supplier ticketingClient; + protected final Supplier fileStorageClient; protected final Supplier hrisClient; - protected final Supplier accountingClient; + protected final Supplier ticketingClient; public MergeApiClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions)); + this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions)); this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions)); - this.filestorageClient = Suppliers.memoize(() -> new FilestorageClient(clientOptions)); - this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions)); + this.fileStorageClient = Suppliers.memoize(() -> new FileStorageClient(clientOptions)); this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions)); - this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions)); + this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions)); } public AtsClient ats() { return this.atsClient.get(); } - public CrmClient crm() { - return this.crmClient.get(); + public AccountingClient accounting() { + return this.accountingClient.get(); } - public FilestorageClient filestorage() { - return this.filestorageClient.get(); + public CrmClient crm() { + return this.crmClient.get(); } - public TicketingClient ticketing() { - return this.ticketingClient.get(); + public FileStorageClient fileStorage() { + return this.fileStorageClient.get(); } public HrisClient hris() { return this.hrisClient.get(); } - public AccountingClient accounting() { - return this.accountingClient.get(); + public TicketingClient ticketing() { + return this.ticketingClient.get(); } public static MergeApiClientBuilder builder() { diff --git a/src/main/java/com/merge/api/MergeApiClientBuilder.java b/src/main/java/com/merge/api/MergeApiClientBuilder.java index 7f8706b09..65ea3085b 100644 --- a/src/main/java/com/merge/api/MergeApiClientBuilder.java +++ b/src/main/java/com/merge/api/MergeApiClientBuilder.java @@ -5,6 +5,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.Environment; +import okhttp3.OkHttpClient; public final class MergeApiClientBuilder { private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); @@ -36,16 +37,27 @@ public MergeApiClientBuilder environment(Environment environment) { return this; } - public MergeApiClientBuilder url(String url) { - this.environment = Environment.custom(url); + /** + * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. + */ + public MergeApiClientBuilder timeout(int timeout) { + this.clientOptionsBuilder.timeout(timeout); return this; } /** - * Sets the timeout (in seconds) for the client + * Sets the maximum number of retries for the client. Defaults to 2 retries. */ - public MergeApiClientBuilder timeout(int timeout) { - this.clientOptionsBuilder.timeout(timeout); + public MergeApiClientBuilder maxRetries(int maxRetries) { + this.clientOptionsBuilder.maxRetries(maxRetries); + return this; + } + + /** + * Sets the underlying OkHttp client + */ + public MergeApiClientBuilder httpClient(OkHttpClient httpClient) { + this.clientOptionsBuilder.httpClient(httpClient); return this; } diff --git a/src/main/java/com/merge/api/accounting/AccountDetailsClient.java b/src/main/java/com/merge/api/accounting/AccountDetailsClient.java new file mode 100644 index 000000000..8714c2afb --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetails; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AccountTokenClient.java b/src/main/java/com/merge/api/accounting/AccountTokenClient.java new file mode 100644 index 000000000..e1bd0ccb9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AccountTokenClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/AccountingClient.java b/src/main/java/com/merge/api/accounting/AccountingClient.java similarity index 78% rename from src/main/java/com/merge/api/resources/accounting/AccountingClient.java rename to src/main/java/com/merge/api/accounting/AccountingClient.java index a495f7358..87081bc96 100644 --- a/src/main/java/com/merge/api/resources/accounting/AccountingClient.java +++ b/src/main/java/com/merge/api/accounting/AccountingClient.java @@ -1,53 +1,10 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting; +package com.merge.api.accounting; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; -import com.merge.api.resources.accounting.accountdetails.AccountDetailsClient; -import com.merge.api.resources.accounting.accountingperiods.AccountingPeriodsClient; -import com.merge.api.resources.accounting.accounts.AccountsClient; -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; -import com.merge.api.resources.accounting.issues.IssuesClient; -import com.merge.api.resources.accounting.items.ItemsClient; -import com.merge.api.resources.accounting.journalentries.JournalEntriesClient; -import com.merge.api.resources.accounting.linkedaccounts.LinkedAccountsClient; -import com.merge.api.resources.accounting.linktoken.LinkTokenClient; -import com.merge.api.resources.accounting.passthrough.PassthroughClient; -import com.merge.api.resources.accounting.payments.PaymentsClient; -import com.merge.api.resources.accounting.phonenumbers.PhoneNumbersClient; -import com.merge.api.resources.accounting.purchaseorders.PurchaseOrdersClient; -import com.merge.api.resources.accounting.regeneratekey.RegenerateKeyClient; -import com.merge.api.resources.accounting.scopes.ScopesClient; -import com.merge.api.resources.accounting.syncstatus.SyncStatusClient; -import com.merge.api.resources.accounting.taxrates.TaxRatesClient; -import com.merge.api.resources.accounting.trackingcategories.TrackingCategoriesClient; -import com.merge.api.resources.accounting.transactions.TransactionsClient; -import com.merge.api.resources.accounting.vendorcredits.VendorCreditsClient; -import com.merge.api.resources.accounting.webhookreceivers.WebhookReceiversClient; import java.util.function.Supplier; public class AccountingClient { @@ -117,6 +74,10 @@ public class AccountingClient { protected final Supplier passthroughClient; + protected final Supplier paymentMethodsClient; + + protected final Supplier paymentTermsClient; + protected final Supplier paymentsClient; protected final Supplier phoneNumbersClient; @@ -174,6 +135,8 @@ public AccountingClient(ClientOptions clientOptions) { this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.paymentMethodsClient = Suppliers.memoize(() -> new PaymentMethodsClient(clientOptions)); + this.paymentTermsClient = Suppliers.memoize(() -> new PaymentTermsClient(clientOptions)); this.paymentsClient = Suppliers.memoize(() -> new PaymentsClient(clientOptions)); this.phoneNumbersClient = Suppliers.memoize(() -> new PhoneNumbersClient(clientOptions)); this.purchaseOrdersClient = Suppliers.memoize(() -> new PurchaseOrdersClient(clientOptions)); @@ -315,6 +278,14 @@ public PassthroughClient passthrough() { return this.passthroughClient.get(); } + public PaymentMethodsClient paymentMethods() { + return this.paymentMethodsClient.get(); + } + + public PaymentTermsClient paymentTerms() { + return this.paymentTermsClient.get(); + } + public PaymentsClient payments() { return this.paymentsClient.get(); } diff --git a/src/main/java/com/merge/api/accounting/AccountingPeriodsClient.java b/src/main/java/com/merge/api/accounting/AccountingPeriodsClient.java new file mode 100644 index 000000000..8274ddc44 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AccountingPeriodsClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPeriod; +import com.merge.api.accounting.types.AccountingPeriodsListRequest; +import com.merge.api.accounting.types.AccountingPeriodsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class AccountingPeriodsClient { + protected final ClientOptions clientOptions; + + private final RawAccountingPeriodsClient rawClient; + + public AccountingPeriodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountingPeriodsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountingPeriodsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public SyncPagingIterable list(AccountingPeriodsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public SyncPagingIterable list( + AccountingPeriodsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public AccountingPeriod retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public AccountingPeriod retrieve(String id, AccountingPeriodsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public AccountingPeriod retrieve( + String id, AccountingPeriodsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AccountsClient.java b/src/main/java/com/merge/api/accounting/AccountsClient.java new file mode 100644 index 000000000..ad5a05594 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AccountsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Account; +import com.merge.api.accounting.types.AccountEndpointRequest; +import com.merge.api.accounting.types.AccountResponse; +import com.merge.api.accounting.types.AccountsListRequest; +import com.merge.api.accounting.types.AccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class AccountsClient { + protected final ClientOptions clientOptions; + + private final RawAccountsClient rawClient; + + public AccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list(AccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list(AccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Account object with the given values. + */ + public AccountResponse create(AccountEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Account object with the given values. + */ + public AccountResponse create(AccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id, AccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Account POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Account POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AddressesClient.java b/src/main/java/com/merge/api/accounting/AddressesClient.java new file mode 100644 index 000000000..efa492cef --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AddressesClient.java @@ -0,0 +1,48 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Address; +import com.merge.api.accounting.types.AddressesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AddressesClient { + protected final ClientOptions clientOptions; + + private final RawAddressesClient rawClient; + + public AddressesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAddressesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAddressesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns an Address object with the given id. + */ + public Address retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Address object with the given id. + */ + public Address retrieve(String id, AddressesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Address object with the given id. + */ + public Address retrieve(String id, AddressesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..d3da845c7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetails; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java new file mode 100644 index 000000000..6bdc8b349 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountingClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountingClient.java new file mode 100644 index 000000000..ba528cedf --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAccountingClient.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncAccountingClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier accountingPeriodsClient; + + protected final Supplier accountsClient; + + protected final Supplier addressesClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier asyncTasksClient; + + protected final Supplier attachmentsClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier balanceSheetsClient; + + protected final Supplier bankFeedAccountsClient; + + protected final Supplier bankFeedTransactionsClient; + + protected final Supplier cashFlowStatementsClient; + + protected final Supplier companyInfoClient; + + protected final Supplier contactsClient; + + protected final Supplier creditNotesClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier employeesClient; + + protected final Supplier expensesClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generalLedgerTransactionsClient; + + protected final Supplier generateKeyClient; + + protected final Supplier incomeStatementsClient; + + protected final Supplier invoicesClient; + + protected final Supplier issuesClient; + + protected final Supplier itemsClient; + + protected final Supplier journalEntriesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier passthroughClient; + + protected final Supplier paymentMethodsClient; + + protected final Supplier paymentTermsClient; + + protected final Supplier paymentsClient; + + protected final Supplier phoneNumbersClient; + + protected final Supplier purchaseOrdersClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier taxRatesClient; + + protected final Supplier trackingCategoriesClient; + + protected final Supplier transactionsClient; + + protected final Supplier vendorCreditsClient; + + protected final Supplier webhookReceiversClient; + + public AsyncAccountingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.accountingPeriodsClient = Suppliers.memoize(() -> new AsyncAccountingPeriodsClient(clientOptions)); + this.accountsClient = Suppliers.memoize(() -> new AsyncAccountsClient(clientOptions)); + this.addressesClient = Suppliers.memoize(() -> new AsyncAddressesClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.asyncTasksClient = Suppliers.memoize(() -> new AsyncAsyncTasksClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AsyncAttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.balanceSheetsClient = Suppliers.memoize(() -> new AsyncBalanceSheetsClient(clientOptions)); + this.bankFeedAccountsClient = Suppliers.memoize(() -> new AsyncBankFeedAccountsClient(clientOptions)); + this.bankFeedTransactionsClient = Suppliers.memoize(() -> new AsyncBankFeedTransactionsClient(clientOptions)); + this.cashFlowStatementsClient = Suppliers.memoize(() -> new AsyncCashFlowStatementsClient(clientOptions)); + this.companyInfoClient = Suppliers.memoize(() -> new AsyncCompanyInfoClient(clientOptions)); + this.contactsClient = Suppliers.memoize(() -> new AsyncContactsClient(clientOptions)); + this.creditNotesClient = Suppliers.memoize(() -> new AsyncCreditNotesClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.employeesClient = Suppliers.memoize(() -> new AsyncEmployeesClient(clientOptions)); + this.expensesClient = Suppliers.memoize(() -> new AsyncExpensesClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.generalLedgerTransactionsClient = + Suppliers.memoize(() -> new AsyncGeneralLedgerTransactionsClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.incomeStatementsClient = Suppliers.memoize(() -> new AsyncIncomeStatementsClient(clientOptions)); + this.invoicesClient = Suppliers.memoize(() -> new AsyncInvoicesClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.itemsClient = Suppliers.memoize(() -> new AsyncItemsClient(clientOptions)); + this.journalEntriesClient = Suppliers.memoize(() -> new AsyncJournalEntriesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.paymentMethodsClient = Suppliers.memoize(() -> new AsyncPaymentMethodsClient(clientOptions)); + this.paymentTermsClient = Suppliers.memoize(() -> new AsyncPaymentTermsClient(clientOptions)); + this.paymentsClient = Suppliers.memoize(() -> new AsyncPaymentsClient(clientOptions)); + this.phoneNumbersClient = Suppliers.memoize(() -> new AsyncPhoneNumbersClient(clientOptions)); + this.purchaseOrdersClient = Suppliers.memoize(() -> new AsyncPurchaseOrdersClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.taxRatesClient = Suppliers.memoize(() -> new AsyncTaxRatesClient(clientOptions)); + this.trackingCategoriesClient = Suppliers.memoize(() -> new AsyncTrackingCategoriesClient(clientOptions)); + this.transactionsClient = Suppliers.memoize(() -> new AsyncTransactionsClient(clientOptions)); + this.vendorCreditsClient = Suppliers.memoize(() -> new AsyncVendorCreditsClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncAccountingPeriodsClient accountingPeriods() { + return this.accountingPeriodsClient.get(); + } + + public AsyncAccountsClient accounts() { + return this.accountsClient.get(); + } + + public AsyncAddressesClient addresses() { + return this.addressesClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAsyncTasksClient asyncTasks() { + return this.asyncTasksClient.get(); + } + + public AsyncAttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncBalanceSheetsClient balanceSheets() { + return this.balanceSheetsClient.get(); + } + + public AsyncBankFeedAccountsClient bankFeedAccounts() { + return this.bankFeedAccountsClient.get(); + } + + public AsyncBankFeedTransactionsClient bankFeedTransactions() { + return this.bankFeedTransactionsClient.get(); + } + + public AsyncCashFlowStatementsClient cashFlowStatements() { + return this.cashFlowStatementsClient.get(); + } + + public AsyncCompanyInfoClient companyInfo() { + return this.companyInfoClient.get(); + } + + public AsyncContactsClient contacts() { + return this.contactsClient.get(); + } + + public AsyncCreditNotesClient creditNotes() { + return this.creditNotesClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncEmployeesClient employees() { + return this.employeesClient.get(); + } + + public AsyncExpensesClient expenses() { + return this.expensesClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncGeneralLedgerTransactionsClient generalLedgerTransactions() { + return this.generalLedgerTransactionsClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncIncomeStatementsClient incomeStatements() { + return this.incomeStatementsClient.get(); + } + + public AsyncInvoicesClient invoices() { + return this.invoicesClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncItemsClient items() { + return this.itemsClient.get(); + } + + public AsyncJournalEntriesClient journalEntries() { + return this.journalEntriesClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncPaymentMethodsClient paymentMethods() { + return this.paymentMethodsClient.get(); + } + + public AsyncPaymentTermsClient paymentTerms() { + return this.paymentTermsClient.get(); + } + + public AsyncPaymentsClient payments() { + return this.paymentsClient.get(); + } + + public AsyncPhoneNumbersClient phoneNumbers() { + return this.phoneNumbersClient.get(); + } + + public AsyncPurchaseOrdersClient purchaseOrders() { + return this.purchaseOrdersClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncTaxRatesClient taxRates() { + return this.taxRatesClient.get(); + } + + public AsyncTrackingCategoriesClient trackingCategories() { + return this.trackingCategoriesClient.get(); + } + + public AsyncTransactionsClient transactions() { + return this.transactionsClient.get(); + } + + public AsyncVendorCreditsClient vendorCredits() { + return this.vendorCreditsClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountingPeriodsClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountingPeriodsClient.java new file mode 100644 index 000000000..f37c1026a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAccountingPeriodsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPeriod; +import com.merge.api.accounting.types.AccountingPeriodsListRequest; +import com.merge.api.accounting.types.AccountingPeriodsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountingPeriodsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountingPeriodsClient rawClient; + + public AsyncAccountingPeriodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountingPeriodsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountingPeriodsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public CompletableFuture> list(AccountingPeriodsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public CompletableFuture> list( + AccountingPeriodsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public CompletableFuture retrieve(String id, AccountingPeriodsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public CompletableFuture retrieve( + String id, AccountingPeriodsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountsClient.java new file mode 100644 index 000000000..2c2bc64ea --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAccountsClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Account; +import com.merge.api.accounting.types.AccountEndpointRequest; +import com.merge.api.accounting.types.AccountResponse; +import com.merge.api.accounting.types.AccountsListRequest; +import com.merge.api.accounting.types.AccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountsClient rawClient; + + public AsyncAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list(AccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list( + AccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture create(AccountEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture create(AccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve(String id, AccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Account POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Account POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAddressesClient.java b/src/main/java/com/merge/api/accounting/AsyncAddressesClient.java new file mode 100644 index 000000000..c80bd7258 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAddressesClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Address; +import com.merge.api.accounting.types.AddressesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAddressesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAddressesClient rawClient; + + public AsyncAddressesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAddressesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAddressesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns an Address object with the given id. + */ + public CompletableFuture
retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Address object with the given id. + */ + public CompletableFuture
retrieve(String id, AddressesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Address object with the given id. + */ + public CompletableFuture
retrieve( + String id, AddressesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/accounting/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..1db96ec19 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncPassthroughReciept; +import com.merge.api.accounting.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.accounting.types.DataPassthroughRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAsyncTasksClient.java b/src/main/java/com/merge/api/accounting/AsyncAsyncTasksClient.java new file mode 100644 index 000000000..979717c37 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAsyncTasksClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncTasksClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncTasksClient rawClient; + + public AsyncAsyncTasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncTasksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncTasksClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAttachmentsClient.java b/src/main/java/com/merge/api/accounting/AsyncAttachmentsClient.java new file mode 100644 index 000000000..2652c9594 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAttachmentsClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingAttachment; +import com.merge.api.accounting.types.AccountingAttachmentEndpointRequest; +import com.merge.api.accounting.types.AccountingAttachmentResponse; +import com.merge.api.accounting.types.AttachmentsListRequest; +import com.merge.api.accounting.types.AttachmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncAttachmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAttachmentsClient rawClient; + + public AsyncAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public CompletableFuture> list(AttachmentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public CompletableFuture> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public CompletableFuture create(AccountingAttachmentEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public CompletableFuture create( + AccountingAttachmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public CompletableFuture retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public CompletableFuture retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/accounting/AsyncAuditTrailClient.java new file mode 100644 index 000000000..eb92dd439 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AuditLogEvent; +import com.merge.api.accounting.types.AuditTrailListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/accounting/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..259388c9a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AvailableActions; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncBalanceSheetsClient.java b/src/main/java/com/merge/api/accounting/AsyncBalanceSheetsClient.java new file mode 100644 index 000000000..7e0960cc6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncBalanceSheetsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BalanceSheet; +import com.merge.api.accounting.types.BalanceSheetsListRequest; +import com.merge.api.accounting.types.BalanceSheetsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncBalanceSheetsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBalanceSheetsClient rawClient; + + public AsyncBalanceSheetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBalanceSheetsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBalanceSheetsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BalanceSheet objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public CompletableFuture> list(BalanceSheetsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public CompletableFuture> list( + BalanceSheetsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public CompletableFuture retrieve(String id, BalanceSheetsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public CompletableFuture retrieve( + String id, BalanceSheetsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncBankFeedAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncBankFeedAccountsClient.java new file mode 100644 index 000000000..cc70d792d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncBankFeedAccountsClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedAccount; +import com.merge.api.accounting.types.BankFeedAccountEndpointRequest; +import com.merge.api.accounting.types.BankFeedAccountResponse; +import com.merge.api.accounting.types.BankFeedAccountsListRequest; +import com.merge.api.accounting.types.BankFeedAccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncBankFeedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBankFeedAccountsClient rawClient; + + public AsyncBankFeedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBankFeedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBankFeedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public CompletableFuture> list(BankFeedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public CompletableFuture> list( + BankFeedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public CompletableFuture create(BankFeedAccountEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public CompletableFuture create( + BankFeedAccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public CompletableFuture retrieve(String id, BankFeedAccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public CompletableFuture retrieve( + String id, BankFeedAccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncBankFeedTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncBankFeedTransactionsClient.java new file mode 100644 index 000000000..3c0fcdcee --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncBankFeedTransactionsClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedTransaction; +import com.merge.api.accounting.types.BankFeedTransactionEndpointRequest; +import com.merge.api.accounting.types.BankFeedTransactionResponse; +import com.merge.api.accounting.types.BankFeedTransactionsListRequest; +import com.merge.api.accounting.types.BankFeedTransactionsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncBankFeedTransactionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBankFeedTransactionsClient rawClient; + + public AsyncBankFeedTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBankFeedTransactionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBankFeedTransactionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public CompletableFuture> list(BankFeedTransactionsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public CompletableFuture> list( + BankFeedTransactionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public CompletableFuture create(BankFeedTransactionEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public CompletableFuture create( + BankFeedTransactionEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public CompletableFuture retrieve(String id, BankFeedTransactionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public CompletableFuture retrieve( + String id, BankFeedTransactionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncCashFlowStatementsClient.java b/src/main/java/com/merge/api/accounting/AsyncCashFlowStatementsClient.java new file mode 100644 index 000000000..12e0c2ac5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncCashFlowStatementsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CashFlowStatement; +import com.merge.api.accounting.types.CashFlowStatementsListRequest; +import com.merge.api.accounting.types.CashFlowStatementsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncCashFlowStatementsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCashFlowStatementsClient rawClient; + + public AsyncCashFlowStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCashFlowStatementsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCashFlowStatementsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public CompletableFuture> list(CashFlowStatementsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public CompletableFuture> list( + CashFlowStatementsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CompletableFuture retrieve(String id, CashFlowStatementsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CompletableFuture retrieve( + String id, CashFlowStatementsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncCompanyInfoClient.java b/src/main/java/com/merge/api/accounting/AsyncCompanyInfoClient.java new file mode 100644 index 000000000..d68f7f0c9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncCompanyInfoClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CompanyInfo; +import com.merge.api.accounting.types.CompanyInfoListRequest; +import com.merge.api.accounting.types.CompanyInfoRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncCompanyInfoClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCompanyInfoClient rawClient; + + public AsyncCompanyInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCompanyInfoClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCompanyInfoClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CompanyInfo objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public CompletableFuture> list(CompanyInfoListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public CompletableFuture> list( + CompanyInfoListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompletableFuture retrieve(String id, CompanyInfoRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompletableFuture retrieve( + String id, CompanyInfoRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncContactsClient.java b/src/main/java/com/merge/api/accounting/AsyncContactsClient.java new file mode 100644 index 000000000..4f626f9e3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncContactsClient.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Contact; +import com.merge.api.accounting.types.ContactEndpointRequest; +import com.merge.api.accounting.types.ContactResponse; +import com.merge.api.accounting.types.ContactsListRequest; +import com.merge.api.accounting.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ContactsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncContactsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawContactsClient rawClient; + + public AsyncContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawContactsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawContactsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list(ContactsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list( + ContactsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture create(ContactEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture create(ContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve(String id, ContactsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Contact POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Contact POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncCreditNotesClient.java b/src/main/java/com/merge/api/accounting/AsyncCreditNotesClient.java new file mode 100644 index 000000000..94b875854 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncCreditNotesClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CreditNote; +import com.merge.api.accounting.types.CreditNoteEndpointRequest; +import com.merge.api.accounting.types.CreditNoteResponse; +import com.merge.api.accounting.types.CreditNotesListRequest; +import com.merge.api.accounting.types.CreditNotesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncCreditNotesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCreditNotesClient rawClient; + + public AsyncCreditNotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCreditNotesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCreditNotesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CreditNote objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of CreditNote objects. + */ + public CompletableFuture> list(CreditNotesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of CreditNote objects. + */ + public CompletableFuture> list( + CreditNotesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a CreditNote object with the given values. + */ + public CompletableFuture create(CreditNoteEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a CreditNote object with the given values. + */ + public CompletableFuture create( + CreditNoteEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CompletableFuture retrieve(String id, CreditNotesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CompletableFuture retrieve( + String id, CreditNotesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/accounting/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..588db3acc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncEmployeesClient.java b/src/main/java/com/merge/api/accounting/AsyncEmployeesClient.java new file mode 100644 index 000000000..44d7464f7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncEmployeesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Employee; +import com.merge.api.accounting.types.EmployeesListRequest; +import com.merge.api.accounting.types.EmployeesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncEmployeesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEmployeesClient rawClient; + + public AsyncEmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEmployeesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEmployeesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture> list(EmployeesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture> list( + EmployeesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture retrieve(String id, EmployeesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture retrieve( + String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncExpensesClient.java b/src/main/java/com/merge/api/accounting/AsyncExpensesClient.java new file mode 100644 index 000000000..d06106a84 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncExpensesClient.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseEndpointRequest; +import com.merge.api.accounting.types.ExpenseResponse; +import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesListRequest; +import com.merge.api.accounting.types.ExpensesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncExpensesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawExpensesClient rawClient; + + public AsyncExpensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawExpensesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawExpensesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Expense objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Expense objects. + */ + public CompletableFuture> list(ExpensesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Expense objects. + */ + public CompletableFuture> list( + ExpensesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Expense object with the given values. + */ + public CompletableFuture create(ExpenseEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Expense object with the given values. + */ + public CompletableFuture create(ExpenseEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Expense object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Expense object with the given id. + */ + public CompletableFuture retrieve(String id, ExpensesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Expense object with the given id. + */ + public CompletableFuture retrieve( + String id, ExpensesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for Expense POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Expense POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/accounting/AsyncFieldMappingClient.java new file mode 100644 index 000000000..2ea328578 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncFieldMappingClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CreateFieldMappingRequest; +import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; +import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; +import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; +import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; +import com.merge.api.accounting.types.RemoteFieldApiResponse; +import com.merge.api.accounting.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncForceResyncClient.java b/src/main/java/com/merge/api/accounting/AsyncForceResyncClient.java new file mode 100644 index 000000000..c4c6c11ad --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncGeneralLedgerTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncGeneralLedgerTransactionsClient.java new file mode 100644 index 000000000..7f8480fed --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncGeneralLedgerTransactionsClient.java @@ -0,0 +1,76 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.GeneralLedgerTransaction; +import com.merge.api.accounting.types.GeneralLedgerTransactionsListRequest; +import com.merge.api.accounting.types.GeneralLedgerTransactionsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncGeneralLedgerTransactionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGeneralLedgerTransactionsClient rawClient; + + public AsyncGeneralLedgerTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGeneralLedgerTransactionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGeneralLedgerTransactionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public CompletableFuture> list( + GeneralLedgerTransactionsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public CompletableFuture> list( + GeneralLedgerTransactionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public CompletableFuture retrieve( + String id, GeneralLedgerTransactionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public CompletableFuture retrieve( + String id, GeneralLedgerTransactionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/accounting/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..521ae60ed --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.GenerateRemoteKeyRequest; +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncIncomeStatementsClient.java b/src/main/java/com/merge/api/accounting/AsyncIncomeStatementsClient.java new file mode 100644 index 000000000..153a462bf --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncIncomeStatementsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.IncomeStatement; +import com.merge.api.accounting.types.IncomeStatementsListRequest; +import com.merge.api.accounting.types.IncomeStatementsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncIncomeStatementsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIncomeStatementsClient rawClient; + + public AsyncIncomeStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIncomeStatementsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIncomeStatementsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of IncomeStatement objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public CompletableFuture> list(IncomeStatementsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public CompletableFuture> list( + IncomeStatementsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public CompletableFuture retrieve(String id, IncomeStatementsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public CompletableFuture retrieve( + String id, IncomeStatementsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java b/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java new file mode 100644 index 000000000..897b611c4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java @@ -0,0 +1,188 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceEndpointRequest; +import com.merge.api.accounting.types.InvoiceResponse; +import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedInvoiceEndpointRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncInvoicesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawInvoicesClient rawClient; + + public AsyncInvoicesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawInvoicesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawInvoicesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Invoice objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Invoice objects. + */ + public CompletableFuture> list(InvoicesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Invoice objects. + */ + public CompletableFuture> list( + InvoicesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public CompletableFuture create(InvoiceEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public CompletableFuture create(InvoiceEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Invoice object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Invoice object with the given id. + */ + public CompletableFuture retrieve(String id, InvoicesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Invoice object with the given id. + */ + public CompletableFuture retrieve( + String id, InvoicesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates an Invoice object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedInvoiceEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates an Invoice object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedInvoiceEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList() { + return this.rawClient.lineItemsRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest request) { + return this.rawClient.lineItemsRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .lineItemsRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Invoice POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Invoice POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncIssuesClient.java b/src/main/java/com/merge/api/accounting/AsyncIssuesClient.java new file mode 100644 index 000000000..86facea3a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Issue; +import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncItemsClient.java b/src/main/java/com/merge/api/accounting/AsyncItemsClient.java new file mode 100644 index 000000000..684994ae5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncItemsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Item; +import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncItemsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawItemsClient rawClient; + + public AsyncItemsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawItemsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawItemsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Item objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Item objects. + */ + public CompletableFuture> list(ItemsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Item objects. + */ + public CompletableFuture> list(ItemsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Item object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Item object with the given id. + */ + public CompletableFuture retrieve(String id, ItemsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Item object with the given id. + */ + public CompletableFuture retrieve(String id, ItemsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncJournalEntriesClient.java b/src/main/java/com/merge/api/accounting/AsyncJournalEntriesClient.java new file mode 100644 index 000000000..202e78b37 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncJournalEntriesClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.JournalEntriesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesListRequest; +import com.merge.api.accounting.types.JournalEntriesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesRetrieveRequest; +import com.merge.api.accounting.types.JournalEntry; +import com.merge.api.accounting.types.JournalEntryEndpointRequest; +import com.merge.api.accounting.types.JournalEntryResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncJournalEntriesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawJournalEntriesClient rawClient; + + public AsyncJournalEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawJournalEntriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawJournalEntriesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of JournalEntry objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of JournalEntry objects. + */ + public CompletableFuture> list(JournalEntriesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of JournalEntry objects. + */ + public CompletableFuture> list( + JournalEntriesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a JournalEntry object with the given values. + */ + public CompletableFuture create(JournalEntryEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a JournalEntry object with the given values. + */ + public CompletableFuture create( + JournalEntryEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public CompletableFuture retrieve(String id, JournalEntriesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public CompletableFuture retrieve( + String id, JournalEntriesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncLinkTokenClient.java new file mode 100644 index 000000000..5c237a789 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.EndUserDetailsRequest; +import com.merge.api.accounting.types.LinkToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..d0c86036c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetailsAndActions; +import com.merge.api.accounting.types.LinkedAccountsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncPassthroughClient.java b/src/main/java/com/merge/api/accounting/AsyncPassthroughClient.java new file mode 100644 index 000000000..b02b3eb86 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.DataPassthroughRequest; +import com.merge.api.accounting.types.RemoteResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncPaymentMethodsClient.java b/src/main/java/com/merge/api/accounting/AsyncPaymentMethodsClient.java new file mode 100644 index 000000000..648dd5874 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncPaymentMethodsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaymentMethod; +import com.merge.api.accounting.types.PaymentMethodsListRequest; +import com.merge.api.accounting.types.PaymentMethodsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncPaymentMethodsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPaymentMethodsClient rawClient; + + public AsyncPaymentMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPaymentMethodsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPaymentMethodsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PaymentMethod objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public CompletableFuture> list(PaymentMethodsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public CompletableFuture> list( + PaymentMethodsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public CompletableFuture retrieve(String id, PaymentMethodsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public CompletableFuture retrieve( + String id, PaymentMethodsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncPaymentTermsClient.java b/src/main/java/com/merge/api/accounting/AsyncPaymentTermsClient.java new file mode 100644 index 000000000..8b6a87bd4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncPaymentTermsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaymentTerm; +import com.merge.api.accounting.types.PaymentTermsListRequest; +import com.merge.api.accounting.types.PaymentTermsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncPaymentTermsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPaymentTermsClient rawClient; + + public AsyncPaymentTermsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPaymentTermsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPaymentTermsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PaymentTerm objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public CompletableFuture> list(PaymentTermsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public CompletableFuture> list( + PaymentTermsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public CompletableFuture retrieve(String id, PaymentTermsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public CompletableFuture retrieve( + String id, PaymentTermsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncPaymentsClient.java b/src/main/java/com/merge/api/accounting/AsyncPaymentsClient.java new file mode 100644 index 000000000..7349da1c7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncPaymentsClient.java @@ -0,0 +1,186 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedPaymentEndpointRequest; +import com.merge.api.accounting.types.Payment; +import com.merge.api.accounting.types.PaymentEndpointRequest; +import com.merge.api.accounting.types.PaymentResponse; +import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncPaymentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPaymentsClient rawClient; + + public AsyncPaymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPaymentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPaymentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Payment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Payment objects. + */ + public CompletableFuture> list(PaymentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Payment objects. + */ + public CompletableFuture> list( + PaymentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Payment object with the given values. + */ + public CompletableFuture create(PaymentEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Payment object with the given values. + */ + public CompletableFuture create(PaymentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Payment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Payment object with the given id. + */ + public CompletableFuture retrieve(String id, PaymentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Payment object with the given id. + */ + public CompletableFuture retrieve( + String id, PaymentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates a Payment object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedPaymentEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a Payment object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedPaymentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList() { + return this.rawClient.lineItemsRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest request) { + return this.rawClient.lineItemsRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .lineItemsRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Payment POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Payment POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncPhoneNumbersClient.java b/src/main/java/com/merge/api/accounting/AsyncPhoneNumbersClient.java new file mode 100644 index 000000000..b17541ec1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncPhoneNumbersClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPhoneNumber; +import com.merge.api.accounting.types.PhoneNumbersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncPhoneNumbersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPhoneNumbersClient rawClient; + + public AsyncPhoneNumbersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPhoneNumbersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPhoneNumbersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public CompletableFuture retrieve(String id, PhoneNumbersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public CompletableFuture retrieve( + String id, PhoneNumbersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncPurchaseOrdersClient.java b/src/main/java/com/merge/api/accounting/AsyncPurchaseOrdersClient.java new file mode 100644 index 000000000..6a9c103f7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncPurchaseOrdersClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PurchaseOrder; +import com.merge.api.accounting.types.PurchaseOrderEndpointRequest; +import com.merge.api.accounting.types.PurchaseOrderResponse; +import com.merge.api.accounting.types.PurchaseOrdersLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncPurchaseOrdersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPurchaseOrdersClient rawClient; + + public AsyncPurchaseOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPurchaseOrdersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPurchaseOrdersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public CompletableFuture> list(PurchaseOrdersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public CompletableFuture> list( + PurchaseOrdersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public CompletableFuture create(PurchaseOrderEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public CompletableFuture create( + PurchaseOrderEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public CompletableFuture retrieve(String id, PurchaseOrdersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public CompletableFuture retrieve( + String id, PurchaseOrdersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList() { + return this.rawClient.lineItemsRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest request) { + return this.rawClient.lineItemsRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .lineItemsRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..4ba5795ff --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountDetailsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetails; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..95663fee5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountTokenClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java new file mode 100644 index 000000000..f80e77267 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java @@ -0,0 +1,232 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPeriod; +import com.merge.api.accounting.types.AccountingPeriodsListRequest; +import com.merge.api.accounting.types.AccountingPeriodsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedAccountingPeriodList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountingPeriodsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountingPeriodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public CompletableFuture>> list() { + return list(AccountingPeriodsListRequest.builder().build()); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public CompletableFuture>> list( + AccountingPeriodsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public CompletableFuture>> list( + AccountingPeriodsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounting-periods"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountingPeriodList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountingPeriodList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountingPeriodsListRequest nextRequest = AccountingPeriodsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AccountingPeriodsRetrieveRequest.builder().build()); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public CompletableFuture> retrieve( + String id, AccountingPeriodsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public CompletableFuture> retrieve( + String id, AccountingPeriodsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounting-periods") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPeriod.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java new file mode 100644 index 000000000..28d81eef8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java @@ -0,0 +1,434 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Account; +import com.merge.api.accounting.types.AccountEndpointRequest; +import com.merge.api.accounting.types.AccountResponse; +import com.merge.api.accounting.types.AccountsListRequest; +import com.merge.api.accounting.types.AccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedAccountList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list() { + return list(AccountsListRequest.builder().build()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list(AccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list( + AccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts"); + if (request.getAccountType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_type", request.getAccountType().get(), false); + } + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsListRequest nextRequest = AccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture> create(AccountEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture> create( + AccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AccountsRetrieveRequest.builder().build()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve(String id, AccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Account POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Account POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAddressesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAddressesClient.java new file mode 100644 index 000000000..7712a1f4c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAddressesClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Address; +import com.merge.api.accounting.types.AddressesRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAddressesClient { + protected final ClientOptions clientOptions; + + public AsyncRawAddressesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns an Address object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AddressesRetrieveRequest.builder().build()); + } + + /** + * Returns an Address object with the given id. + */ + public CompletableFuture> retrieve(String id, AddressesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Address object with the given id. + */ + public CompletableFuture> retrieve( + String id, AddressesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/addresses") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Address.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..83640c016 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncPassthroughReciept; +import com.merge.api.accounting.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.accounting.types.DataPassthroughRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughReciept.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java new file mode 100644 index 000000000..50576f677 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncTasksClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncTasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .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") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPostTask.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java new file mode 100644 index 000000000..7278b5c9d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java @@ -0,0 +1,399 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingAttachment; +import com.merge.api.accounting.types.AccountingAttachmentEndpointRequest; +import com.merge.api.accounting.types.AccountingAttachmentResponse; +import com.merge.api.accounting.types.AttachmentsListRequest; +import com.merge.api.accounting.types.AttachmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedAccountingAttachmentList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAttachmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public CompletableFuture>> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountingAttachmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountingAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public CompletableFuture> create( + AccountingAttachmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public CompletableFuture> create( + AccountingAttachmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AccountingAttachmentResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public CompletableFuture> retrieve( + String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public CompletableFuture> retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingAttachment.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..a07e9b344 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AuditLogEvent; +import com.merge.api.accounting.types.AuditTrailListRequest; +import com.merge.api.accounting.types.PaginatedAuditLogEventList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..09bac4b6b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawAvailableActionsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AvailableActions; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java new file mode 100644 index 000000000..3bfdfd990 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BalanceSheet; +import com.merge.api.accounting.types.BalanceSheetsListRequest; +import com.merge.api.accounting.types.BalanceSheetsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedBalanceSheetList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBalanceSheetsClient { + protected final ClientOptions clientOptions; + + public AsyncRawBalanceSheetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BalanceSheet objects. + */ + public CompletableFuture>> list() { + return list(BalanceSheetsListRequest.builder().build()); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public CompletableFuture>> list( + BalanceSheetsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public CompletableFuture>> list( + BalanceSheetsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/balance-sheets"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedBalanceSheetList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedBalanceSheetList.class); + Optional startingAfter = parsedResponse.getNext(); + BalanceSheetsListRequest nextRequest = BalanceSheetsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, BalanceSheetsRetrieveRequest.builder().build()); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public CompletableFuture> retrieve( + String id, BalanceSheetsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public CompletableFuture> retrieve( + String id, BalanceSheetsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/balance-sheets") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BalanceSheet.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java new file mode 100644 index 000000000..c275d8f30 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedAccount; +import com.merge.api.accounting.types.BankFeedAccountEndpointRequest; +import com.merge.api.accounting.types.BankFeedAccountResponse; +import com.merge.api.accounting.types.BankFeedAccountsListRequest; +import com.merge.api.accounting.types.BankFeedAccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedBankFeedAccountList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBankFeedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawBankFeedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public CompletableFuture>> list() { + return list(BankFeedAccountsListRequest.builder().build()); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public CompletableFuture>> list( + BankFeedAccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public CompletableFuture>> list( + BankFeedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedBankFeedAccountList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedBankFeedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + BankFeedAccountsListRequest nextRequest = BankFeedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public CompletableFuture> create( + BankFeedAccountEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public CompletableFuture> create( + BankFeedAccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), BankFeedAccountResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, BankFeedAccountsRetrieveRequest.builder().build()); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public CompletableFuture> retrieve( + String id, BankFeedAccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public CompletableFuture> retrieve( + String id, BankFeedAccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedAccount.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java new file mode 100644 index 000000000..bd5ebe903 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java @@ -0,0 +1,407 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedTransaction; +import com.merge.api.accounting.types.BankFeedTransactionEndpointRequest; +import com.merge.api.accounting.types.BankFeedTransactionResponse; +import com.merge.api.accounting.types.BankFeedTransactionsListRequest; +import com.merge.api.accounting.types.BankFeedTransactionsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedBankFeedTransactionList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBankFeedTransactionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawBankFeedTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public CompletableFuture>> list() { + return list(BankFeedTransactionsListRequest.builder().build()); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public CompletableFuture>> list( + BankFeedTransactionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public CompletableFuture>> list( + BankFeedTransactionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsProcessed().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_processed", request.getIsProcessed().get().toString(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedBankFeedTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedBankFeedTransactionList.class); + Optional startingAfter = parsedResponse.getNext(); + BankFeedTransactionsListRequest nextRequest = BankFeedTransactionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public CompletableFuture> create( + BankFeedTransactionEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public CompletableFuture> create( + BankFeedTransactionEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), BankFeedTransactionResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, BankFeedTransactionsRetrieveRequest.builder().build()); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public CompletableFuture> retrieve( + String id, BankFeedTransactionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public CompletableFuture> retrieve( + String id, BankFeedTransactionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedTransaction.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java new file mode 100644 index 000000000..3b8c0a077 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java @@ -0,0 +1,267 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CashFlowStatement; +import com.merge.api.accounting.types.CashFlowStatementsListRequest; +import com.merge.api.accounting.types.CashFlowStatementsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedCashFlowStatementList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCashFlowStatementsClient { + protected final ClientOptions clientOptions; + + public AsyncRawCashFlowStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public CompletableFuture>> list() { + return list(CashFlowStatementsListRequest.builder().build()); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public CompletableFuture>> list( + CashFlowStatementsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public CompletableFuture>> list( + CashFlowStatementsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/cash-flow-statements"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCashFlowStatementList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCashFlowStatementList.class); + Optional startingAfter = parsedResponse.getNext(); + CashFlowStatementsListRequest nextRequest = CashFlowStatementsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CashFlowStatementsRetrieveRequest.builder().build()); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CompletableFuture> retrieve( + String id, CashFlowStatementsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CompletableFuture> retrieve( + String id, CashFlowStatementsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/cash-flow-statements") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CashFlowStatement.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java b/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java new file mode 100644 index 000000000..9d002a586 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java @@ -0,0 +1,261 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CompanyInfo; +import com.merge.api.accounting.types.CompanyInfoListRequest; +import com.merge.api.accounting.types.CompanyInfoRetrieveRequest; +import com.merge.api.accounting.types.PaginatedCompanyInfoList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCompanyInfoClient { + protected final ClientOptions clientOptions; + + public AsyncRawCompanyInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CompanyInfo objects. + */ + public CompletableFuture>> list() { + return list(CompanyInfoListRequest.builder().build()); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public CompletableFuture>> list( + CompanyInfoListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public CompletableFuture>> list( + CompanyInfoListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/company-info"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCompanyInfoList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCompanyInfoList.class); + Optional startingAfter = parsedResponse.getNext(); + CompanyInfoListRequest nextRequest = CompanyInfoListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CompanyInfoRetrieveRequest.builder().build()); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompletableFuture> retrieve( + String id, CompanyInfoRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompletableFuture> retrieve( + String id, CompanyInfoRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/company-info") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CompanyInfo.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java new file mode 100644 index 000000000..4a0f919cd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java @@ -0,0 +1,574 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Contact; +import com.merge.api.accounting.types.ContactEndpointRequest; +import com.merge.api.accounting.types.ContactResponse; +import com.merge.api.accounting.types.ContactsListRequest; +import com.merge.api.accounting.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ContactsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedContactList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawContactsClient { + protected final ClientOptions clientOptions; + + public AsyncRawContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list() { + return list(ContactsListRequest.builder().build()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list(ContactsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list( + ContactsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_address", request.getEmailAddress().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCustomer().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_customer", request.getIsCustomer().get(), false); + } + if (request.getIsSupplier().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_supplier", request.getIsSupplier().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedContactList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsListRequest nextRequest = ContactsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture> create(ContactEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture> create( + ContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ContactResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ContactsRetrieveRequest.builder().build()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve(String id, ContactsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Contact POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Contact POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsRemoteFieldClassesListRequest nextRequest = + ContactsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java new file mode 100644 index 000000000..583e01df4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java @@ -0,0 +1,438 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CreditNote; +import com.merge.api.accounting.types.CreditNoteEndpointRequest; +import com.merge.api.accounting.types.CreditNoteResponse; +import com.merge.api.accounting.types.CreditNotesListRequest; +import com.merge.api.accounting.types.CreditNotesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedCreditNoteList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCreditNotesClient { + protected final ClientOptions clientOptions; + + public AsyncRawCreditNotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CreditNote objects. + */ + public CompletableFuture>> list() { + return list(CreditNotesListRequest.builder().build()); + } + + /** + * Returns a list of CreditNote objects. + */ + public CompletableFuture>> list( + CreditNotesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CreditNote objects. + */ + public CompletableFuture>> list( + CreditNotesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCreditNoteList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCreditNoteList.class); + Optional startingAfter = parsedResponse.getNext(); + CreditNotesListRequest nextRequest = CreditNotesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a CreditNote object with the given values. + */ + public CompletableFuture> create(CreditNoteEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a CreditNote object with the given values. + */ + public CompletableFuture> create( + CreditNoteEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a CreditNote object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CreditNotesRetrieveRequest.builder().build()); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CompletableFuture> retrieve(String id, CreditNotesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CompletableFuture> retrieve( + String id, CreditNotesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNote.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/accounting/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..3eb00d200 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawDeleteAccountClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java new file mode 100644 index 000000000..69ba89e8f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java @@ -0,0 +1,235 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Employee; +import com.merge.api.accounting.types.EmployeesListRequest; +import com.merge.api.accounting.types.EmployeesRetrieveRequest; +import com.merge.api.accounting.types.PaginatedEmployeeList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEmployeesClient { + protected final ClientOptions clientOptions; + + public AsyncRawEmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture>> list() { + return list(EmployeesListRequest.builder().build()); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture>> list(EmployeesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture>> list( + EmployeesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/employees"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEmployeeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployeesListRequest nextRequest = EmployeesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EmployeesRetrieveRequest.builder().build()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture> retrieve(String id, EmployeesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture> retrieve( + String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/employees") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java new file mode 100644 index 000000000..26e554632 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java @@ -0,0 +1,674 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseEndpointRequest; +import com.merge.api.accounting.types.ExpenseResponse; +import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesListRequest; +import com.merge.api.accounting.types.ExpensesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedExpenseList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawExpensesClient { + protected final ClientOptions clientOptions; + + public AsyncRawExpensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Expense objects. + */ + public CompletableFuture>> list() { + return list(ExpensesListRequest.builder().build()); + } + + /** + * Returns a list of Expense objects. + */ + public CompletableFuture>> list(ExpensesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Expense objects. + */ + public CompletableFuture>> list( + ExpensesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedExpenseList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedExpenseList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpensesListRequest nextRequest = ExpensesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Expense object with the given values. + */ + public CompletableFuture> create(ExpenseEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Expense object with the given values. + */ + public CompletableFuture> create( + ExpenseEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ExpenseResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Expense object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ExpensesRetrieveRequest.builder().build()); + } + + /** + * Returns an Expense object with the given id. + */ + public CompletableFuture> retrieve(String id, ExpensesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Expense object with the given id. + */ + public CompletableFuture> retrieve( + String id, ExpensesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Expense.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpensesLinesRemoteFieldClassesListRequest nextRequest = + ExpensesLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return linesRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Expense POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Expense POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpensesRemoteFieldClassesListRequest nextRequest = + ExpensesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..bf83f1de3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.CreateFieldMappingRequest; +import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; +import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; +import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; +import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; +import com.merge.api.accounting.types.RemoteFieldApiResponse; +import com.merge.api.accounting.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), RemoteFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/accounting/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..696dcd1a1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawForceResyncClient.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java new file mode 100644 index 000000000..86ee2ec9d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java @@ -0,0 +1,284 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.GeneralLedgerTransaction; +import com.merge.api.accounting.types.GeneralLedgerTransactionsListRequest; +import com.merge.api.accounting.types.GeneralLedgerTransactionsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedGeneralLedgerTransactionList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGeneralLedgerTransactionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawGeneralLedgerTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public CompletableFuture>> list() { + return list(GeneralLedgerTransactionsListRequest.builder().build()); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public CompletableFuture>> list( + GeneralLedgerTransactionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public CompletableFuture>> list( + GeneralLedgerTransactionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/general-ledger-transactions"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPostedDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "posted_date_after", + request.getPostedDateAfter().get().toString(), + false); + } + if (request.getPostedDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "posted_date_before", + request.getPostedDateBefore().get().toString(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedGeneralLedgerTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedGeneralLedgerTransactionList.class); + Optional startingAfter = parsedResponse.getNext(); + GeneralLedgerTransactionsListRequest nextRequest = + GeneralLedgerTransactionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, GeneralLedgerTransactionsRetrieveRequest.builder().build()); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public CompletableFuture> retrieve( + String id, GeneralLedgerTransactionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public CompletableFuture> retrieve( + String id, GeneralLedgerTransactionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/general-ledger-transactions") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), GeneralLedgerTransaction.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/accounting/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..42f58d785 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawGenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.GenerateRemoteKeyRequest; +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java new file mode 100644 index 000000000..0eef25c21 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.IncomeStatement; +import com.merge.api.accounting.types.IncomeStatementsListRequest; +import com.merge.api.accounting.types.IncomeStatementsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedIncomeStatementList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIncomeStatementsClient { + protected final ClientOptions clientOptions; + + public AsyncRawIncomeStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of IncomeStatement objects. + */ + public CompletableFuture>> list() { + return list(IncomeStatementsListRequest.builder().build()); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public CompletableFuture>> list( + IncomeStatementsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public CompletableFuture>> list( + IncomeStatementsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/income-statements"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedIncomeStatementList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedIncomeStatementList.class); + Optional startingAfter = parsedResponse.getNext(); + IncomeStatementsListRequest nextRequest = IncomeStatementsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, IncomeStatementsRetrieveRequest.builder().build()); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public CompletableFuture> retrieve( + String id, IncomeStatementsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public CompletableFuture> retrieve( + String id, IncomeStatementsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/income-statements") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), IncomeStatement.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java new file mode 100644 index 000000000..db5ebf54b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java @@ -0,0 +1,846 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceEndpointRequest; +import com.merge.api.accounting.types.InvoiceResponse; +import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedInvoiceList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PatchedInvoiceEndpointRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawInvoicesClient { + protected final ClientOptions clientOptions; + + public AsyncRawInvoicesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Invoice objects. + */ + public CompletableFuture>> list() { + return list(InvoicesListRequest.builder().build()); + } + + /** + * Returns a list of Invoice objects. + */ + public CompletableFuture>> list(InvoicesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Invoice objects. + */ + public CompletableFuture>> list( + InvoicesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIssueDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_after", + request.getIssueDateAfter().get().toString(), + false); + } + if (request.getIssueDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_before", + request.getIssueDateBefore().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getNumber().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "number", request.getNumber().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "type", request.getType().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedInvoiceList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedInvoiceList.class); + Optional startingAfter = parsedResponse.getNext(); + InvoicesListRequest nextRequest = InvoicesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public CompletableFuture> create(InvoiceEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public CompletableFuture> create( + InvoiceEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Invoice object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, InvoicesRetrieveRequest.builder().build()); + } + + /** + * Returns an Invoice object with the given id. + */ + public CompletableFuture> retrieve(String id, InvoicesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Invoice object with the given id. + */ + public CompletableFuture> retrieve( + String id, InvoicesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Invoice.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates an Invoice object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedInvoiceEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Invoice object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedInvoiceEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList() { + return lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList(InvoicesLineItemsRemoteFieldClassesListRequest request) { + return lineItemsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/line-items/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + InvoicesLineItemsRemoteFieldClassesListRequest nextRequest = + InvoicesLineItemsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return lineItemsRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Invoice POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Invoice POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + InvoicesRemoteFieldClassesListRequest nextRequest = + InvoicesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java new file mode 100644 index 000000000..ec520cc81 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Issue; +import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.accounting.types.PaginatedIssueList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java new file mode 100644 index 000000000..af900d8e1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java @@ -0,0 +1,278 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Item; +import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedItemList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawItemsClient { + protected final ClientOptions clientOptions; + + public AsyncRawItemsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Item objects. + */ + public CompletableFuture>> list() { + return list(ItemsListRequest.builder().build()); + } + + /** + * Returns a list of Item objects. + */ + public CompletableFuture>> list(ItemsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Item objects. + */ + public CompletableFuture>> list( + ItemsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/items"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedItemList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedItemList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemsListRequest nextRequest = ItemsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Item object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ItemsRetrieveRequest.builder().build()); + } + + /** + * Returns an Item object with the given id. + */ + public CompletableFuture> retrieve(String id, ItemsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Item object with the given id. + */ + public CompletableFuture> retrieve( + String id, ItemsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/items") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Item.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java new file mode 100644 index 000000000..7c89988df --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java @@ -0,0 +1,677 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.JournalEntriesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesListRequest; +import com.merge.api.accounting.types.JournalEntriesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesRetrieveRequest; +import com.merge.api.accounting.types.JournalEntry; +import com.merge.api.accounting.types.JournalEntryEndpointRequest; +import com.merge.api.accounting.types.JournalEntryResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedJournalEntryList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawJournalEntriesClient { + protected final ClientOptions clientOptions; + + public AsyncRawJournalEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of JournalEntry objects. + */ + public CompletableFuture>> list() { + return list(JournalEntriesListRequest.builder().build()); + } + + /** + * Returns a list of JournalEntry objects. + */ + public CompletableFuture>> list( + JournalEntriesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of JournalEntry objects. + */ + public CompletableFuture>> list( + JournalEntriesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedJournalEntryList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedJournalEntryList.class); + Optional startingAfter = parsedResponse.getNext(); + JournalEntriesListRequest nextRequest = JournalEntriesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a JournalEntry object with the given values. + */ + public CompletableFuture> create(JournalEntryEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a JournalEntry object with the given values. + */ + public CompletableFuture> create( + JournalEntryEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntryResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a JournalEntry object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, JournalEntriesRetrieveRequest.builder().build()); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public CompletableFuture> retrieve( + String id, JournalEntriesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public CompletableFuture> retrieve( + String id, JournalEntriesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntry.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + JournalEntriesLinesRemoteFieldClassesListRequest nextRequest = + JournalEntriesLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return linesRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + JournalEntriesRemoteFieldClassesListRequest nextRequest = + JournalEntriesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..84014f88e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.EndUserDetailsRequest; +import com.merge.api.accounting.types.LinkToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..5f01579c9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetailsAndActions; +import com.merge.api.accounting.types.LinkedAccountsListRequest; +import com.merge.api.accounting.types.PaginatedAccountDetailsAndActionsList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..a4772e8b6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawPassthroughClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.DataPassthroughRequest; +import com.merge.api.accounting.types.RemoteResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java new file mode 100644 index 000000000..8be41507e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedPaymentMethodList; +import com.merge.api.accounting.types.PaymentMethod; +import com.merge.api.accounting.types.PaymentMethodsListRequest; +import com.merge.api.accounting.types.PaymentMethodsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPaymentMethodsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPaymentMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PaymentMethod objects. + */ + public CompletableFuture>> list() { + return list(PaymentMethodsListRequest.builder().build()); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public CompletableFuture>> list( + PaymentMethodsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public CompletableFuture>> list( + PaymentMethodsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-methods"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedPaymentMethodList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedPaymentMethodList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentMethodsListRequest nextRequest = PaymentMethodsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, PaymentMethodsRetrieveRequest.builder().build()); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public CompletableFuture> retrieve( + String id, PaymentMethodsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public CompletableFuture> retrieve( + String id, PaymentMethodsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-methods") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentMethod.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java new file mode 100644 index 000000000..11d5c4fd4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java @@ -0,0 +1,238 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedPaymentTermList; +import com.merge.api.accounting.types.PaymentTerm; +import com.merge.api.accounting.types.PaymentTermsListRequest; +import com.merge.api.accounting.types.PaymentTermsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPaymentTermsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPaymentTermsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PaymentTerm objects. + */ + public CompletableFuture>> list() { + return list(PaymentTermsListRequest.builder().build()); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public CompletableFuture>> list( + PaymentTermsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public CompletableFuture>> list( + PaymentTermsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-terms"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedPaymentTermList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedPaymentTermList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentTermsListRequest nextRequest = PaymentTermsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, PaymentTermsRetrieveRequest.builder().build()); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public CompletableFuture> retrieve( + String id, PaymentTermsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public CompletableFuture> retrieve( + String id, PaymentTermsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-terms") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentTerm.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java new file mode 100644 index 000000000..f335b0751 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java @@ -0,0 +1,820 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedPaymentList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PatchedPaymentEndpointRequest; +import com.merge.api.accounting.types.Payment; +import com.merge.api.accounting.types.PaymentEndpointRequest; +import com.merge.api.accounting.types.PaymentResponse; +import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPaymentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPaymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Payment objects. + */ + public CompletableFuture>> list() { + return list(PaymentsListRequest.builder().build()); + } + + /** + * Returns a list of Payment objects. + */ + public CompletableFuture>> list(PaymentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Payment objects. + */ + public CompletableFuture>> list( + PaymentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedPaymentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentsListRequest nextRequest = PaymentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Payment object with the given values. + */ + public CompletableFuture> create(PaymentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Payment object with the given values. + */ + public CompletableFuture> create( + PaymentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Payment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, PaymentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Payment object with the given id. + */ + public CompletableFuture> retrieve(String id, PaymentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Payment object with the given id. + */ + public CompletableFuture> retrieve( + String id, PaymentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Payment.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a Payment object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedPaymentEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Payment object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedPaymentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList() { + return lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList(PaymentsLineItemsRemoteFieldClassesListRequest request) { + return lineItemsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/line-items/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentsLineItemsRemoteFieldClassesListRequest nextRequest = + PaymentsLineItemsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return lineItemsRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Payment PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Payment POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Payment POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentsRemoteFieldClassesListRequest nextRequest = + PaymentsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPhoneNumbersClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPhoneNumbersClient.java new file mode 100644 index 000000000..b67febaed --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawPhoneNumbersClient.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPhoneNumber; +import com.merge.api.accounting.types.PhoneNumbersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPhoneNumbersClient { + protected final ClientOptions clientOptions; + + public AsyncRawPhoneNumbersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, PhoneNumbersRetrieveRequest.builder().build()); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public CompletableFuture> retrieve( + String id, PhoneNumbersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public CompletableFuture> retrieve( + String id, PhoneNumbersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/phone-numbers") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPhoneNumber.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java new file mode 100644 index 000000000..81a725710 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java @@ -0,0 +1,695 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedPurchaseOrderList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PurchaseOrder; +import com.merge.api.accounting.types.PurchaseOrderEndpointRequest; +import com.merge.api.accounting.types.PurchaseOrderResponse; +import com.merge.api.accounting.types.PurchaseOrdersLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPurchaseOrdersClient { + protected final ClientOptions clientOptions; + + public AsyncRawPurchaseOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public CompletableFuture>> list() { + return list(PurchaseOrdersListRequest.builder().build()); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public CompletableFuture>> list( + PurchaseOrdersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public CompletableFuture>> list( + PurchaseOrdersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIssueDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_after", + request.getIssueDateAfter().get().toString(), + false); + } + if (request.getIssueDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_before", + request.getIssueDateBefore().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedPurchaseOrderList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedPurchaseOrderList.class); + Optional startingAfter = parsedResponse.getNext(); + PurchaseOrdersListRequest nextRequest = PurchaseOrdersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public CompletableFuture> create(PurchaseOrderEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public CompletableFuture> create( + PurchaseOrderEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrderResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, PurchaseOrdersRetrieveRequest.builder().build()); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public CompletableFuture> retrieve( + String id, PurchaseOrdersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public CompletableFuture> retrieve( + String id, PurchaseOrdersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrder.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList() { + return lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList(PurchaseOrdersLineItemsRemoteFieldClassesListRequest request) { + return lineItemsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders/line-items/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PurchaseOrdersLineItemsRemoteFieldClassesListRequest nextRequest = + PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return lineItemsRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PurchaseOrdersRemoteFieldClassesListRequest nextRequest = + PurchaseOrdersRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/accounting/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..134f27266 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.accounting.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawScopesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawScopesClient.java new file mode 100644 index 000000000..e0d64be8e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawScopesClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.CommonModelScopeApi; +import com.merge.api.accounting.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..04d428b39 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedSyncStatusList; +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.accounting.types.SyncStatusListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java new file mode 100644 index 000000000..950c368ab --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedTaxRateList; +import com.merge.api.accounting.types.TaxRate; +import com.merge.api.accounting.types.TaxRatesListRequest; +import com.merge.api.accounting.types.TaxRatesRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTaxRatesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTaxRatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TaxRate objects. + */ + public CompletableFuture>> list() { + return list(TaxRatesListRequest.builder().build()); + } + + /** + * Returns a list of TaxRate objects. + */ + public CompletableFuture>> list(TaxRatesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TaxRate objects. + */ + public CompletableFuture>> list( + TaxRatesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tax-rates"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTaxRateList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaxRateList.class); + Optional startingAfter = parsedResponse.getNext(); + TaxRatesListRequest nextRequest = TaxRatesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a TaxRate object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TaxRatesRetrieveRequest.builder().build()); + } + + /** + * Returns a TaxRate object with the given id. + */ + public CompletableFuture> retrieve(String id, TaxRatesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TaxRate object with the given id. + */ + public CompletableFuture> retrieve( + String id, TaxRatesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tax-rates") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaxRate.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java new file mode 100644 index 000000000..e9f0a58e8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java @@ -0,0 +1,295 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedTrackingCategoryList; +import com.merge.api.accounting.types.TrackingCategoriesListRequest; +import com.merge.api.accounting.types.TrackingCategoriesRetrieveRequest; +import com.merge.api.accounting.types.TrackingCategory; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTrackingCategoriesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTrackingCategoriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TrackingCategory objects. + */ + public CompletableFuture>> list() { + return list(TrackingCategoriesListRequest.builder().build()); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public CompletableFuture>> list( + TrackingCategoriesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public CompletableFuture>> list( + TrackingCategoriesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tracking-categories"); + if (request.getCategoryType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category_type", request.getCategoryType().get(), false); + } + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTrackingCategoryList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedTrackingCategoryList.class); + Optional startingAfter = parsedResponse.getNext(); + TrackingCategoriesListRequest nextRequest = TrackingCategoriesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TrackingCategoriesRetrieveRequest.builder().build()); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public CompletableFuture> retrieve( + String id, TrackingCategoriesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public CompletableFuture> retrieve( + String id, TrackingCategoriesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tracking-categories") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TrackingCategory.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java new file mode 100644 index 000000000..fe6d274ef --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java @@ -0,0 +1,279 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedTransactionList; +import com.merge.api.accounting.types.Transaction; +import com.merge.api.accounting.types.TransactionsListRequest; +import com.merge.api.accounting.types.TransactionsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTransactionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Transaction objects. + */ + public CompletableFuture>> list() { + return list(TransactionsListRequest.builder().build()); + } + + /** + * Returns a list of Transaction objects. + */ + public CompletableFuture>> list( + TransactionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Transaction objects. + */ + public CompletableFuture>> list( + TransactionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/transactions"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedTransactionList.class); + Optional startingAfter = parsedResponse.getNext(); + TransactionsListRequest nextRequest = TransactionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Transaction object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TransactionsRetrieveRequest.builder().build()); + } + + /** + * Returns a Transaction object with the given id. + */ + public CompletableFuture> retrieve( + String id, TransactionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Transaction object with the given id. + */ + public CompletableFuture> retrieve( + String id, TransactionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/transactions") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Transaction.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java new file mode 100644 index 000000000..79f9cc3df --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java @@ -0,0 +1,417 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedVendorCreditList; +import com.merge.api.accounting.types.VendorCredit; +import com.merge.api.accounting.types.VendorCreditEndpointRequest; +import com.merge.api.accounting.types.VendorCreditResponse; +import com.merge.api.accounting.types.VendorCreditsListRequest; +import com.merge.api.accounting.types.VendorCreditsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawVendorCreditsClient { + protected final ClientOptions clientOptions; + + public AsyncRawVendorCreditsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of VendorCredit objects. + */ + public CompletableFuture>> list() { + return list(VendorCreditsListRequest.builder().build()); + } + + /** + * Returns a list of VendorCredit objects. + */ + public CompletableFuture>> list( + VendorCreditsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of VendorCredit objects. + */ + public CompletableFuture>> list( + VendorCreditsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedVendorCreditList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedVendorCreditList.class); + Optional startingAfter = parsedResponse.getNext(); + VendorCreditsListRequest nextRequest = VendorCreditsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a VendorCredit object with the given values. + */ + public CompletableFuture> create(VendorCreditEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a VendorCredit object with the given values. + */ + public CompletableFuture> create( + VendorCreditEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCreditResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a VendorCredit object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, VendorCreditsRetrieveRequest.builder().build()); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public CompletableFuture> retrieve( + String id, VendorCreditsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public CompletableFuture> retrieve( + String id, VendorCreditsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCredit.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/accounting/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..60b9561c6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.accounting.types.WebhookReceiver; +import com.merge.api.accounting.types.WebhookReceiverRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/accounting/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..d82975e73 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.accounting.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncScopesClient.java b/src/main/java/com/merge/api/accounting/AsyncScopesClient.java new file mode 100644 index 000000000..92e0e0469 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CommonModelScopeApi; +import com.merge.api.accounting.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/accounting/AsyncSyncStatusClient.java new file mode 100644 index 000000000..d914eb8c2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.accounting.types.SyncStatusListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncTasksClient.java b/src/main/java/com/merge/api/accounting/AsyncTasksClient.java new file mode 100644 index 000000000..52421952f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncTasksClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AsyncTasksClient { + protected final ClientOptions clientOptions; + + private final RawAsyncTasksClient rawClient; + + public AsyncTasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAsyncTasksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAsyncTasksClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public AsyncPostTask retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public AsyncPostTask retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncTaxRatesClient.java b/src/main/java/com/merge/api/accounting/AsyncTaxRatesClient.java new file mode 100644 index 000000000..747ad2a6b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncTaxRatesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.TaxRate; +import com.merge.api.accounting.types.TaxRatesListRequest; +import com.merge.api.accounting.types.TaxRatesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncTaxRatesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTaxRatesClient rawClient; + + public AsyncTaxRatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTaxRatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTaxRatesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TaxRate objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of TaxRate objects. + */ + public CompletableFuture> list(TaxRatesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of TaxRate objects. + */ + public CompletableFuture> list( + TaxRatesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a TaxRate object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a TaxRate object with the given id. + */ + public CompletableFuture retrieve(String id, TaxRatesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a TaxRate object with the given id. + */ + public CompletableFuture retrieve( + String id, TaxRatesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncTrackingCategoriesClient.java b/src/main/java/com/merge/api/accounting/AsyncTrackingCategoriesClient.java new file mode 100644 index 000000000..a2817a3f7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncTrackingCategoriesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.TrackingCategoriesListRequest; +import com.merge.api.accounting.types.TrackingCategoriesRetrieveRequest; +import com.merge.api.accounting.types.TrackingCategory; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncTrackingCategoriesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTrackingCategoriesClient rawClient; + + public AsyncTrackingCategoriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTrackingCategoriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTrackingCategoriesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TrackingCategory objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public CompletableFuture> list(TrackingCategoriesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public CompletableFuture> list( + TrackingCategoriesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public CompletableFuture retrieve(String id, TrackingCategoriesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public CompletableFuture retrieve( + String id, TrackingCategoriesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncTransactionsClient.java new file mode 100644 index 000000000..e1cca02d6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncTransactionsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Transaction; +import com.merge.api.accounting.types.TransactionsListRequest; +import com.merge.api.accounting.types.TransactionsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncTransactionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTransactionsClient rawClient; + + public AsyncTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTransactionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTransactionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Transaction objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Transaction objects. + */ + public CompletableFuture> list(TransactionsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Transaction objects. + */ + public CompletableFuture> list( + TransactionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Transaction object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Transaction object with the given id. + */ + public CompletableFuture retrieve(String id, TransactionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Transaction object with the given id. + */ + public CompletableFuture retrieve( + String id, TransactionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncVendorCreditsClient.java b/src/main/java/com/merge/api/accounting/AsyncVendorCreditsClient.java new file mode 100644 index 000000000..ecaf6f9b6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncVendorCreditsClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.VendorCredit; +import com.merge.api.accounting.types.VendorCreditEndpointRequest; +import com.merge.api.accounting.types.VendorCreditResponse; +import com.merge.api.accounting.types.VendorCreditsListRequest; +import com.merge.api.accounting.types.VendorCreditsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncVendorCreditsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawVendorCreditsClient rawClient; + + public AsyncVendorCreditsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawVendorCreditsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawVendorCreditsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of VendorCredit objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of VendorCredit objects. + */ + public CompletableFuture> list(VendorCreditsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of VendorCredit objects. + */ + public CompletableFuture> list( + VendorCreditsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a VendorCredit object with the given values. + */ + public CompletableFuture create(VendorCreditEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a VendorCredit object with the given values. + */ + public CompletableFuture create( + VendorCreditEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public CompletableFuture retrieve(String id, VendorCreditsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public CompletableFuture retrieve( + String id, VendorCreditsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/accounting/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..41bf642df --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.WebhookReceiver; +import com.merge.api.accounting.types.WebhookReceiverRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AttachmentsClient.java b/src/main/java/com/merge/api/accounting/AttachmentsClient.java new file mode 100644 index 000000000..dcd4fd8e1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AttachmentsClient.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingAttachment; +import com.merge.api.accounting.types.AccountingAttachmentEndpointRequest; +import com.merge.api.accounting.types.AccountingAttachmentResponse; +import com.merge.api.accounting.types.AttachmentsListRequest; +import com.merge.api.accounting.types.AttachmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class AttachmentsClient { + protected final ClientOptions clientOptions; + + private final RawAttachmentsClient rawClient; + + public AttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public SyncPagingIterable list(AttachmentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public SyncPagingIterable list( + AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public AccountingAttachmentResponse create(AccountingAttachmentEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public AccountingAttachmentResponse create( + AccountingAttachmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public AccountingAttachment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public AccountingAttachment retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public AccountingAttachment retrieve(String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AuditTrailClient.java b/src/main/java/com/merge/api/accounting/AuditTrailClient.java new file mode 100644 index 000000000..ccdd23642 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AuditLogEvent; +import com.merge.api.accounting.types.AuditTrailListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/AvailableActionsClient.java b/src/main/java/com/merge/api/accounting/AvailableActionsClient.java new file mode 100644 index 000000000..932198be8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AvailableActions; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/BalanceSheetsClient.java b/src/main/java/com/merge/api/accounting/BalanceSheetsClient.java new file mode 100644 index 000000000..38672fb38 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/BalanceSheetsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BalanceSheet; +import com.merge.api.accounting.types.BalanceSheetsListRequest; +import com.merge.api.accounting.types.BalanceSheetsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class BalanceSheetsClient { + protected final ClientOptions clientOptions; + + private final RawBalanceSheetsClient rawClient; + + public BalanceSheetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBalanceSheetsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBalanceSheetsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BalanceSheet objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public SyncPagingIterable list(BalanceSheetsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public SyncPagingIterable list(BalanceSheetsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public BalanceSheet retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public BalanceSheet retrieve(String id, BalanceSheetsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public BalanceSheet retrieve(String id, BalanceSheetsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/BankFeedAccountsClient.java b/src/main/java/com/merge/api/accounting/BankFeedAccountsClient.java new file mode 100644 index 000000000..2247df701 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/BankFeedAccountsClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedAccount; +import com.merge.api.accounting.types.BankFeedAccountEndpointRequest; +import com.merge.api.accounting.types.BankFeedAccountResponse; +import com.merge.api.accounting.types.BankFeedAccountsListRequest; +import com.merge.api.accounting.types.BankFeedAccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class BankFeedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawBankFeedAccountsClient rawClient; + + public BankFeedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBankFeedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBankFeedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public SyncPagingIterable list(BankFeedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public SyncPagingIterable list( + BankFeedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public BankFeedAccountResponse create(BankFeedAccountEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public BankFeedAccountResponse create(BankFeedAccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public BankFeedAccount retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public BankFeedAccount retrieve(String id, BankFeedAccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public BankFeedAccount retrieve(String id, BankFeedAccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/BankFeedTransactionsClient.java b/src/main/java/com/merge/api/accounting/BankFeedTransactionsClient.java new file mode 100644 index 000000000..e4a54ab58 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/BankFeedTransactionsClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedTransaction; +import com.merge.api.accounting.types.BankFeedTransactionEndpointRequest; +import com.merge.api.accounting.types.BankFeedTransactionResponse; +import com.merge.api.accounting.types.BankFeedTransactionsListRequest; +import com.merge.api.accounting.types.BankFeedTransactionsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class BankFeedTransactionsClient { + protected final ClientOptions clientOptions; + + private final RawBankFeedTransactionsClient rawClient; + + public BankFeedTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBankFeedTransactionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBankFeedTransactionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public SyncPagingIterable list(BankFeedTransactionsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public SyncPagingIterable list( + BankFeedTransactionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public BankFeedTransactionResponse create(BankFeedTransactionEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public BankFeedTransactionResponse create( + BankFeedTransactionEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public BankFeedTransaction retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public BankFeedTransaction retrieve(String id, BankFeedTransactionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public BankFeedTransaction retrieve( + String id, BankFeedTransactionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/CashFlowStatementsClient.java b/src/main/java/com/merge/api/accounting/CashFlowStatementsClient.java new file mode 100644 index 000000000..65d0f8ee7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/CashFlowStatementsClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CashFlowStatement; +import com.merge.api.accounting.types.CashFlowStatementsListRequest; +import com.merge.api.accounting.types.CashFlowStatementsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class CashFlowStatementsClient { + protected final ClientOptions clientOptions; + + private final RawCashFlowStatementsClient rawClient; + + public CashFlowStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCashFlowStatementsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCashFlowStatementsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public SyncPagingIterable list(CashFlowStatementsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public SyncPagingIterable list( + CashFlowStatementsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CashFlowStatement retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CashFlowStatement retrieve(String id, CashFlowStatementsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public CashFlowStatement retrieve( + String id, CashFlowStatementsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/CompanyInfoClient.java b/src/main/java/com/merge/api/accounting/CompanyInfoClient.java new file mode 100644 index 000000000..bfaeef17e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/CompanyInfoClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CompanyInfo; +import com.merge.api.accounting.types.CompanyInfoListRequest; +import com.merge.api.accounting.types.CompanyInfoRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class CompanyInfoClient { + protected final ClientOptions clientOptions; + + private final RawCompanyInfoClient rawClient; + + public CompanyInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCompanyInfoClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCompanyInfoClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CompanyInfo objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public SyncPagingIterable list(CompanyInfoListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public SyncPagingIterable list(CompanyInfoListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompanyInfo retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompanyInfo retrieve(String id, CompanyInfoRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public CompanyInfo retrieve(String id, CompanyInfoRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/ContactsClient.java b/src/main/java/com/merge/api/accounting/ContactsClient.java new file mode 100644 index 000000000..57b792a48 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/ContactsClient.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Contact; +import com.merge.api.accounting.types.ContactEndpointRequest; +import com.merge.api.accounting.types.ContactResponse; +import com.merge.api.accounting.types.ContactsListRequest; +import com.merge.api.accounting.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ContactsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ContactsClient { + protected final ClientOptions clientOptions; + + private final RawContactsClient rawClient; + + public ContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawContactsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawContactsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list(ContactsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list(ContactsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Contact object with the given values. + */ + public ContactResponse create(ContactEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Contact object with the given values. + */ + public ContactResponse create(ContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id, ContactsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Contact POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Contact POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(ContactsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/CreditNotesClient.java b/src/main/java/com/merge/api/accounting/CreditNotesClient.java new file mode 100644 index 000000000..55faeb234 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/CreditNotesClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CreditNote; +import com.merge.api.accounting.types.CreditNoteEndpointRequest; +import com.merge.api.accounting.types.CreditNoteResponse; +import com.merge.api.accounting.types.CreditNotesListRequest; +import com.merge.api.accounting.types.CreditNotesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class CreditNotesClient { + protected final ClientOptions clientOptions; + + private final RawCreditNotesClient rawClient; + + public CreditNotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCreditNotesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCreditNotesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CreditNote objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of CreditNote objects. + */ + public SyncPagingIterable list(CreditNotesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of CreditNote objects. + */ + public SyncPagingIterable list(CreditNotesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a CreditNote object with the given values. + */ + public CreditNoteResponse create(CreditNoteEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a CreditNote object with the given values. + */ + public CreditNoteResponse create(CreditNoteEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CreditNote retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CreditNote retrieve(String id, CreditNotesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a CreditNote object with the given id. + */ + public CreditNote retrieve(String id, CreditNotesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/DeleteAccountClient.java b/src/main/java/com/merge/api/accounting/DeleteAccountClient.java new file mode 100644 index 000000000..3a222b6c3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/EmployeesClient.java b/src/main/java/com/merge/api/accounting/EmployeesClient.java new file mode 100644 index 000000000..0d86a5216 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/EmployeesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Employee; +import com.merge.api.accounting.types.EmployeesListRequest; +import com.merge.api.accounting.types.EmployeesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class EmployeesClient { + protected final ClientOptions clientOptions; + + private final RawEmployeesClient rawClient; + + public EmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEmployeesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEmployeesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Employee objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Employee objects. + */ + public SyncPagingIterable list(EmployeesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Employee objects. + */ + public SyncPagingIterable list(EmployeesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Employee object with the given id. + */ + public Employee retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Employee object with the given id. + */ + public Employee retrieve(String id, EmployeesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Employee object with the given id. + */ + public Employee retrieve(String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/ExpensesClient.java b/src/main/java/com/merge/api/accounting/ExpensesClient.java new file mode 100644 index 000000000..439cef7a0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/ExpensesClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseEndpointRequest; +import com.merge.api.accounting.types.ExpenseResponse; +import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesListRequest; +import com.merge.api.accounting.types.ExpensesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ExpensesClient { + protected final ClientOptions clientOptions; + + private final RawExpensesClient rawClient; + + public ExpensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawExpensesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawExpensesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Expense objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Expense objects. + */ + public SyncPagingIterable list(ExpensesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Expense objects. + */ + public SyncPagingIterable list(ExpensesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Expense object with the given values. + */ + public ExpenseResponse create(ExpenseEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Expense object with the given values. + */ + public ExpenseResponse create(ExpenseEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Expense object with the given id. + */ + public Expense retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Expense object with the given id. + */ + public Expense retrieve(String id, ExpensesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Expense object with the given id. + */ + public Expense retrieve(String id, ExpensesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for Expense POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Expense POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(ExpensesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/FieldMappingClient.java b/src/main/java/com/merge/api/accounting/FieldMappingClient.java new file mode 100644 index 000000000..76455491a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/FieldMappingClient.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CreateFieldMappingRequest; +import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; +import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; +import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; +import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; +import com.merge.api.accounting.types.RemoteFieldApiResponse; +import com.merge.api.accounting.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/ForceResyncClient.java b/src/main/java/com/merge/api/accounting/ForceResyncClient.java new file mode 100644 index 000000000..060a90697 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/GeneralLedgerTransactionsClient.java b/src/main/java/com/merge/api/accounting/GeneralLedgerTransactionsClient.java new file mode 100644 index 000000000..6eb1557cd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/GeneralLedgerTransactionsClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.GeneralLedgerTransaction; +import com.merge.api.accounting.types.GeneralLedgerTransactionsListRequest; +import com.merge.api.accounting.types.GeneralLedgerTransactionsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class GeneralLedgerTransactionsClient { + protected final ClientOptions clientOptions; + + private final RawGeneralLedgerTransactionsClient rawClient; + + public GeneralLedgerTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGeneralLedgerTransactionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGeneralLedgerTransactionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public SyncPagingIterable list(GeneralLedgerTransactionsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public SyncPagingIterable list( + GeneralLedgerTransactionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public GeneralLedgerTransaction retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public GeneralLedgerTransaction retrieve(String id, GeneralLedgerTransactionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public GeneralLedgerTransaction retrieve( + String id, GeneralLedgerTransactionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/GenerateKeyClient.java b/src/main/java/com/merge/api/accounting/GenerateKeyClient.java new file mode 100644 index 000000000..f1ba42263 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.GenerateRemoteKeyRequest; +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/IncomeStatementsClient.java b/src/main/java/com/merge/api/accounting/IncomeStatementsClient.java new file mode 100644 index 000000000..d99b9e51d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/IncomeStatementsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.IncomeStatement; +import com.merge.api.accounting.types.IncomeStatementsListRequest; +import com.merge.api.accounting.types.IncomeStatementsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class IncomeStatementsClient { + protected final ClientOptions clientOptions; + + private final RawIncomeStatementsClient rawClient; + + public IncomeStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIncomeStatementsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIncomeStatementsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of IncomeStatement objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public SyncPagingIterable list(IncomeStatementsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public SyncPagingIterable list( + IncomeStatementsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public IncomeStatement retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public IncomeStatement retrieve(String id, IncomeStatementsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public IncomeStatement retrieve(String id, IncomeStatementsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/InvoicesClient.java b/src/main/java/com/merge/api/accounting/InvoicesClient.java new file mode 100644 index 000000000..92d062d6c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/InvoicesClient.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceEndpointRequest; +import com.merge.api.accounting.types.InvoiceResponse; +import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedInvoiceEndpointRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class InvoicesClient { + protected final ClientOptions clientOptions; + + private final RawInvoicesClient rawClient; + + public InvoicesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawInvoicesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawInvoicesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Invoice objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Invoice objects. + */ + public SyncPagingIterable list(InvoicesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Invoice objects. + */ + public SyncPagingIterable list(InvoicesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public InvoiceResponse create(InvoiceEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public InvoiceResponse create(InvoiceEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Invoice object with the given id. + */ + public Invoice retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Invoice object with the given id. + */ + public Invoice retrieve(String id, InvoicesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Invoice object with the given id. + */ + public Invoice retrieve(String id, InvoicesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates an Invoice object with the given id. + */ + public InvoiceResponse partialUpdate(String id, PatchedInvoiceEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates an Invoice object with the given id. + */ + public InvoiceResponse partialUpdate( + String id, PatchedInvoiceEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList() { + return this.rawClient.lineItemsRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest request) { + return this.rawClient.lineItemsRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .lineItemsRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for Invoice POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Invoice POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(InvoicesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/IssuesClient.java b/src/main/java/com/merge/api/accounting/IssuesClient.java new file mode 100644 index 000000000..33c7bfedc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Issue; +import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/ItemsClient.java b/src/main/java/com/merge/api/accounting/ItemsClient.java new file mode 100644 index 000000000..6a4932ee5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/ItemsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Item; +import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ItemsClient { + protected final ClientOptions clientOptions; + + private final RawItemsClient rawClient; + + public ItemsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawItemsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawItemsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Item objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Item objects. + */ + public SyncPagingIterable list(ItemsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Item objects. + */ + public SyncPagingIterable list(ItemsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Item object with the given id. + */ + public Item retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Item object with the given id. + */ + public Item retrieve(String id, ItemsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Item object with the given id. + */ + public Item retrieve(String id, ItemsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/JournalEntriesClient.java b/src/main/java/com/merge/api/accounting/JournalEntriesClient.java new file mode 100644 index 000000000..40027930a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/JournalEntriesClient.java @@ -0,0 +1,153 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.JournalEntriesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesListRequest; +import com.merge.api.accounting.types.JournalEntriesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesRetrieveRequest; +import com.merge.api.accounting.types.JournalEntry; +import com.merge.api.accounting.types.JournalEntryEndpointRequest; +import com.merge.api.accounting.types.JournalEntryResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class JournalEntriesClient { + protected final ClientOptions clientOptions; + + private final RawJournalEntriesClient rawClient; + + public JournalEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawJournalEntriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawJournalEntriesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of JournalEntry objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of JournalEntry objects. + */ + public SyncPagingIterable list(JournalEntriesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of JournalEntry objects. + */ + public SyncPagingIterable list(JournalEntriesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a JournalEntry object with the given values. + */ + public JournalEntryResponse create(JournalEntryEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a JournalEntry object with the given values. + */ + public JournalEntryResponse create(JournalEntryEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public JournalEntry retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public JournalEntry retrieve(String id, JournalEntriesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public JournalEntry retrieve(String id, JournalEntriesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/LinkTokenClient.java b/src/main/java/com/merge/api/accounting/LinkTokenClient.java new file mode 100644 index 000000000..965e9e733 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.EndUserDetailsRequest; +import com.merge.api.accounting.types.LinkToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/LinkedAccountsClient.java b/src/main/java/com/merge/api/accounting/LinkedAccountsClient.java new file mode 100644 index 000000000..e06678525 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetailsAndActions; +import com.merge.api.accounting.types.LinkedAccountsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/PassthroughClient.java b/src/main/java/com/merge/api/accounting/PassthroughClient.java new file mode 100644 index 000000000..86b543870 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.DataPassthroughRequest; +import com.merge.api.accounting.types.RemoteResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/PaymentMethodsClient.java b/src/main/java/com/merge/api/accounting/PaymentMethodsClient.java new file mode 100644 index 000000000..813f962fb --- /dev/null +++ b/src/main/java/com/merge/api/accounting/PaymentMethodsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaymentMethod; +import com.merge.api.accounting.types.PaymentMethodsListRequest; +import com.merge.api.accounting.types.PaymentMethodsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class PaymentMethodsClient { + protected final ClientOptions clientOptions; + + private final RawPaymentMethodsClient rawClient; + + public PaymentMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPaymentMethodsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPaymentMethodsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PaymentMethod objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public SyncPagingIterable list(PaymentMethodsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public SyncPagingIterable list(PaymentMethodsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public PaymentMethod retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public PaymentMethod retrieve(String id, PaymentMethodsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public PaymentMethod retrieve(String id, PaymentMethodsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/PaymentTermsClient.java b/src/main/java/com/merge/api/accounting/PaymentTermsClient.java new file mode 100644 index 000000000..bd2abd93e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/PaymentTermsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaymentTerm; +import com.merge.api.accounting.types.PaymentTermsListRequest; +import com.merge.api.accounting.types.PaymentTermsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class PaymentTermsClient { + protected final ClientOptions clientOptions; + + private final RawPaymentTermsClient rawClient; + + public PaymentTermsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPaymentTermsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPaymentTermsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PaymentTerm objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public SyncPagingIterable list(PaymentTermsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public SyncPagingIterable list(PaymentTermsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public PaymentTerm retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public PaymentTerm retrieve(String id, PaymentTermsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public PaymentTerm retrieve(String id, PaymentTermsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/PaymentsClient.java b/src/main/java/com/merge/api/accounting/PaymentsClient.java new file mode 100644 index 000000000..6746abe0b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/PaymentsClient.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedPaymentEndpointRequest; +import com.merge.api.accounting.types.Payment; +import com.merge.api.accounting.types.PaymentEndpointRequest; +import com.merge.api.accounting.types.PaymentResponse; +import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class PaymentsClient { + protected final ClientOptions clientOptions; + + private final RawPaymentsClient rawClient; + + public PaymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPaymentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPaymentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Payment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Payment objects. + */ + public SyncPagingIterable list(PaymentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Payment objects. + */ + public SyncPagingIterable list(PaymentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Payment object with the given values. + */ + public PaymentResponse create(PaymentEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Payment object with the given values. + */ + public PaymentResponse create(PaymentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Payment object with the given id. + */ + public Payment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Payment object with the given id. + */ + public Payment retrieve(String id, PaymentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Payment object with the given id. + */ + public Payment retrieve(String id, PaymentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates a Payment object with the given id. + */ + public PaymentResponse partialUpdate(String id, PatchedPaymentEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a Payment object with the given id. + */ + public PaymentResponse partialUpdate( + String id, PatchedPaymentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList() { + return this.rawClient.lineItemsRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest request) { + return this.rawClient.lineItemsRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .lineItemsRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for Payment POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Payment POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(PaymentsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/PhoneNumbersClient.java b/src/main/java/com/merge/api/accounting/PhoneNumbersClient.java new file mode 100644 index 000000000..cc70c154d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/PhoneNumbersClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPhoneNumber; +import com.merge.api.accounting.types.PhoneNumbersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class PhoneNumbersClient { + protected final ClientOptions clientOptions; + + private final RawPhoneNumbersClient rawClient; + + public PhoneNumbersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPhoneNumbersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPhoneNumbersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public AccountingPhoneNumber retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public AccountingPhoneNumber retrieve(String id, PhoneNumbersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public AccountingPhoneNumber retrieve( + String id, PhoneNumbersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/PurchaseOrdersClient.java b/src/main/java/com/merge/api/accounting/PurchaseOrdersClient.java new file mode 100644 index 000000000..a70803db8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/PurchaseOrdersClient.java @@ -0,0 +1,153 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PurchaseOrder; +import com.merge.api.accounting.types.PurchaseOrderEndpointRequest; +import com.merge.api.accounting.types.PurchaseOrderResponse; +import com.merge.api.accounting.types.PurchaseOrdersLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class PurchaseOrdersClient { + protected final ClientOptions clientOptions; + + private final RawPurchaseOrdersClient rawClient; + + public PurchaseOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPurchaseOrdersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPurchaseOrdersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public SyncPagingIterable list(PurchaseOrdersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public SyncPagingIterable list(PurchaseOrdersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public PurchaseOrderResponse create(PurchaseOrderEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public PurchaseOrderResponse create(PurchaseOrderEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public PurchaseOrder retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public PurchaseOrder retrieve(String id, PurchaseOrdersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public PurchaseOrder retrieve(String id, PurchaseOrdersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList() { + return this.rawClient.lineItemsRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest request) { + return this.rawClient.lineItemsRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .lineItemsRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAccountDetailsClient.java b/src/main/java/com/merge/api/accounting/RawAccountDetailsClient.java new file mode 100644 index 000000000..a4c6ff05c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAccountDetailsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetails; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAccountTokenClient.java b/src/main/java/com/merge/api/accounting/RawAccountTokenClient.java new file mode 100644 index 000000000..909d1cea7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAccountTokenClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java b/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java new file mode 100644 index 000000000..8a4cd3026 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPeriod; +import com.merge.api.accounting.types.AccountingPeriodsListRequest; +import com.merge.api.accounting.types.AccountingPeriodsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedAccountingPeriodList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountingPeriodsClient { + protected final ClientOptions clientOptions; + + public RawAccountingPeriodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public MergeApiHttpResponse> list() { + return list(AccountingPeriodsListRequest.builder().build()); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public MergeApiHttpResponse> list(AccountingPeriodsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of AccountingPeriod objects. + */ + public MergeApiHttpResponse> list( + AccountingPeriodsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounting-periods"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountingPeriodList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountingPeriodList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountingPeriodsListRequest nextRequest = AccountingPeriodsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AccountingPeriodsRetrieveRequest.builder().build()); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AccountingPeriodsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AccountingPeriod object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AccountingPeriodsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounting-periods") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPeriod.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAccountsClient.java b/src/main/java/com/merge/api/accounting/RawAccountsClient.java new file mode 100644 index 000000000..cf8a66304 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAccountsClient.java @@ -0,0 +1,368 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Account; +import com.merge.api.accounting.types.AccountEndpointRequest; +import com.merge.api.accounting.types.AccountResponse; +import com.merge.api.accounting.types.AccountsListRequest; +import com.merge.api.accounting.types.AccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedAccountList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountsClient { + protected final ClientOptions clientOptions; + + public RawAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list() { + return list(AccountsListRequest.builder().build()); + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list(AccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list( + AccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts"); + if (request.getAccountType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_type", request.getAccountType().get(), false); + } + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsListRequest nextRequest = AccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Account object with the given values. + */ + public MergeApiHttpResponse create(AccountEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Account object with the given values. + */ + public MergeApiHttpResponse create(AccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AccountsRetrieveRequest.builder().build()); + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Account POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Account POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/accounts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAddressesClient.java b/src/main/java/com/merge/api/accounting/RawAddressesClient.java new file mode 100644 index 000000000..fc5a2ae6e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAddressesClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Address; +import com.merge.api.accounting.types.AddressesRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAddressesClient { + protected final ClientOptions clientOptions; + + public RawAddressesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns an Address object with the given id. + */ + public MergeApiHttpResponse
retrieve(String id) { + return retrieve(id, AddressesRetrieveRequest.builder().build()); + } + + /** + * Returns an Address object with the given id. + */ + public MergeApiHttpResponse
retrieve(String id, AddressesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Address object with the given id. + */ + public MergeApiHttpResponse
retrieve( + String id, AddressesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/addresses") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Address.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..cb6746b32 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncPassthroughReciept; +import com.merge.api.accounting.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.accounting.types.DataPassthroughRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java b/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java new file mode 100644 index 000000000..7e9e0ebaf --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncTasksClient { + protected final ClientOptions clientOptions; + + public RawAsyncTasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .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") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPostTask.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java b/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java new file mode 100644 index 000000000..55ddff610 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java @@ -0,0 +1,329 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingAttachment; +import com.merge.api.accounting.types.AccountingAttachmentEndpointRequest; +import com.merge.api.accounting.types.AccountingAttachmentResponse; +import com.merge.api.accounting.types.AttachmentsListRequest; +import com.merge.api.accounting.types.AttachmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedAccountingAttachmentList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAttachmentsClient { + protected final ClientOptions clientOptions; + + public RawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public MergeApiHttpResponse> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public MergeApiHttpResponse> list(AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of AccountingAttachment objects. + */ + public MergeApiHttpResponse> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountingAttachmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountingAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public MergeApiHttpResponse create(AccountingAttachmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an AccountingAttachment object with the given values. + */ + public MergeApiHttpResponse create( + AccountingAttachmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingAttachmentResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AccountingAttachment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingAttachment.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for AccountingAttachment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/attachments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java b/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java new file mode 100644 index 000000000..a2a311d77 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AuditLogEvent; +import com.merge.api.accounting.types.AuditTrailListRequest; +import com.merge.api.accounting.types.PaginatedAuditLogEventList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawAvailableActionsClient.java b/src/main/java/com/merge/api/accounting/RawAvailableActionsClient.java new file mode 100644 index 000000000..f457432e2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawAvailableActionsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AvailableActions; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java b/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java new file mode 100644 index 000000000..04531e6f0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BalanceSheet; +import com.merge.api.accounting.types.BalanceSheetsListRequest; +import com.merge.api.accounting.types.BalanceSheetsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedBalanceSheetList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBalanceSheetsClient { + protected final ClientOptions clientOptions; + + public RawBalanceSheetsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BalanceSheet objects. + */ + public MergeApiHttpResponse> list() { + return list(BalanceSheetsListRequest.builder().build()); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public MergeApiHttpResponse> list(BalanceSheetsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BalanceSheet objects. + */ + public MergeApiHttpResponse> list( + BalanceSheetsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/balance-sheets"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedBalanceSheetList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBalanceSheetList.class); + Optional startingAfter = parsedResponse.getNext(); + BalanceSheetsListRequest nextRequest = BalanceSheetsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, BalanceSheetsRetrieveRequest.builder().build()); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, BalanceSheetsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BalanceSheet object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, BalanceSheetsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/balance-sheets") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BalanceSheet.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java b/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java new file mode 100644 index 000000000..05a859b81 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java @@ -0,0 +1,301 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedAccount; +import com.merge.api.accounting.types.BankFeedAccountEndpointRequest; +import com.merge.api.accounting.types.BankFeedAccountResponse; +import com.merge.api.accounting.types.BankFeedAccountsListRequest; +import com.merge.api.accounting.types.BankFeedAccountsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedBankFeedAccountList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBankFeedAccountsClient { + protected final ClientOptions clientOptions; + + public RawBankFeedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public MergeApiHttpResponse> list() { + return list(BankFeedAccountsListRequest.builder().build()); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public MergeApiHttpResponse> list(BankFeedAccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BankFeedAccount objects. + */ + public MergeApiHttpResponse> list( + BankFeedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedBankFeedAccountList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBankFeedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + BankFeedAccountsListRequest nextRequest = BankFeedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public MergeApiHttpResponse create(BankFeedAccountEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a BankFeedAccount object with the given values. + */ + public MergeApiHttpResponse create( + BankFeedAccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedAccountResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, BankFeedAccountsRetrieveRequest.builder().build()); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, BankFeedAccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BankFeedAccount object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, BankFeedAccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedAccount.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for BankFeedAccount POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-accounts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java b/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java new file mode 100644 index 000000000..7c38a104d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.BankFeedTransaction; +import com.merge.api.accounting.types.BankFeedTransactionEndpointRequest; +import com.merge.api.accounting.types.BankFeedTransactionResponse; +import com.merge.api.accounting.types.BankFeedTransactionsListRequest; +import com.merge.api.accounting.types.BankFeedTransactionsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedBankFeedTransactionList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBankFeedTransactionsClient { + protected final ClientOptions clientOptions; + + public RawBankFeedTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public MergeApiHttpResponse> list() { + return list(BankFeedTransactionsListRequest.builder().build()); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public MergeApiHttpResponse> list(BankFeedTransactionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BankFeedTransaction objects. + */ + public MergeApiHttpResponse> list( + BankFeedTransactionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsProcessed().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_processed", request.getIsProcessed().get().toString(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedBankFeedTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedBankFeedTransactionList.class); + Optional startingAfter = parsedResponse.getNext(); + BankFeedTransactionsListRequest nextRequest = BankFeedTransactionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public MergeApiHttpResponse create(BankFeedTransactionEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a BankFeedTransaction object with the given values. + */ + public MergeApiHttpResponse create( + BankFeedTransactionEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedTransactionResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, BankFeedTransactionsRetrieveRequest.builder().build()); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, BankFeedTransactionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BankFeedTransaction object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, BankFeedTransactionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedTransaction.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for BankFeedTransaction POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/bank-feed-transactions/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java b/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java new file mode 100644 index 000000000..f1ef721ea --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CashFlowStatement; +import com.merge.api.accounting.types.CashFlowStatementsListRequest; +import com.merge.api.accounting.types.CashFlowStatementsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedCashFlowStatementList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCashFlowStatementsClient { + protected final ClientOptions clientOptions; + + public RawCashFlowStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public MergeApiHttpResponse> list() { + return list(CashFlowStatementsListRequest.builder().build()); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public MergeApiHttpResponse> list(CashFlowStatementsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CashFlowStatement objects. + */ + public MergeApiHttpResponse> list( + CashFlowStatementsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/cash-flow-statements"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCashFlowStatementList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCashFlowStatementList.class); + Optional startingAfter = parsedResponse.getNext(); + CashFlowStatementsListRequest nextRequest = CashFlowStatementsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CashFlowStatementsRetrieveRequest.builder().build()); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CashFlowStatementsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CashFlowStatement object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CashFlowStatementsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/cash-flow-statements") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CashFlowStatement.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java b/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java new file mode 100644 index 000000000..bc583a1b5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CompanyInfo; +import com.merge.api.accounting.types.CompanyInfoListRequest; +import com.merge.api.accounting.types.CompanyInfoRetrieveRequest; +import com.merge.api.accounting.types.PaginatedCompanyInfoList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCompanyInfoClient { + protected final ClientOptions clientOptions; + + public RawCompanyInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CompanyInfo objects. + */ + public MergeApiHttpResponse> list() { + return list(CompanyInfoListRequest.builder().build()); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public MergeApiHttpResponse> list(CompanyInfoListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CompanyInfo objects. + */ + public MergeApiHttpResponse> list( + CompanyInfoListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/company-info"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCompanyInfoList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCompanyInfoList.class); + Optional startingAfter = parsedResponse.getNext(); + CompanyInfoListRequest nextRequest = CompanyInfoListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CompanyInfoRetrieveRequest.builder().build()); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CompanyInfoRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CompanyInfo object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CompanyInfoRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/company-info") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CompanyInfo.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawContactsClient.java b/src/main/java/com/merge/api/accounting/RawContactsClient.java new file mode 100644 index 000000000..9bcd5b19d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawContactsClient.java @@ -0,0 +1,487 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Contact; +import com.merge.api.accounting.types.ContactEndpointRequest; +import com.merge.api.accounting.types.ContactResponse; +import com.merge.api.accounting.types.ContactsListRequest; +import com.merge.api.accounting.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ContactsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedContactList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawContactsClient { + protected final ClientOptions clientOptions; + + public RawContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list() { + return list(ContactsListRequest.builder().build()); + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list(ContactsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list( + ContactsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_address", request.getEmailAddress().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCustomer().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_customer", request.getIsCustomer().get(), false); + } + if (request.getIsSupplier().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_supplier", request.getIsSupplier().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedContactList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsListRequest nextRequest = ContactsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Contact object with the given values. + */ + public MergeApiHttpResponse create(ContactEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Contact object with the given values. + */ + public MergeApiHttpResponse create(ContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ContactResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ContactsRetrieveRequest.builder().build()); + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ContactsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Contact POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Contact POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/contacts/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java b/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java new file mode 100644 index 000000000..12e458f1d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CreditNote; +import com.merge.api.accounting.types.CreditNoteEndpointRequest; +import com.merge.api.accounting.types.CreditNoteResponse; +import com.merge.api.accounting.types.CreditNotesListRequest; +import com.merge.api.accounting.types.CreditNotesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedCreditNoteList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCreditNotesClient { + protected final ClientOptions clientOptions; + + public RawCreditNotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CreditNote objects. + */ + public MergeApiHttpResponse> list() { + return list(CreditNotesListRequest.builder().build()); + } + + /** + * Returns a list of CreditNote objects. + */ + public MergeApiHttpResponse> list(CreditNotesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CreditNote objects. + */ + public MergeApiHttpResponse> list( + CreditNotesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCreditNoteList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCreditNoteList.class); + Optional startingAfter = parsedResponse.getNext(); + CreditNotesListRequest nextRequest = CreditNotesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a CreditNote object with the given values. + */ + public MergeApiHttpResponse create(CreditNoteEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a CreditNote object with the given values. + */ + public MergeApiHttpResponse create( + CreditNoteEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a CreditNote object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CreditNotesRetrieveRequest.builder().build()); + } + + /** + * Returns a CreditNote object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CreditNotesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CreditNote object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CreditNotesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNote.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for CreditNote POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawDeleteAccountClient.java b/src/main/java/com/merge/api/accounting/RawDeleteAccountClient.java new file mode 100644 index 000000000..df1f7cec3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawDeleteAccountClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawEmployeesClient.java b/src/main/java/com/merge/api/accounting/RawEmployeesClient.java new file mode 100644 index 000000000..4ab176487 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawEmployeesClient.java @@ -0,0 +1,198 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Employee; +import com.merge.api.accounting.types.EmployeesListRequest; +import com.merge.api.accounting.types.EmployeesRetrieveRequest; +import com.merge.api.accounting.types.PaginatedEmployeeList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEmployeesClient { + protected final ClientOptions clientOptions; + + public RawEmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Employee objects. + */ + public MergeApiHttpResponse> list() { + return list(EmployeesListRequest.builder().build()); + } + + /** + * Returns a list of Employee objects. + */ + public MergeApiHttpResponse> list(EmployeesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Employee objects. + */ + public MergeApiHttpResponse> list( + EmployeesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/employees"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEmployeeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployeesListRequest nextRequest = EmployeesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Employee object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EmployeesRetrieveRequest.builder().build()); + } + + /** + * Returns an Employee object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EmployeesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Employee object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/employees") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawExpensesClient.java b/src/main/java/com/merge/api/accounting/RawExpensesClient.java new file mode 100644 index 000000000..33eb5d797 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawExpensesClient.java @@ -0,0 +1,567 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseEndpointRequest; +import com.merge.api.accounting.types.ExpenseResponse; +import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesListRequest; +import com.merge.api.accounting.types.ExpensesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpensesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedExpenseList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawExpensesClient { + protected final ClientOptions clientOptions; + + public RawExpensesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Expense objects. + */ + public MergeApiHttpResponse> list() { + return list(ExpensesListRequest.builder().build()); + } + + /** + * Returns a list of Expense objects. + */ + public MergeApiHttpResponse> list(ExpensesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Expense objects. + */ + public MergeApiHttpResponse> list( + ExpensesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedExpenseList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedExpenseList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpensesListRequest nextRequest = ExpensesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Expense object with the given values. + */ + public MergeApiHttpResponse create(ExpenseEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Expense object with the given values. + */ + public MergeApiHttpResponse create(ExpenseEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ExpenseResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Expense object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ExpensesRetrieveRequest.builder().build()); + } + + /** + * Returns an Expense object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ExpensesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Expense object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ExpensesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Expense.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + ExpensesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpensesLinesRemoteFieldClassesListRequest nextRequest = + ExpensesLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> linesRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Expense POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Expense POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ExpensesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpensesRemoteFieldClassesListRequest nextRequest = ExpensesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java b/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java new file mode 100644 index 000000000..8885127c9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java @@ -0,0 +1,380 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.CreateFieldMappingRequest; +import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; +import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; +import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; +import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; +import com.merge.api.accounting.types.RemoteFieldApiResponse; +import com.merge.api.accounting.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawForceResyncClient.java b/src/main/java/com/merge/api/accounting/RawForceResyncClient.java new file mode 100644 index 000000000..88e62c45a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawForceResyncClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java b/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java new file mode 100644 index 000000000..c7be5b569 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.GeneralLedgerTransaction; +import com.merge.api.accounting.types.GeneralLedgerTransactionsListRequest; +import com.merge.api.accounting.types.GeneralLedgerTransactionsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedGeneralLedgerTransactionList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGeneralLedgerTransactionsClient { + protected final ClientOptions clientOptions; + + public RawGeneralLedgerTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public MergeApiHttpResponse> list() { + return list(GeneralLedgerTransactionsListRequest.builder().build()); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public MergeApiHttpResponse> list( + GeneralLedgerTransactionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of GeneralLedgerTransaction objects. + */ + public MergeApiHttpResponse> list( + GeneralLedgerTransactionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/general-ledger-transactions"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPostedDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "posted_date_after", + request.getPostedDateAfter().get().toString(), + false); + } + if (request.getPostedDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "posted_date_before", + request.getPostedDateBefore().get().toString(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedGeneralLedgerTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedGeneralLedgerTransactionList.class); + Optional startingAfter = parsedResponse.getNext(); + GeneralLedgerTransactionsListRequest nextRequest = GeneralLedgerTransactionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, GeneralLedgerTransactionsRetrieveRequest.builder().build()); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, GeneralLedgerTransactionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a GeneralLedgerTransaction object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, GeneralLedgerTransactionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/general-ledger-transactions") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GeneralLedgerTransaction.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawGenerateKeyClient.java b/src/main/java/com/merge/api/accounting/RawGenerateKeyClient.java new file mode 100644 index 000000000..bad73a717 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawGenerateKeyClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.GenerateRemoteKeyRequest; +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java b/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java new file mode 100644 index 000000000..250af98f9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.IncomeStatement; +import com.merge.api.accounting.types.IncomeStatementsListRequest; +import com.merge.api.accounting.types.IncomeStatementsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedIncomeStatementList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIncomeStatementsClient { + protected final ClientOptions clientOptions; + + public RawIncomeStatementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of IncomeStatement objects. + */ + public MergeApiHttpResponse> list() { + return list(IncomeStatementsListRequest.builder().build()); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public MergeApiHttpResponse> list(IncomeStatementsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of IncomeStatement objects. + */ + public MergeApiHttpResponse> list( + IncomeStatementsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/income-statements"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedIncomeStatementList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIncomeStatementList.class); + Optional startingAfter = parsedResponse.getNext(); + IncomeStatementsListRequest nextRequest = IncomeStatementsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, IncomeStatementsRetrieveRequest.builder().build()); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, IncomeStatementsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an IncomeStatement object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, IncomeStatementsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/income-statements") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), IncomeStatement.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawInvoicesClient.java b/src/main/java/com/merge/api/accounting/RawInvoicesClient.java new file mode 100644 index 000000000..9d988258c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawInvoicesClient.java @@ -0,0 +1,707 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceEndpointRequest; +import com.merge.api.accounting.types.InvoiceResponse; +import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.InvoicesRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedInvoiceList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PatchedInvoiceEndpointRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawInvoicesClient { + protected final ClientOptions clientOptions; + + public RawInvoicesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Invoice objects. + */ + public MergeApiHttpResponse> list() { + return list(InvoicesListRequest.builder().build()); + } + + /** + * Returns a list of Invoice objects. + */ + public MergeApiHttpResponse> list(InvoicesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Invoice objects. + */ + public MergeApiHttpResponse> list( + InvoicesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIssueDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_after", + request.getIssueDateAfter().get().toString(), + false); + } + if (request.getIssueDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_before", + request.getIssueDateBefore().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getNumber().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "number", request.getNumber().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "type", request.getType().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedInvoiceList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedInvoiceList.class); + Optional startingAfter = parsedResponse.getNext(); + InvoicesListRequest nextRequest = InvoicesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public MergeApiHttpResponse create(InvoiceEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Invoice object with the given values. + * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). + */ + public MergeApiHttpResponse create(InvoiceEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Invoice object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, InvoicesRetrieveRequest.builder().build()); + } + + /** + * Returns an Invoice object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, InvoicesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Invoice object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, InvoicesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Invoice.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates an Invoice object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedInvoiceEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Invoice object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedInvoiceEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList() { + return lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest request) { + return lineItemsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList( + InvoicesLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/line-items/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + InvoicesLineItemsRemoteFieldClassesListRequest nextRequest = + InvoicesLineItemsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> lineItemsRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Invoice POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Invoice POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + InvoicesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + InvoicesRemoteFieldClassesListRequest nextRequest = InvoicesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawIssuesClient.java b/src/main/java/com/merge/api/accounting/RawIssuesClient.java new file mode 100644 index 000000000..2f7c99854 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawIssuesClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Issue; +import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.accounting.types.PaginatedIssueList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawItemsClient.java b/src/main/java/com/merge/api/accounting/RawItemsClient.java new file mode 100644 index 000000000..a1f0c77c8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawItemsClient.java @@ -0,0 +1,240 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Item; +import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsRetrieveRequest; +import com.merge.api.accounting.types.PaginatedItemList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawItemsClient { + protected final ClientOptions clientOptions; + + public RawItemsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Item objects. + */ + public MergeApiHttpResponse> list() { + return list(ItemsListRequest.builder().build()); + } + + /** + * Returns a list of Item objects. + */ + public MergeApiHttpResponse> list(ItemsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Item objects. + */ + public MergeApiHttpResponse> list( + ItemsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/items"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedItemList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedItemList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemsListRequest nextRequest = ItemsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Item object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ItemsRetrieveRequest.builder().build()); + } + + /** + * Returns an Item object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ItemsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Item object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ItemsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/items") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Item.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java b/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java new file mode 100644 index 000000000..c46072cf2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.JournalEntriesLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesListRequest; +import com.merge.api.accounting.types.JournalEntriesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.JournalEntriesRetrieveRequest; +import com.merge.api.accounting.types.JournalEntry; +import com.merge.api.accounting.types.JournalEntryEndpointRequest; +import com.merge.api.accounting.types.JournalEntryResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedJournalEntryList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawJournalEntriesClient { + protected final ClientOptions clientOptions; + + public RawJournalEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of JournalEntry objects. + */ + public MergeApiHttpResponse> list() { + return list(JournalEntriesListRequest.builder().build()); + } + + /** + * Returns a list of JournalEntry objects. + */ + public MergeApiHttpResponse> list(JournalEntriesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of JournalEntry objects. + */ + public MergeApiHttpResponse> list( + JournalEntriesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedJournalEntryList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJournalEntryList.class); + Optional startingAfter = parsedResponse.getNext(); + JournalEntriesListRequest nextRequest = JournalEntriesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a JournalEntry object with the given values. + */ + public MergeApiHttpResponse create(JournalEntryEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a JournalEntry object with the given values. + */ + public MergeApiHttpResponse create( + JournalEntryEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntryResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a JournalEntry object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, JournalEntriesRetrieveRequest.builder().build()); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, JournalEntriesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a JournalEntry object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, JournalEntriesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntry.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + JournalEntriesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + JournalEntriesLinesRemoteFieldClassesListRequest nextRequest = + JournalEntriesLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> linesRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for JournalEntry POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + JournalEntriesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/journal-entries/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + JournalEntriesRemoteFieldClassesListRequest nextRequest = + JournalEntriesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java b/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java new file mode 100644 index 000000000..11b2e650b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.EndUserDetailsRequest; +import com.merge.api.accounting.types.LinkToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java new file mode 100644 index 000000000..a16a4dee2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountDetailsAndActions; +import com.merge.api.accounting.types.LinkedAccountsListRequest; +import com.merge.api.accounting.types.PaginatedAccountDetailsAndActionsList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawPassthroughClient.java b/src/main/java/com/merge/api/accounting/RawPassthroughClient.java new file mode 100644 index 000000000..2bbfa189f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawPassthroughClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.DataPassthroughRequest; +import com.merge.api.accounting.types.RemoteResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java b/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java new file mode 100644 index 000000000..d1b14861f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedPaymentMethodList; +import com.merge.api.accounting.types.PaymentMethod; +import com.merge.api.accounting.types.PaymentMethodsListRequest; +import com.merge.api.accounting.types.PaymentMethodsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPaymentMethodsClient { + protected final ClientOptions clientOptions; + + public RawPaymentMethodsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PaymentMethod objects. + */ + public MergeApiHttpResponse> list() { + return list(PaymentMethodsListRequest.builder().build()); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public MergeApiHttpResponse> list(PaymentMethodsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PaymentMethod objects. + */ + public MergeApiHttpResponse> list( + PaymentMethodsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-methods"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedPaymentMethodList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentMethodList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentMethodsListRequest nextRequest = PaymentMethodsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, PaymentMethodsRetrieveRequest.builder().build()); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, PaymentMethodsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PaymentMethod object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, PaymentMethodsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-methods") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentMethod.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java b/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java new file mode 100644 index 000000000..6b08592e7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java @@ -0,0 +1,198 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedPaymentTermList; +import com.merge.api.accounting.types.PaymentTerm; +import com.merge.api.accounting.types.PaymentTermsListRequest; +import com.merge.api.accounting.types.PaymentTermsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPaymentTermsClient { + protected final ClientOptions clientOptions; + + public RawPaymentTermsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PaymentTerm objects. + */ + public MergeApiHttpResponse> list() { + return list(PaymentTermsListRequest.builder().build()); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public MergeApiHttpResponse> list(PaymentTermsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PaymentTerm objects. + */ + public MergeApiHttpResponse> list( + PaymentTermsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-terms"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedPaymentTermList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentTermList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentTermsListRequest nextRequest = PaymentTermsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, PaymentTermsRetrieveRequest.builder().build()); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, PaymentTermsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PaymentTerm object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, PaymentTermsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payment-terms") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentTerm.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawPaymentsClient.java b/src/main/java/com/merge/api/accounting/RawPaymentsClient.java new file mode 100644 index 000000000..64ba49cd4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawPaymentsClient.java @@ -0,0 +1,681 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedPaymentList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PatchedPaymentEndpointRequest; +import com.merge.api.accounting.types.Payment; +import com.merge.api.accounting.types.PaymentEndpointRequest; +import com.merge.api.accounting.types.PaymentResponse; +import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PaymentsRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPaymentsClient { + protected final ClientOptions clientOptions; + + public RawPaymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Payment objects. + */ + public MergeApiHttpResponse> list() { + return list(PaymentsListRequest.builder().build()); + } + + /** + * Returns a list of Payment objects. + */ + public MergeApiHttpResponse> list(PaymentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Payment objects. + */ + public MergeApiHttpResponse> list( + PaymentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedPaymentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentsListRequest nextRequest = PaymentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Payment object with the given values. + */ + public MergeApiHttpResponse create(PaymentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Payment object with the given values. + */ + public MergeApiHttpResponse create(PaymentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Payment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, PaymentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Payment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, PaymentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Payment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, PaymentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Payment.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a Payment object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedPaymentEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Payment object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedPaymentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList() { + return lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest request) { + return lineItemsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList( + PaymentsLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/line-items/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentsLineItemsRemoteFieldClassesListRequest nextRequest = + PaymentsLineItemsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> lineItemsRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Payment PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Payment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Payment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + PaymentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/payments/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PaymentsRemoteFieldClassesListRequest nextRequest = PaymentsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawPhoneNumbersClient.java b/src/main/java/com/merge/api/accounting/RawPhoneNumbersClient.java new file mode 100644 index 000000000..173c8c93d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawPhoneNumbersClient.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AccountingPhoneNumber; +import com.merge.api.accounting.types.PhoneNumbersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPhoneNumbersClient { + protected final ClientOptions clientOptions; + + public RawPhoneNumbersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, PhoneNumbersRetrieveRequest.builder().build()); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, PhoneNumbersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AccountingPhoneNumber object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, PhoneNumbersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/phone-numbers") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPhoneNumber.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java b/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java new file mode 100644 index 000000000..975cff3f7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java @@ -0,0 +1,586 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedPurchaseOrderList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PurchaseOrder; +import com.merge.api.accounting.types.PurchaseOrderEndpointRequest; +import com.merge.api.accounting.types.PurchaseOrderResponse; +import com.merge.api.accounting.types.PurchaseOrdersLineItemsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.PurchaseOrdersRetrieveRequest; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPurchaseOrdersClient { + protected final ClientOptions clientOptions; + + public RawPurchaseOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public MergeApiHttpResponse> list() { + return list(PurchaseOrdersListRequest.builder().build()); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public MergeApiHttpResponse> list(PurchaseOrdersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PurchaseOrder objects. + */ + public MergeApiHttpResponse> list( + PurchaseOrdersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIssueDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_after", + request.getIssueDateAfter().get().toString(), + false); + } + if (request.getIssueDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "issue_date_before", + request.getIssueDateBefore().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedPurchaseOrderList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPurchaseOrderList.class); + Optional startingAfter = parsedResponse.getNext(); + PurchaseOrdersListRequest nextRequest = PurchaseOrdersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public MergeApiHttpResponse create(PurchaseOrderEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a PurchaseOrder object with the given values. + */ + public MergeApiHttpResponse create( + PurchaseOrderEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrderResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, PurchaseOrdersRetrieveRequest.builder().build()); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, PurchaseOrdersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PurchaseOrder object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, PurchaseOrdersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrder.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList() { + return lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest request) { + return lineItemsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> lineItemsRemoteFieldClassesList( + PurchaseOrdersLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders/line-items/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PurchaseOrdersLineItemsRemoteFieldClassesListRequest nextRequest = + PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> lineItemsRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for PurchaseOrder POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + PurchaseOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/purchase-orders/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + PurchaseOrdersRemoteFieldClassesListRequest nextRequest = + PurchaseOrdersRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/accounting/RawRegenerateKeyClient.java new file mode 100644 index 000000000..30ab42c2f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawRegenerateKeyClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.accounting.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawScopesClient.java b/src/main/java/com/merge/api/accounting/RawScopesClient.java new file mode 100644 index 000000000..92d61b3ad --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawScopesClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.CommonModelScopeApi; +import com.merge.api.accounting.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java b/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java new file mode 100644 index 000000000..d0ae1309d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedSyncStatusList; +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.accounting.types.SyncStatusListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java b/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java new file mode 100644 index 000000000..27787c9d5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java @@ -0,0 +1,229 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedTaxRateList; +import com.merge.api.accounting.types.TaxRate; +import com.merge.api.accounting.types.TaxRatesListRequest; +import com.merge.api.accounting.types.TaxRatesRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTaxRatesClient { + protected final ClientOptions clientOptions; + + public RawTaxRatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TaxRate objects. + */ + public MergeApiHttpResponse> list() { + return list(TaxRatesListRequest.builder().build()); + } + + /** + * Returns a list of TaxRate objects. + */ + public MergeApiHttpResponse> list(TaxRatesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TaxRate objects. + */ + public MergeApiHttpResponse> list( + TaxRatesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tax-rates"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTaxRateList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaxRateList.class); + Optional startingAfter = parsedResponse.getNext(); + TaxRatesListRequest nextRequest = TaxRatesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a TaxRate object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TaxRatesRetrieveRequest.builder().build()); + } + + /** + * Returns a TaxRate object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TaxRatesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TaxRate object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, TaxRatesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tax-rates") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaxRate.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java b/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java new file mode 100644 index 000000000..981e18c34 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedTrackingCategoryList; +import com.merge.api.accounting.types.TrackingCategoriesListRequest; +import com.merge.api.accounting.types.TrackingCategoriesRetrieveRequest; +import com.merge.api.accounting.types.TrackingCategory; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTrackingCategoriesClient { + protected final ClientOptions clientOptions; + + public RawTrackingCategoriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TrackingCategory objects. + */ + public MergeApiHttpResponse> list() { + return list(TrackingCategoriesListRequest.builder().build()); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public MergeApiHttpResponse> list(TrackingCategoriesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public MergeApiHttpResponse> list( + TrackingCategoriesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tracking-categories"); + if (request.getCategoryType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category_type", request.getCategoryType().get(), false); + } + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTrackingCategoryList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTrackingCategoryList.class); + Optional startingAfter = parsedResponse.getNext(); + TrackingCategoriesListRequest nextRequest = TrackingCategoriesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TrackingCategoriesRetrieveRequest.builder().build()); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TrackingCategoriesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, TrackingCategoriesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/tracking-categories") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TrackingCategory.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawTransactionsClient.java b/src/main/java/com/merge/api/accounting/RawTransactionsClient.java new file mode 100644 index 000000000..1f412e484 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawTransactionsClient.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.PaginatedTransactionList; +import com.merge.api.accounting.types.Transaction; +import com.merge.api.accounting.types.TransactionsListRequest; +import com.merge.api.accounting.types.TransactionsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTransactionsClient { + protected final ClientOptions clientOptions; + + public RawTransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Transaction objects. + */ + public MergeApiHttpResponse> list() { + return list(TransactionsListRequest.builder().build()); + } + + /** + * Returns a list of Transaction objects. + */ + public MergeApiHttpResponse> list(TransactionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Transaction objects. + */ + public MergeApiHttpResponse> list( + TransactionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/transactions"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTransactionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTransactionList.class); + Optional startingAfter = parsedResponse.getNext(); + TransactionsListRequest nextRequest = TransactionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Transaction object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TransactionsRetrieveRequest.builder().build()); + } + + /** + * Returns a Transaction object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TransactionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Transaction object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, TransactionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/transactions") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Transaction.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java b/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java new file mode 100644 index 000000000..420b453ee --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java @@ -0,0 +1,350 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedVendorCreditList; +import com.merge.api.accounting.types.VendorCredit; +import com.merge.api.accounting.types.VendorCreditEndpointRequest; +import com.merge.api.accounting.types.VendorCreditResponse; +import com.merge.api.accounting.types.VendorCreditsListRequest; +import com.merge.api.accounting.types.VendorCreditsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawVendorCreditsClient { + protected final ClientOptions clientOptions; + + public RawVendorCreditsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of VendorCredit objects. + */ + public MergeApiHttpResponse> list() { + return list(VendorCreditsListRequest.builder().build()); + } + + /** + * Returns a list of VendorCredit objects. + */ + public MergeApiHttpResponse> list(VendorCreditsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of VendorCredit objects. + */ + public MergeApiHttpResponse> list( + VendorCreditsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTransactionDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_after", + request.getTransactionDateAfter().get().toString(), + false); + } + if (request.getTransactionDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "transaction_date_before", + request.getTransactionDateBefore().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedVendorCreditList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedVendorCreditList.class); + Optional startingAfter = parsedResponse.getNext(); + VendorCreditsListRequest nextRequest = VendorCreditsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a VendorCredit object with the given values. + */ + public MergeApiHttpResponse create(VendorCreditEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a VendorCredit object with the given values. + */ + public MergeApiHttpResponse create( + VendorCreditEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCreditResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a VendorCredit object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, VendorCreditsRetrieveRequest.builder().build()); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, VendorCreditsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, VendorCreditsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCredit.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/accounting/RawWebhookReceiversClient.java new file mode 100644 index 000000000..25e1d4d03 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawWebhookReceiversClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.accounting.types.WebhookReceiver; +import com.merge.api.accounting.types.WebhookReceiverRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("accounting/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RegenerateKeyClient.java b/src/main/java/com/merge/api/accounting/RegenerateKeyClient.java new file mode 100644 index 000000000..3b2e2ea2a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.RemoteKey; +import com.merge.api.accounting.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/ScopesClient.java b/src/main/java/com/merge/api/accounting/ScopesClient.java new file mode 100644 index 000000000..f66795c7c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.CommonModelScopeApi; +import com.merge.api.accounting.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/SyncStatusClient.java b/src/main/java/com/merge/api/accounting/SyncStatusClient.java new file mode 100644 index 000000000..caa83429f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.SyncStatus; +import com.merge.api.accounting.types.SyncStatusListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/TaxRatesClient.java b/src/main/java/com/merge/api/accounting/TaxRatesClient.java new file mode 100644 index 000000000..b4703149c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/TaxRatesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.TaxRate; +import com.merge.api.accounting.types.TaxRatesListRequest; +import com.merge.api.accounting.types.TaxRatesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class TaxRatesClient { + protected final ClientOptions clientOptions; + + private final RawTaxRatesClient rawClient; + + public TaxRatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTaxRatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTaxRatesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TaxRate objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of TaxRate objects. + */ + public SyncPagingIterable list(TaxRatesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of TaxRate objects. + */ + public SyncPagingIterable list(TaxRatesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a TaxRate object with the given id. + */ + public TaxRate retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a TaxRate object with the given id. + */ + public TaxRate retrieve(String id, TaxRatesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a TaxRate object with the given id. + */ + public TaxRate retrieve(String id, TaxRatesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/TrackingCategoriesClient.java b/src/main/java/com/merge/api/accounting/TrackingCategoriesClient.java new file mode 100644 index 000000000..d639a349c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/TrackingCategoriesClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.TrackingCategoriesListRequest; +import com.merge.api.accounting.types.TrackingCategoriesRetrieveRequest; +import com.merge.api.accounting.types.TrackingCategory; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class TrackingCategoriesClient { + protected final ClientOptions clientOptions; + + private final RawTrackingCategoriesClient rawClient; + + public TrackingCategoriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTrackingCategoriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTrackingCategoriesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TrackingCategory objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public SyncPagingIterable list(TrackingCategoriesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of TrackingCategory objects. + */ + public SyncPagingIterable list( + TrackingCategoriesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public TrackingCategory retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public TrackingCategory retrieve(String id, TrackingCategoriesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a TrackingCategory object with the given id. + */ + public TrackingCategory retrieve( + String id, TrackingCategoriesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/TransactionsClient.java b/src/main/java/com/merge/api/accounting/TransactionsClient.java new file mode 100644 index 000000000..f3c9a631e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/TransactionsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.Transaction; +import com.merge.api.accounting.types.TransactionsListRequest; +import com.merge.api.accounting.types.TransactionsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class TransactionsClient { + protected final ClientOptions clientOptions; + + private final RawTransactionsClient rawClient; + + public TransactionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTransactionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTransactionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Transaction objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Transaction objects. + */ + public SyncPagingIterable list(TransactionsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Transaction objects. + */ + public SyncPagingIterable list(TransactionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Transaction object with the given id. + */ + public Transaction retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Transaction object with the given id. + */ + public Transaction retrieve(String id, TransactionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Transaction object with the given id. + */ + public Transaction retrieve(String id, TransactionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/VendorCreditsClient.java b/src/main/java/com/merge/api/accounting/VendorCreditsClient.java new file mode 100644 index 000000000..1f3f340b7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/VendorCreditsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.VendorCredit; +import com.merge.api.accounting.types.VendorCreditEndpointRequest; +import com.merge.api.accounting.types.VendorCreditResponse; +import com.merge.api.accounting.types.VendorCreditsListRequest; +import com.merge.api.accounting.types.VendorCreditsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class VendorCreditsClient { + protected final ClientOptions clientOptions; + + private final RawVendorCreditsClient rawClient; + + public VendorCreditsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawVendorCreditsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawVendorCreditsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of VendorCredit objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of VendorCredit objects. + */ + public SyncPagingIterable list(VendorCreditsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of VendorCredit objects. + */ + public SyncPagingIterable list(VendorCreditsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a VendorCredit object with the given values. + */ + public VendorCreditResponse create(VendorCreditEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a VendorCredit object with the given values. + */ + public VendorCreditResponse create(VendorCreditEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public VendorCredit retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public VendorCredit retrieve(String id, VendorCreditsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a VendorCredit object with the given id. + */ + public VendorCredit retrieve(String id, VendorCreditsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for VendorCredit POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/WebhookReceiversClient.java b/src/main/java/com/merge/api/accounting/WebhookReceiversClient.java new file mode 100644 index 000000000..093310b06 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.WebhookReceiver; +import com.merge.api.accounting.types.WebhookReceiverRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/Account.java b/src/main/java/com/merge/api/accounting/types/Account.java new file mode 100644 index 000000000..2d19d2b79 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/Account.java @@ -0,0 +1,925 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Account.Builder.class) +public final class Account { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional description; + + private final Optional classification; + + private final Optional type; + + private final Optional accountType; + + private final Optional status; + + private final Optional currentBalance; + + private final Optional currency; + + private final Optional accountNumber; + + private final Optional parentAccount; + + private final Optional company; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Account( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional classification, + Optional type, + Optional accountType, + Optional status, + Optional currentBalance, + Optional currency, + Optional accountNumber, + Optional parentAccount, + Optional company, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.description = description; + this.classification = classification; + this.type = type; + this.accountType = accountType; + this.status = status; + this.currentBalance = currentBalance; + this.currency = currency; + this.accountNumber = accountNumber; + this.parentAccount = parentAccount; + this.company = company; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The account's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The account's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The account's broadest grouping. + *
    + *
  • ASSET - ASSET
  • + *
  • EQUITY - EQUITY
  • + *
  • EXPENSE - EXPENSE
  • + *
  • LIABILITY - LIABILITY
  • + *
  • REVENUE - REVENUE
  • + *
+ */ + @JsonProperty("classification") + public Optional getClassification() { + return classification; + } + + /** + * @return The account's type is a narrower and more specific grouping within the account's classification. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Normalized account type- which is a narrower and more specific grouping within the account's classification. + *
    + *
  • BANK - BANK
  • + *
  • CREDIT_CARD - CREDIT_CARD
  • + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
  • FIXED_ASSET - FIXED_ASSET
  • + *
  • OTHER_ASSET - OTHER_ASSET
  • + *
  • OTHER_CURRENT_ASSET - OTHER_CURRENT_ASSET
  • + *
  • OTHER_EXPENSE - OTHER_EXPENSE
  • + *
  • OTHER_INCOME - OTHER_INCOME
  • + *
  • COST_OF_GOODS_SOLD - COST_OF_GOODS_SOLD
  • + *
  • OTHER_CURRENT_LIABILITY - OTHER_CURRENT_LIABILITY
  • + *
  • LONG_TERM_LIABILITY - LONG_TERM_LIABILITY
  • + *
  • NON_POSTING - NON_POSTING
  • + *
+ */ + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The account's status. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • PENDING - PENDING
  • + *
  • INACTIVE - INACTIVE
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The account's current balance. + */ + @JsonProperty("current_balance") + public Optional getCurrentBalance() { + return currentBalance; + } + + /** + * @return The account's currency. + *
    + *
  • XUA - ADB Unit of Account
  • + *
  • AFN - Afghan Afghani
  • + *
  • AFA - Afghan Afghani (1927–2002)
  • + *
  • ALL - Albanian Lek
  • + *
  • ALK - Albanian Lek (1946–1965)
  • + *
  • DZD - Algerian Dinar
  • + *
  • ADP - Andorran Peseta
  • + *
  • AOA - Angolan Kwanza
  • + *
  • AOK - Angolan Kwanza (1977–1991)
  • + *
  • AON - Angolan New Kwanza (1990–2000)
  • + *
  • AOR - Angolan Readjusted Kwanza (1995–1999)
  • + *
  • ARA - Argentine Austral
  • + *
  • ARS - Argentine Peso
  • + *
  • ARM - Argentine Peso (1881–1970)
  • + *
  • ARP - Argentine Peso (1983–1985)
  • + *
  • ARL - Argentine Peso Ley (1970–1983)
  • + *
  • AMD - Armenian Dram
  • + *
  • AWG - Aruban Florin
  • + *
  • AUD - Australian Dollar
  • + *
  • ATS - Austrian Schilling
  • + *
  • AZN - Azerbaijani Manat
  • + *
  • AZM - Azerbaijani Manat (1993–2006)
  • + *
  • BSD - Bahamian Dollar
  • + *
  • BHD - Bahraini Dinar
  • + *
  • BDT - Bangladeshi Taka
  • + *
  • BBD - Barbadian Dollar
  • + *
  • BYN - Belarusian Ruble
  • + *
  • BYB - Belarusian Ruble (1994–1999)
  • + *
  • BYR - Belarusian Ruble (2000–2016)
  • + *
  • BEF - Belgian Franc
  • + *
  • BEC - Belgian Franc (convertible)
  • + *
  • BEL - Belgian Franc (financial)
  • + *
  • BZD - Belize Dollar
  • + *
  • BMD - Bermudan Dollar
  • + *
  • BTN - Bhutanese Ngultrum
  • + *
  • BOB - Bolivian Boliviano
  • + *
  • BOL - Bolivian Boliviano (1863–1963)
  • + *
  • BOV - Bolivian Mvdol
  • + *
  • BOP - Bolivian Peso
  • + *
  • BAM - Bosnia-Herzegovina Convertible Mark
  • + *
  • BAD - Bosnia-Herzegovina Dinar (1992–1994)
  • + *
  • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
  • + *
  • BWP - Botswanan Pula
  • + *
  • BRC - Brazilian Cruzado (1986–1989)
  • + *
  • BRZ - Brazilian Cruzeiro (1942–1967)
  • + *
  • BRE - Brazilian Cruzeiro (1990–1993)
  • + *
  • BRR - Brazilian Cruzeiro (1993–1994)
  • + *
  • BRN - Brazilian New Cruzado (1989–1990)
  • + *
  • BRB - Brazilian New Cruzeiro (1967–1986)
  • + *
  • BRL - Brazilian Real
  • + *
  • GBP - British Pound
  • + *
  • BND - Brunei Dollar
  • + *
  • BGL - Bulgarian Hard Lev
  • + *
  • BGN - Bulgarian Lev
  • + *
  • BGO - Bulgarian Lev (1879–1952)
  • + *
  • BGM - Bulgarian Socialist Lev
  • + *
  • BUK - Burmese Kyat
  • + *
  • BIF - Burundian Franc
  • + *
  • XPF - CFP Franc
  • + *
  • KHR - Cambodian Riel
  • + *
  • CAD - Canadian Dollar
  • + *
  • CVE - Cape Verdean Escudo
  • + *
  • KYD - Cayman Islands Dollar
  • + *
  • XAF - Central African CFA Franc
  • + *
  • CLE - Chilean Escudo
  • + *
  • CLP - Chilean Peso
  • + *
  • CLF - Chilean Unit of Account (UF)
  • + *
  • CNX - Chinese People’s Bank Dollar
  • + *
  • CNY - Chinese Yuan
  • + *
  • CNH - Chinese Yuan (offshore)
  • + *
  • COP - Colombian Peso
  • + *
  • COU - Colombian Real Value Unit
  • + *
  • KMF - Comorian Franc
  • + *
  • CDF - Congolese Franc
  • + *
  • CRC - Costa Rican Colón
  • + *
  • HRD - Croatian Dinar
  • + *
  • HRK - Croatian Kuna
  • + *
  • CUC - Cuban Convertible Peso
  • + *
  • CUP - Cuban Peso
  • + *
  • CYP - Cypriot Pound
  • + *
  • CZK - Czech Koruna
  • + *
  • CSK - Czechoslovak Hard Koruna
  • + *
  • DKK - Danish Krone
  • + *
  • DJF - Djiboutian Franc
  • + *
  • DOP - Dominican Peso
  • + *
  • NLG - Dutch Guilder
  • + *
  • XCD - East Caribbean Dollar
  • + *
  • DDM - East German Mark
  • + *
  • ECS - Ecuadorian Sucre
  • + *
  • ECV - Ecuadorian Unit of Constant Value
  • + *
  • EGP - Egyptian Pound
  • + *
  • GQE - Equatorial Guinean Ekwele
  • + *
  • ERN - Eritrean Nakfa
  • + *
  • EEK - Estonian Kroon
  • + *
  • ETB - Ethiopian Birr
  • + *
  • EUR - Euro
  • + *
  • XBA - European Composite Unit
  • + *
  • XEU - European Currency Unit
  • + *
  • XBB - European Monetary Unit
  • + *
  • XBC - European Unit of Account (XBC)
  • + *
  • XBD - European Unit of Account (XBD)
  • + *
  • FKP - Falkland Islands Pound
  • + *
  • FJD - Fijian Dollar
  • + *
  • FIM - Finnish Markka
  • + *
  • FRF - French Franc
  • + *
  • XFO - French Gold Franc
  • + *
  • XFU - French UIC-Franc
  • + *
  • GMD - Gambian Dalasi
  • + *
  • GEK - Georgian Kupon Larit
  • + *
  • GEL - Georgian Lari
  • + *
  • DEM - German Mark
  • + *
  • GHS - Ghanaian Cedi
  • + *
  • GHC - Ghanaian Cedi (1979–2007)
  • + *
  • GIP - Gibraltar Pound
  • + *
  • XAU - Gold
  • + *
  • GRD - Greek Drachma
  • + *
  • GTQ - Guatemalan Quetzal
  • + *
  • GWP - Guinea-Bissau Peso
  • + *
  • GNF - Guinean Franc
  • + *
  • GNS - Guinean Syli
  • + *
  • GYD - Guyanaese Dollar
  • + *
  • HTG - Haitian Gourde
  • + *
  • HNL - Honduran Lempira
  • + *
  • HKD - Hong Kong Dollar
  • + *
  • HUF - Hungarian Forint
  • + *
  • IMP - IMP
  • + *
  • ISK - Icelandic Króna
  • + *
  • ISJ - Icelandic Króna (1918–1981)
  • + *
  • INR - Indian Rupee
  • + *
  • IDR - Indonesian Rupiah
  • + *
  • IRR - Iranian Rial
  • + *
  • IQD - Iraqi Dinar
  • + *
  • IEP - Irish Pound
  • + *
  • ILS - Israeli New Shekel
  • + *
  • ILP - Israeli Pound
  • + *
  • ILR - Israeli Shekel (1980–1985)
  • + *
  • ITL - Italian Lira
  • + *
  • JMD - Jamaican Dollar
  • + *
  • JPY - Japanese Yen
  • + *
  • JOD - Jordanian Dinar
  • + *
  • KZT - Kazakhstani Tenge
  • + *
  • KES - Kenyan Shilling
  • + *
  • KWD - Kuwaiti Dinar
  • + *
  • KGS - Kyrgystani Som
  • + *
  • LAK - Laotian Kip
  • + *
  • LVL - Latvian Lats
  • + *
  • LVR - Latvian Ruble
  • + *
  • LBP - Lebanese Pound
  • + *
  • LSL - Lesotho Loti
  • + *
  • LRD - Liberian Dollar
  • + *
  • LYD - Libyan Dinar
  • + *
  • LTL - Lithuanian Litas
  • + *
  • LTT - Lithuanian Talonas
  • + *
  • LUL - Luxembourg Financial Franc
  • + *
  • LUC - Luxembourgian Convertible Franc
  • + *
  • LUF - Luxembourgian Franc
  • + *
  • MOP - Macanese Pataca
  • + *
  • MKD - Macedonian Denar
  • + *
  • MKN - Macedonian Denar (1992–1993)
  • + *
  • MGA - Malagasy Ariary
  • + *
  • MGF - Malagasy Franc
  • + *
  • MWK - Malawian Kwacha
  • + *
  • MYR - Malaysian Ringgit
  • + *
  • MVR - Maldivian Rufiyaa
  • + *
  • MVP - Maldivian Rupee (1947–1981)
  • + *
  • MLF - Malian Franc
  • + *
  • MTL - Maltese Lira
  • + *
  • MTP - Maltese Pound
  • + *
  • MRU - Mauritanian Ouguiya
  • + *
  • MRO - Mauritanian Ouguiya (1973–2017)
  • + *
  • MUR - Mauritian Rupee
  • + *
  • MXV - Mexican Investment Unit
  • + *
  • MXN - Mexican Peso
  • + *
  • MXP - Mexican Silver Peso (1861–1992)
  • + *
  • MDC - Moldovan Cupon
  • + *
  • MDL - Moldovan Leu
  • + *
  • MCF - Monegasque Franc
  • + *
  • MNT - Mongolian Tugrik
  • + *
  • MAD - Moroccan Dirham
  • + *
  • MAF - Moroccan Franc
  • + *
  • MZE - Mozambican Escudo
  • + *
  • MZN - Mozambican Metical
  • + *
  • MZM - Mozambican Metical (1980–2006)
  • + *
  • MMK - Myanmar Kyat
  • + *
  • NAD - Namibian Dollar
  • + *
  • NPR - Nepalese Rupee
  • + *
  • ANG - Netherlands Antillean Guilder
  • + *
  • TWD - New Taiwan Dollar
  • + *
  • NZD - New Zealand Dollar
  • + *
  • NIO - Nicaraguan Córdoba
  • + *
  • NIC - Nicaraguan Córdoba (1988–1991)
  • + *
  • NGN - Nigerian Naira
  • + *
  • KPW - North Korean Won
  • + *
  • NOK - Norwegian Krone
  • + *
  • OMR - Omani Rial
  • + *
  • PKR - Pakistani Rupee
  • + *
  • XPD - Palladium
  • + *
  • PAB - Panamanian Balboa
  • + *
  • PGK - Papua New Guinean Kina
  • + *
  • PYG - Paraguayan Guarani
  • + *
  • PEI - Peruvian Inti
  • + *
  • PEN - Peruvian Sol
  • + *
  • PES - Peruvian Sol (1863–1965)
  • + *
  • PHP - Philippine Peso
  • + *
  • XPT - Platinum
  • + *
  • PLN - Polish Zloty
  • + *
  • PLZ - Polish Zloty (1950–1995)
  • + *
  • PTE - Portuguese Escudo
  • + *
  • GWE - Portuguese Guinea Escudo
  • + *
  • QAR - Qatari Rial
  • + *
  • XRE - RINET Funds
  • + *
  • RHD - Rhodesian Dollar
  • + *
  • RON - Romanian Leu
  • + *
  • ROL - Romanian Leu (1952–2006)
  • + *
  • RUB - Russian Ruble
  • + *
  • RUR - Russian Ruble (1991–1998)
  • + *
  • RWF - Rwandan Franc
  • + *
  • SVC - Salvadoran Colón
  • + *
  • WST - Samoan Tala
  • + *
  • SAR - Saudi Riyal
  • + *
  • RSD - Serbian Dinar
  • + *
  • CSD - Serbian Dinar (2002–2006)
  • + *
  • SCR - Seychellois Rupee
  • + *
  • SLL - Sierra Leonean Leone
  • + *
  • XAG - Silver
  • + *
  • SGD - Singapore Dollar
  • + *
  • SKK - Slovak Koruna
  • + *
  • SIT - Slovenian Tolar
  • + *
  • SBD - Solomon Islands Dollar
  • + *
  • SOS - Somali Shilling
  • + *
  • ZAR - South African Rand
  • + *
  • ZAL - South African Rand (financial)
  • + *
  • KRH - South Korean Hwan (1953–1962)
  • + *
  • KRW - South Korean Won
  • + *
  • KRO - South Korean Won (1945–1953)
  • + *
  • SSP - South Sudanese Pound
  • + *
  • SUR - Soviet Rouble
  • + *
  • ESP - Spanish Peseta
  • + *
  • ESA - Spanish Peseta (A account)
  • + *
  • ESB - Spanish Peseta (convertible account)
  • + *
  • XDR - Special Drawing Rights
  • + *
  • LKR - Sri Lankan Rupee
  • + *
  • SHP - St. Helena Pound
  • + *
  • XSU - Sucre
  • + *
  • SDD - Sudanese Dinar (1992–2007)
  • + *
  • SDG - Sudanese Pound
  • + *
  • SDP - Sudanese Pound (1957–1998)
  • + *
  • SRD - Surinamese Dollar
  • + *
  • SRG - Surinamese Guilder
  • + *
  • SZL - Swazi Lilangeni
  • + *
  • SEK - Swedish Krona
  • + *
  • CHF - Swiss Franc
  • + *
  • SYP - Syrian Pound
  • + *
  • STN - São Tomé & Príncipe Dobra
  • + *
  • STD - São Tomé & Príncipe Dobra (1977–2017)
  • + *
  • TVD - TVD
  • + *
  • TJR - Tajikistani Ruble
  • + *
  • TJS - Tajikistani Somoni
  • + *
  • TZS - Tanzanian Shilling
  • + *
  • XTS - Testing Currency Code
  • + *
  • THB - Thai Baht
  • + *
  • XXX - The codes assigned for transactions where no currency is involved
  • + *
  • TPE - Timorese Escudo
  • + *
  • TOP - Tongan PaÊ»anga
  • + *
  • TTD - Trinidad & Tobago Dollar
  • + *
  • TND - Tunisian Dinar
  • + *
  • TRY - Turkish Lira
  • + *
  • TRL - Turkish Lira (1922–2005)
  • + *
  • TMT - Turkmenistani Manat
  • + *
  • TMM - Turkmenistani Manat (1993–2009)
  • + *
  • USD - US Dollar
  • + *
  • USN - US Dollar (Next day)
  • + *
  • USS - US Dollar (Same day)
  • + *
  • UGX - Ugandan Shilling
  • + *
  • UGS - Ugandan Shilling (1966–1987)
  • + *
  • UAH - Ukrainian Hryvnia
  • + *
  • UAK - Ukrainian Karbovanets
  • + *
  • AED - United Arab Emirates Dirham
  • + *
  • UYW - Uruguayan Nominal Wage Index Unit
  • + *
  • UYU - Uruguayan Peso
  • + *
  • UYP - Uruguayan Peso (1975–1993)
  • + *
  • UYI - Uruguayan Peso (Indexed Units)
  • + *
  • UZS - Uzbekistani Som
  • + *
  • VUV - Vanuatu Vatu
  • + *
  • VES - Venezuelan Bolívar
  • + *
  • VEB - Venezuelan Bolívar (1871–2008)
  • + *
  • VEF - Venezuelan Bolívar (2008–2018)
  • + *
  • VND - Vietnamese Dong
  • + *
  • VNN - Vietnamese Dong (1978–1985)
  • + *
  • CHE - WIR Euro
  • + *
  • CHW - WIR Franc
  • + *
  • XOF - West African CFA Franc
  • + *
  • YDD - Yemeni Dinar
  • + *
  • YER - Yemeni Rial
  • + *
  • YUN - Yugoslavian Convertible Dinar (1990–1992)
  • + *
  • YUD - Yugoslavian Hard Dinar (1966–1990)
  • + *
  • YUM - Yugoslavian New Dinar (1994–2002)
  • + *
  • YUR - Yugoslavian Reformed Dinar (1992–1993)
  • + *
  • ZWN - ZWN
  • + *
  • ZRN - Zairean New Zaire (1993–1998)
  • + *
  • ZRZ - Zairean Zaire (1971–1993)
  • + *
  • ZMW - Zambian Kwacha
  • + *
  • ZMK - Zambian Kwacha (1968–2012)
  • + *
  • ZWD - Zimbabwean Dollar (1980–2008)
  • + *
  • ZWR - Zimbabwean Dollar (2008)
  • + *
  • ZWL - Zimbabwean Dollar (2009)
  • + *
+ */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return The account's number. + */ + @JsonProperty("account_number") + public Optional getAccountNumber() { + return accountNumber; + } + + /** + * @return ID of the parent account. + */ + @JsonProperty("parent_account") + public Optional getParentAccount() { + return parentAccount; + } + + /** + * @return The company the account belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Account && equalTo((Account) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Account other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && description.equals(other.description) + && classification.equals(other.classification) + && type.equals(other.type) + && accountType.equals(other.accountType) + && status.equals(other.status) + && currentBalance.equals(other.currentBalance) + && currency.equals(other.currency) + && accountNumber.equals(other.accountNumber) + && parentAccount.equals(other.parentAccount) + && company.equals(other.company) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.classification, + this.type, + this.accountType, + this.status, + this.currentBalance, + this.currency, + this.accountNumber, + this.parentAccount, + this.company, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional classification = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional currentBalance = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional accountNumber = Optional.empty(); + + private Optional parentAccount = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Account other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + classification(other.getClassification()); + type(other.getType()); + accountType(other.getAccountType()); + status(other.getStatus()); + currentBalance(other.getCurrentBalance()); + currency(other.getCurrency()); + accountNumber(other.getAccountNumber()); + parentAccount(other.getParentAccount()); + company(other.getCompany()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "classification", nulls = Nulls.SKIP) + public Builder classification(Optional classification) { + this.classification = classification; + return this; + } + + public Builder classification(ClassificationEnum classification) { + this.classification = Optional.ofNullable(classification); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(AccountAccountTypeEnum accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(AccountStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "current_balance", nulls = Nulls.SKIP) + public Builder currentBalance(Optional currentBalance) { + this.currentBalance = currentBalance; + return this; + } + + public Builder currentBalance(Double currentBalance) { + this.currentBalance = Optional.ofNullable(currentBalance); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(TransactionCurrencyEnum currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "account_number", nulls = Nulls.SKIP) + public Builder accountNumber(Optional accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + public Builder accountNumber(String accountNumber) { + this.accountNumber = Optional.ofNullable(accountNumber); + return this; + } + + @JsonSetter(value = "parent_account", nulls = Nulls.SKIP) + public Builder parentAccount(Optional parentAccount) { + this.parentAccount = parentAccount; + return this; + } + + public Builder parentAccount(String parentAccount) { + this.parentAccount = Optional.ofNullable(parentAccount); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(String company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Account build() { + return new Account( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + classification, + type, + accountType, + status, + currentBalance, + currency, + accountNumber, + parentAccount, + company, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountAccountTypeEnum.java b/src/main/java/com/merge/api/accounting/types/AccountAccountTypeEnum.java similarity index 94% rename from src/main/java/com/merge/api/resources/accounting/types/AccountAccountTypeEnum.java rename to src/main/java/com/merge/api/accounting/types/AccountAccountTypeEnum.java index 2eb72d204..c17da9be1 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountAccountTypeEnum.java +++ b/src/main/java/com/merge/api/accounting/types/AccountAccountTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/AccountDetails.java b/src/main/java/com/merge/api/accounting/types/AccountDetails.java new file mode 100644 index 000000000..5f29b1d18 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountDetails.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..625686b95 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatusEnum status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatusEnum status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatusEnum getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(CategoryEnum category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatusEnum status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

The tenant or domain the customer has provided access to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..85ed8a1aa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..d8031d53d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountDetailsAndActionsStatusEnum { + COMPLETE("COMPLETE"), + + INCOMPLETE("INCOMPLETE"), + + RELINK_NEEDED("RELINK_NEEDED"), + + IDLE("IDLE"); + + private final String value; + + AccountDetailsAndActionsStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/AccountEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/AccountEndpointRequest.java index b6fc2aef5..a5d9563e9 100644 --- a/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.accounts.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.AccountRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/accounting/types/AccountIntegration.java b/src/main/java/com/merge/api/accounting/types/AccountIntegration.java new file mode 100644 index 000000000..a7f7ebe16 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountIntegration.java @@ -0,0 +1,463 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

Company name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

Category or categories this integration is in beta status for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

Company logo in square shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

Company logo in rectangular shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountRequest.java b/src/main/java/com/merge/api/accounting/types/AccountRequest.java new file mode 100644 index 000000000..71278bee2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountRequest.java @@ -0,0 +1,781 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountRequest.Builder.class) +public final class AccountRequest { + private final Optional name; + + private final Optional description; + + private final Optional classification; + + private final Optional type; + + private final Optional accountType; + + private final Optional status; + + private final Optional currentBalance; + + private final Optional currency; + + private final Optional accountNumber; + + private final Optional parentAccount; + + private final Optional company; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private AccountRequest( + Optional name, + Optional description, + Optional classification, + Optional type, + Optional accountType, + Optional status, + Optional currentBalance, + Optional currency, + Optional accountNumber, + Optional parentAccount, + Optional company, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.name = name; + this.description = description; + this.classification = classification; + this.type = type; + this.accountType = accountType; + this.status = status; + this.currentBalance = currentBalance; + this.currency = currency; + this.accountNumber = accountNumber; + this.parentAccount = parentAccount; + this.company = company; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The account's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The account's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The account's broadest grouping. + *
    + *
  • ASSET - ASSET
  • + *
  • EQUITY - EQUITY
  • + *
  • EXPENSE - EXPENSE
  • + *
  • LIABILITY - LIABILITY
  • + *
  • REVENUE - REVENUE
  • + *
+ */ + @JsonProperty("classification") + public Optional getClassification() { + return classification; + } + + /** + * @return The account's type is a narrower and more specific grouping within the account's classification. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Normalized account type- which is a narrower and more specific grouping within the account's classification. + *
    + *
  • BANK - BANK
  • + *
  • CREDIT_CARD - CREDIT_CARD
  • + *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • + *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • + *
  • FIXED_ASSET - FIXED_ASSET
  • + *
  • OTHER_ASSET - OTHER_ASSET
  • + *
  • OTHER_CURRENT_ASSET - OTHER_CURRENT_ASSET
  • + *
  • OTHER_EXPENSE - OTHER_EXPENSE
  • + *
  • OTHER_INCOME - OTHER_INCOME
  • + *
  • COST_OF_GOODS_SOLD - COST_OF_GOODS_SOLD
  • + *
  • OTHER_CURRENT_LIABILITY - OTHER_CURRENT_LIABILITY
  • + *
  • LONG_TERM_LIABILITY - LONG_TERM_LIABILITY
  • + *
  • NON_POSTING - NON_POSTING
  • + *
+ */ + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The account's status. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • PENDING - PENDING
  • + *
  • INACTIVE - INACTIVE
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The account's current balance. + */ + @JsonProperty("current_balance") + public Optional getCurrentBalance() { + return currentBalance; + } + + /** + * @return The account's currency. + *
    + *
  • XUA - ADB Unit of Account
  • + *
  • AFN - Afghan Afghani
  • + *
  • AFA - Afghan Afghani (1927–2002)
  • + *
  • ALL - Albanian Lek
  • + *
  • ALK - Albanian Lek (1946–1965)
  • + *
  • DZD - Algerian Dinar
  • + *
  • ADP - Andorran Peseta
  • + *
  • AOA - Angolan Kwanza
  • + *
  • AOK - Angolan Kwanza (1977–1991)
  • + *
  • AON - Angolan New Kwanza (1990–2000)
  • + *
  • AOR - Angolan Readjusted Kwanza (1995–1999)
  • + *
  • ARA - Argentine Austral
  • + *
  • ARS - Argentine Peso
  • + *
  • ARM - Argentine Peso (1881–1970)
  • + *
  • ARP - Argentine Peso (1983–1985)
  • + *
  • ARL - Argentine Peso Ley (1970–1983)
  • + *
  • AMD - Armenian Dram
  • + *
  • AWG - Aruban Florin
  • + *
  • AUD - Australian Dollar
  • + *
  • ATS - Austrian Schilling
  • + *
  • AZN - Azerbaijani Manat
  • + *
  • AZM - Azerbaijani Manat (1993–2006)
  • + *
  • BSD - Bahamian Dollar
  • + *
  • BHD - Bahraini Dinar
  • + *
  • BDT - Bangladeshi Taka
  • + *
  • BBD - Barbadian Dollar
  • + *
  • BYN - Belarusian Ruble
  • + *
  • BYB - Belarusian Ruble (1994–1999)
  • + *
  • BYR - Belarusian Ruble (2000–2016)
  • + *
  • BEF - Belgian Franc
  • + *
  • BEC - Belgian Franc (convertible)
  • + *
  • BEL - Belgian Franc (financial)
  • + *
  • BZD - Belize Dollar
  • + *
  • BMD - Bermudan Dollar
  • + *
  • BTN - Bhutanese Ngultrum
  • + *
  • BOB - Bolivian Boliviano
  • + *
  • BOL - Bolivian Boliviano (1863–1963)
  • + *
  • BOV - Bolivian Mvdol
  • + *
  • BOP - Bolivian Peso
  • + *
  • BAM - Bosnia-Herzegovina Convertible Mark
  • + *
  • BAD - Bosnia-Herzegovina Dinar (1992–1994)
  • + *
  • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
  • + *
  • BWP - Botswanan Pula
  • + *
  • BRC - Brazilian Cruzado (1986–1989)
  • + *
  • BRZ - Brazilian Cruzeiro (1942–1967)
  • + *
  • BRE - Brazilian Cruzeiro (1990–1993)
  • + *
  • BRR - Brazilian Cruzeiro (1993–1994)
  • + *
  • BRN - Brazilian New Cruzado (1989–1990)
  • + *
  • BRB - Brazilian New Cruzeiro (1967–1986)
  • + *
  • BRL - Brazilian Real
  • + *
  • GBP - British Pound
  • + *
  • BND - Brunei Dollar
  • + *
  • BGL - Bulgarian Hard Lev
  • + *
  • BGN - Bulgarian Lev
  • + *
  • BGO - Bulgarian Lev (1879–1952)
  • + *
  • BGM - Bulgarian Socialist Lev
  • + *
  • BUK - Burmese Kyat
  • + *
  • BIF - Burundian Franc
  • + *
  • XPF - CFP Franc
  • + *
  • KHR - Cambodian Riel
  • + *
  • CAD - Canadian Dollar
  • + *
  • CVE - Cape Verdean Escudo
  • + *
  • KYD - Cayman Islands Dollar
  • + *
  • XAF - Central African CFA Franc
  • + *
  • CLE - Chilean Escudo
  • + *
  • CLP - Chilean Peso
  • + *
  • CLF - Chilean Unit of Account (UF)
  • + *
  • CNX - Chinese People’s Bank Dollar
  • + *
  • CNY - Chinese Yuan
  • + *
  • CNH - Chinese Yuan (offshore)
  • + *
  • COP - Colombian Peso
  • + *
  • COU - Colombian Real Value Unit
  • + *
  • KMF - Comorian Franc
  • + *
  • CDF - Congolese Franc
  • + *
  • CRC - Costa Rican Colón
  • + *
  • HRD - Croatian Dinar
  • + *
  • HRK - Croatian Kuna
  • + *
  • CUC - Cuban Convertible Peso
  • + *
  • CUP - Cuban Peso
  • + *
  • CYP - Cypriot Pound
  • + *
  • CZK - Czech Koruna
  • + *
  • CSK - Czechoslovak Hard Koruna
  • + *
  • DKK - Danish Krone
  • + *
  • DJF - Djiboutian Franc
  • + *
  • DOP - Dominican Peso
  • + *
  • NLG - Dutch Guilder
  • + *
  • XCD - East Caribbean Dollar
  • + *
  • DDM - East German Mark
  • + *
  • ECS - Ecuadorian Sucre
  • + *
  • ECV - Ecuadorian Unit of Constant Value
  • + *
  • EGP - Egyptian Pound
  • + *
  • GQE - Equatorial Guinean Ekwele
  • + *
  • ERN - Eritrean Nakfa
  • + *
  • EEK - Estonian Kroon
  • + *
  • ETB - Ethiopian Birr
  • + *
  • EUR - Euro
  • + *
  • XBA - European Composite Unit
  • + *
  • XEU - European Currency Unit
  • + *
  • XBB - European Monetary Unit
  • + *
  • XBC - European Unit of Account (XBC)
  • + *
  • XBD - European Unit of Account (XBD)
  • + *
  • FKP - Falkland Islands Pound
  • + *
  • FJD - Fijian Dollar
  • + *
  • FIM - Finnish Markka
  • + *
  • FRF - French Franc
  • + *
  • XFO - French Gold Franc
  • + *
  • XFU - French UIC-Franc
  • + *
  • GMD - Gambian Dalasi
  • + *
  • GEK - Georgian Kupon Larit
  • + *
  • GEL - Georgian Lari
  • + *
  • DEM - German Mark
  • + *
  • GHS - Ghanaian Cedi
  • + *
  • GHC - Ghanaian Cedi (1979–2007)
  • + *
  • GIP - Gibraltar Pound
  • + *
  • XAU - Gold
  • + *
  • GRD - Greek Drachma
  • + *
  • GTQ - Guatemalan Quetzal
  • + *
  • GWP - Guinea-Bissau Peso
  • + *
  • GNF - Guinean Franc
  • + *
  • GNS - Guinean Syli
  • + *
  • GYD - Guyanaese Dollar
  • + *
  • HTG - Haitian Gourde
  • + *
  • HNL - Honduran Lempira
  • + *
  • HKD - Hong Kong Dollar
  • + *
  • HUF - Hungarian Forint
  • + *
  • IMP - IMP
  • + *
  • ISK - Icelandic Króna
  • + *
  • ISJ - Icelandic Króna (1918–1981)
  • + *
  • INR - Indian Rupee
  • + *
  • IDR - Indonesian Rupiah
  • + *
  • IRR - Iranian Rial
  • + *
  • IQD - Iraqi Dinar
  • + *
  • IEP - Irish Pound
  • + *
  • ILS - Israeli New Shekel
  • + *
  • ILP - Israeli Pound
  • + *
  • ILR - Israeli Shekel (1980–1985)
  • + *
  • ITL - Italian Lira
  • + *
  • JMD - Jamaican Dollar
  • + *
  • JPY - Japanese Yen
  • + *
  • JOD - Jordanian Dinar
  • + *
  • KZT - Kazakhstani Tenge
  • + *
  • KES - Kenyan Shilling
  • + *
  • KWD - Kuwaiti Dinar
  • + *
  • KGS - Kyrgystani Som
  • + *
  • LAK - Laotian Kip
  • + *
  • LVL - Latvian Lats
  • + *
  • LVR - Latvian Ruble
  • + *
  • LBP - Lebanese Pound
  • + *
  • LSL - Lesotho Loti
  • + *
  • LRD - Liberian Dollar
  • + *
  • LYD - Libyan Dinar
  • + *
  • LTL - Lithuanian Litas
  • + *
  • LTT - Lithuanian Talonas
  • + *
  • LUL - Luxembourg Financial Franc
  • + *
  • LUC - Luxembourgian Convertible Franc
  • + *
  • LUF - Luxembourgian Franc
  • + *
  • MOP - Macanese Pataca
  • + *
  • MKD - Macedonian Denar
  • + *
  • MKN - Macedonian Denar (1992–1993)
  • + *
  • MGA - Malagasy Ariary
  • + *
  • MGF - Malagasy Franc
  • + *
  • MWK - Malawian Kwacha
  • + *
  • MYR - Malaysian Ringgit
  • + *
  • MVR - Maldivian Rufiyaa
  • + *
  • MVP - Maldivian Rupee (1947–1981)
  • + *
  • MLF - Malian Franc
  • + *
  • MTL - Maltese Lira
  • + *
  • MTP - Maltese Pound
  • + *
  • MRU - Mauritanian Ouguiya
  • + *
  • MRO - Mauritanian Ouguiya (1973–2017)
  • + *
  • MUR - Mauritian Rupee
  • + *
  • MXV - Mexican Investment Unit
  • + *
  • MXN - Mexican Peso
  • + *
  • MXP - Mexican Silver Peso (1861–1992)
  • + *
  • MDC - Moldovan Cupon
  • + *
  • MDL - Moldovan Leu
  • + *
  • MCF - Monegasque Franc
  • + *
  • MNT - Mongolian Tugrik
  • + *
  • MAD - Moroccan Dirham
  • + *
  • MAF - Moroccan Franc
  • + *
  • MZE - Mozambican Escudo
  • + *
  • MZN - Mozambican Metical
  • + *
  • MZM - Mozambican Metical (1980–2006)
  • + *
  • MMK - Myanmar Kyat
  • + *
  • NAD - Namibian Dollar
  • + *
  • NPR - Nepalese Rupee
  • + *
  • ANG - Netherlands Antillean Guilder
  • + *
  • TWD - New Taiwan Dollar
  • + *
  • NZD - New Zealand Dollar
  • + *
  • NIO - Nicaraguan Córdoba
  • + *
  • NIC - Nicaraguan Córdoba (1988–1991)
  • + *
  • NGN - Nigerian Naira
  • + *
  • KPW - North Korean Won
  • + *
  • NOK - Norwegian Krone
  • + *
  • OMR - Omani Rial
  • + *
  • PKR - Pakistani Rupee
  • + *
  • XPD - Palladium
  • + *
  • PAB - Panamanian Balboa
  • + *
  • PGK - Papua New Guinean Kina
  • + *
  • PYG - Paraguayan Guarani
  • + *
  • PEI - Peruvian Inti
  • + *
  • PEN - Peruvian Sol
  • + *
  • PES - Peruvian Sol (1863–1965)
  • + *
  • PHP - Philippine Peso
  • + *
  • XPT - Platinum
  • + *
  • PLN - Polish Zloty
  • + *
  • PLZ - Polish Zloty (1950–1995)
  • + *
  • PTE - Portuguese Escudo
  • + *
  • GWE - Portuguese Guinea Escudo
  • + *
  • QAR - Qatari Rial
  • + *
  • XRE - RINET Funds
  • + *
  • RHD - Rhodesian Dollar
  • + *
  • RON - Romanian Leu
  • + *
  • ROL - Romanian Leu (1952–2006)
  • + *
  • RUB - Russian Ruble
  • + *
  • RUR - Russian Ruble (1991–1998)
  • + *
  • RWF - Rwandan Franc
  • + *
  • SVC - Salvadoran Colón
  • + *
  • WST - Samoan Tala
  • + *
  • SAR - Saudi Riyal
  • + *
  • RSD - Serbian Dinar
  • + *
  • CSD - Serbian Dinar (2002–2006)
  • + *
  • SCR - Seychellois Rupee
  • + *
  • SLL - Sierra Leonean Leone
  • + *
  • XAG - Silver
  • + *
  • SGD - Singapore Dollar
  • + *
  • SKK - Slovak Koruna
  • + *
  • SIT - Slovenian Tolar
  • + *
  • SBD - Solomon Islands Dollar
  • + *
  • SOS - Somali Shilling
  • + *
  • ZAR - South African Rand
  • + *
  • ZAL - South African Rand (financial)
  • + *
  • KRH - South Korean Hwan (1953–1962)
  • + *
  • KRW - South Korean Won
  • + *
  • KRO - South Korean Won (1945–1953)
  • + *
  • SSP - South Sudanese Pound
  • + *
  • SUR - Soviet Rouble
  • + *
  • ESP - Spanish Peseta
  • + *
  • ESA - Spanish Peseta (A account)
  • + *
  • ESB - Spanish Peseta (convertible account)
  • + *
  • XDR - Special Drawing Rights
  • + *
  • LKR - Sri Lankan Rupee
  • + *
  • SHP - St. Helena Pound
  • + *
  • XSU - Sucre
  • + *
  • SDD - Sudanese Dinar (1992–2007)
  • + *
  • SDG - Sudanese Pound
  • + *
  • SDP - Sudanese Pound (1957–1998)
  • + *
  • SRD - Surinamese Dollar
  • + *
  • SRG - Surinamese Guilder
  • + *
  • SZL - Swazi Lilangeni
  • + *
  • SEK - Swedish Krona
  • + *
  • CHF - Swiss Franc
  • + *
  • SYP - Syrian Pound
  • + *
  • STN - São Tomé & Príncipe Dobra
  • + *
  • STD - São Tomé & Príncipe Dobra (1977–2017)
  • + *
  • TVD - TVD
  • + *
  • TJR - Tajikistani Ruble
  • + *
  • TJS - Tajikistani Somoni
  • + *
  • TZS - Tanzanian Shilling
  • + *
  • XTS - Testing Currency Code
  • + *
  • THB - Thai Baht
  • + *
  • XXX - The codes assigned for transactions where no currency is involved
  • + *
  • TPE - Timorese Escudo
  • + *
  • TOP - Tongan PaÊ»anga
  • + *
  • TTD - Trinidad & Tobago Dollar
  • + *
  • TND - Tunisian Dinar
  • + *
  • TRY - Turkish Lira
  • + *
  • TRL - Turkish Lira (1922–2005)
  • + *
  • TMT - Turkmenistani Manat
  • + *
  • TMM - Turkmenistani Manat (1993–2009)
  • + *
  • USD - US Dollar
  • + *
  • USN - US Dollar (Next day)
  • + *
  • USS - US Dollar (Same day)
  • + *
  • UGX - Ugandan Shilling
  • + *
  • UGS - Ugandan Shilling (1966–1987)
  • + *
  • UAH - Ukrainian Hryvnia
  • + *
  • UAK - Ukrainian Karbovanets
  • + *
  • AED - United Arab Emirates Dirham
  • + *
  • UYW - Uruguayan Nominal Wage Index Unit
  • + *
  • UYU - Uruguayan Peso
  • + *
  • UYP - Uruguayan Peso (1975–1993)
  • + *
  • UYI - Uruguayan Peso (Indexed Units)
  • + *
  • UZS - Uzbekistani Som
  • + *
  • VUV - Vanuatu Vatu
  • + *
  • VES - Venezuelan Bolívar
  • + *
  • VEB - Venezuelan Bolívar (1871–2008)
  • + *
  • VEF - Venezuelan Bolívar (2008–2018)
  • + *
  • VND - Vietnamese Dong
  • + *
  • VNN - Vietnamese Dong (1978–1985)
  • + *
  • CHE - WIR Euro
  • + *
  • CHW - WIR Franc
  • + *
  • XOF - West African CFA Franc
  • + *
  • YDD - Yemeni Dinar
  • + *
  • YER - Yemeni Rial
  • + *
  • YUN - Yugoslavian Convertible Dinar (1990–1992)
  • + *
  • YUD - Yugoslavian Hard Dinar (1966–1990)
  • + *
  • YUM - Yugoslavian New Dinar (1994–2002)
  • + *
  • YUR - Yugoslavian Reformed Dinar (1992–1993)
  • + *
  • ZWN - ZWN
  • + *
  • ZRN - Zairean New Zaire (1993–1998)
  • + *
  • ZRZ - Zairean Zaire (1971–1993)
  • + *
  • ZMW - Zambian Kwacha
  • + *
  • ZMK - Zambian Kwacha (1968–2012)
  • + *
  • ZWD - Zimbabwean Dollar (1980–2008)
  • + *
  • ZWR - Zimbabwean Dollar (2008)
  • + *
  • ZWL - Zimbabwean Dollar (2009)
  • + *
+ */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return The account's number. + */ + @JsonProperty("account_number") + public Optional getAccountNumber() { + return accountNumber; + } + + /** + * @return ID of the parent account. + */ + @JsonProperty("parent_account") + public Optional getParentAccount() { + return parentAccount; + } + + /** + * @return The company the account belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountRequest && equalTo((AccountRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountRequest other) { + return name.equals(other.name) + && description.equals(other.description) + && classification.equals(other.classification) + && type.equals(other.type) + && accountType.equals(other.accountType) + && status.equals(other.status) + && currentBalance.equals(other.currentBalance) + && currency.equals(other.currency) + && accountNumber.equals(other.accountNumber) + && parentAccount.equals(other.parentAccount) + && company.equals(other.company) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.description, + this.classification, + this.type, + this.accountType, + this.status, + this.currentBalance, + this.currency, + this.accountNumber, + this.parentAccount, + this.company, + this.integrationParams, + this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional classification = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional currentBalance = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional accountNumber = Optional.empty(); + + private Optional parentAccount = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountRequest other) { + name(other.getName()); + description(other.getDescription()); + classification(other.getClassification()); + type(other.getType()); + accountType(other.getAccountType()); + status(other.getStatus()); + currentBalance(other.getCurrentBalance()); + currency(other.getCurrency()); + accountNumber(other.getAccountNumber()); + parentAccount(other.getParentAccount()); + company(other.getCompany()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "classification", nulls = Nulls.SKIP) + public Builder classification(Optional classification) { + this.classification = classification; + return this; + } + + public Builder classification(ClassificationEnum classification) { + this.classification = Optional.ofNullable(classification); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(String type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(AccountAccountTypeEnum accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(AccountStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "current_balance", nulls = Nulls.SKIP) + public Builder currentBalance(Optional currentBalance) { + this.currentBalance = currentBalance; + return this; + } + + public Builder currentBalance(Double currentBalance) { + this.currentBalance = Optional.ofNullable(currentBalance); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(TransactionCurrencyEnum currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "account_number", nulls = Nulls.SKIP) + public Builder accountNumber(Optional accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + public Builder accountNumber(String accountNumber) { + this.accountNumber = Optional.ofNullable(accountNumber); + return this; + } + + @JsonSetter(value = "parent_account", nulls = Nulls.SKIP) + public Builder parentAccount(Optional parentAccount) { + this.parentAccount = parentAccount; + return this; + } + + public Builder parentAccount(String parentAccount) { + this.parentAccount = Optional.ofNullable(parentAccount); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(String company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public AccountRequest build() { + return new AccountRequest( + name, + description, + classification, + type, + accountType, + status, + currentBalance, + currency, + accountNumber, + parentAccount, + company, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountResponse.java b/src/main/java/com/merge/api/accounting/types/AccountResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/AccountResponse.java rename to src/main/java/com/merge/api/accounting/types/AccountResponse.java index d40151455..57df45366 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountResponse.java +++ b/src/main/java/com/merge/api/accounting/types/AccountResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountStatusEnum.java b/src/main/java/com/merge/api/accounting/types/AccountStatusEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/AccountStatusEnum.java rename to src/main/java/com/merge/api/accounting/types/AccountStatusEnum.java index c8ecfbd1f..c0655b291 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountStatusEnum.java +++ b/src/main/java/com/merge/api/accounting/types/AccountStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/AccountToken.java b/src/main/java/com/merge/api/accounting/types/AccountToken.java new file mode 100644 index 000000000..3b695b8b8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountingAttachment.java b/src/main/java/com/merge/api/accounting/types/AccountingAttachment.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/AccountingAttachment.java rename to src/main/java/com/merge/api/accounting/types/AccountingAttachment.java index f76aa5c03..1f91d6e7b 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountingAttachment.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingAttachment.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/attachments/requests/AccountingAttachmentEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/attachments/requests/AccountingAttachmentEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/AccountingAttachmentEndpointRequest.java index 20b1e7b17..a39abbd05 100644 --- a/src/main/java/com/merge/api/resources/accounting/attachments/requests/AccountingAttachmentEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.attachments.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.AccountingAttachmentRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountingAttachmentRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/AccountingAttachmentRequest.java rename to src/main/java/com/merge/api/accounting/types/AccountingAttachmentRequest.java index bc61fcd61..2a5cf4d2f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountingAttachmentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountingAttachmentResponse.java b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/AccountingAttachmentResponse.java rename to src/main/java/com/merge/api/accounting/types/AccountingAttachmentResponse.java index 3e506f143..da46e3e96 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountingAttachmentResponse.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/AccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/AccountingPeriod.java index 238313681..5b4e836fe 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class AccountingPeriod { private final Optional name; - private final Optional status; + private final Optional status; private final Optional startDate; @@ -51,7 +51,7 @@ private AccountingPeriod( Optional createdAt, Optional modifiedAt, Optional name, - Optional status, + Optional status, Optional startDate, Optional endDate, Optional> fieldMappings, @@ -108,7 +108,7 @@ public Optional getName() { } @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -198,7 +198,7 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional startDate = Optional.empty(); @@ -283,12 +283,12 @@ public Builder name(String name) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(AccountingPeriodStatus status) { + public Builder status(Status895Enum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/accountingperiods/requests/AccountingPeriodsListRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingPeriodsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/accountingperiods/requests/AccountingPeriodsListRequest.java rename to src/main/java/com/merge/api/accounting/types/AccountingPeriodsListRequest.java index 81ef12eb2..5030612c7 100644 --- a/src/main/java/com/merge/api/resources/accounting/accountingperiods/requests/AccountingPeriodsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPeriodsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.accountingperiods.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/AccountingPeriodsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingPeriodsRetrieveRequest.java new file mode 100644 index 000000000..040d3aeff --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountingPeriodsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountingPeriodsRetrieveRequest.Builder.class) +public final class AccountingPeriodsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private AccountingPeriodsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountingPeriodsRetrieveRequest && equalTo((AccountingPeriodsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountingPeriodsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountingPeriodsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public AccountingPeriodsRetrieveRequest build() { + return new AccountingPeriodsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountingPhoneNumber.java b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumber.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/AccountingPhoneNumber.java rename to src/main/java/com/merge/api/accounting/types/AccountingPhoneNumber.java index 43783e8f0..c6239368b 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountingPhoneNumber.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumber.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountingPhoneNumberRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumberRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/AccountingPhoneNumberRequest.java rename to src/main/java/com/merge/api/accounting/types/AccountingPhoneNumberRequest.java index a1f4efc06..864b4366d 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountingPhoneNumberRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumberRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java b/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java new file mode 100644 index 000000000..cabe8ca0e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java @@ -0,0 +1,575 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountsListRequest.Builder.class) +public final class AccountsListRequest { + private final Optional> expand; + + private final Optional accountType; + + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional name; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Optional status; + + private final Map additionalProperties; + + private AccountsListRequest( + Optional> expand, + Optional accountType, + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional name, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Optional status, + Map additionalProperties) { + this.expand = expand; + this.accountType = accountType; + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.name = name; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only provide accounts with the passed in enum. + */ + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return If provided, will only return accounts for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return If provided, will only return Accounts with this name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + /** + * @return If provided, will only return accounts with this status. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountsListRequest other) { + return expand.equals(other.expand) + && accountType.equals(other.accountType) + && companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.accountType, + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.name, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountsListRequest other) { + expand(other.getExpand()); + accountType(other.getAccountType()); + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + name(other.getName()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(AccountsListRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(AccountsListRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public AccountsListRequest build() { + return new AccountsListRequest( + expand, + accountType, + companyId, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + name, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsListRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/AccountsListRequestRemoteFields.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsListRequestRemoteFields.java rename to src/main/java/com/merge/api/accounting/types/AccountsListRequestRemoteFields.java index 016b23e62..35aa1fb6c 100644 --- a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/accounting/types/AccountsListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.accounts.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/AccountsListRequestShowEnumOrigins.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/accounting/types/AccountsListRequestShowEnumOrigins.java index a74de6c71..4fcc7cbf9 100644 --- a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/accounting/types/AccountsListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.accounts.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequest.java new file mode 100644 index 000000000..d8afe945b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) +public final class AccountsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private AccountsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(AccountsRetrieveRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(AccountsRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public AccountsRetrieveRequest build() { + return new AccountsRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestRemoteFields.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestRemoteFields.java index 3fcffafea..4ed214930 100644 --- a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.accounts.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestShowEnumOrigins.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestShowEnumOrigins.java index 14961ba45..cad0c1f03 100644 --- a/src/main/java/com/merge/api/resources/accounting/accounts/types/AccountsRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.accounts.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/Address.java b/src/main/java/com/merge/api/accounting/types/Address.java new file mode 100644 index 000000000..083ea9e0b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/Address.java @@ -0,0 +1,618 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Address.Builder.class) +public final class Address { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional type; + + private final Optional street1; + + private final Optional street2; + + private final Optional city; + + private final Optional state; + + private final Optional countrySubdivision; + + private final Optional country; + + private final Optional zipCode; + + private final Map additionalProperties; + + private Address( + Optional createdAt, + Optional modifiedAt, + Optional type, + Optional street1, + Optional street2, + Optional city, + Optional state, + Optional countrySubdivision, + Optional country, + Optional zipCode, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.type = type; + this.street1 = street1; + this.street2 = street2; + this.city = city; + this.state = state; + this.countrySubdivision = countrySubdivision; + this.country = country; + this.zipCode = zipCode; + this.additionalProperties = additionalProperties; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The address type. + *
    + *
  • BILLING - BILLING
  • + *
  • SHIPPING - SHIPPING
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Line 1 of the address's street. + */ + @JsonProperty("street_1") + public Optional getStreet1() { + return street1; + } + + /** + * @return Line 2 of the address's street. + */ + @JsonProperty("street_2") + public Optional getStreet2() { + return street2; + } + + /** + * @return The address's city. + */ + @JsonProperty("city") + public Optional getCity() { + return city; + } + + @JsonProperty("state") + public Optional getState() { + return state; + } + + /** + * @return The address's state or region. + */ + @JsonProperty("country_subdivision") + public Optional getCountrySubdivision() { + return countrySubdivision; + } + + /** + * @return The address's country. + *
    + *
  • AF - Afghanistan
  • + *
  • AX - Ã…land Islands
  • + *
  • AL - Albania
  • + *
  • DZ - Algeria
  • + *
  • AS - American Samoa
  • + *
  • AD - Andorra
  • + *
  • AO - Angola
  • + *
  • AI - Anguilla
  • + *
  • AQ - Antarctica
  • + *
  • AG - Antigua and Barbuda
  • + *
  • AR - Argentina
  • + *
  • AM - Armenia
  • + *
  • AW - Aruba
  • + *
  • AU - Australia
  • + *
  • AT - Austria
  • + *
  • AZ - Azerbaijan
  • + *
  • BS - Bahamas
  • + *
  • BH - Bahrain
  • + *
  • BD - Bangladesh
  • + *
  • BB - Barbados
  • + *
  • BY - Belarus
  • + *
  • BE - Belgium
  • + *
  • BZ - Belize
  • + *
  • BJ - Benin
  • + *
  • BM - Bermuda
  • + *
  • BT - Bhutan
  • + *
  • BO - Bolivia
  • + *
  • BQ - Bonaire, Sint Eustatius and Saba
  • + *
  • BA - Bosnia and Herzegovina
  • + *
  • BW - Botswana
  • + *
  • BV - Bouvet Island
  • + *
  • BR - Brazil
  • + *
  • IO - British Indian Ocean Territory
  • + *
  • BN - Brunei
  • + *
  • BG - Bulgaria
  • + *
  • BF - Burkina Faso
  • + *
  • BI - Burundi
  • + *
  • CV - Cabo Verde
  • + *
  • KH - Cambodia
  • + *
  • CM - Cameroon
  • + *
  • CA - Canada
  • + *
  • KY - Cayman Islands
  • + *
  • CF - Central African Republic
  • + *
  • TD - Chad
  • + *
  • CL - Chile
  • + *
  • CN - China
  • + *
  • CX - Christmas Island
  • + *
  • CC - Cocos (Keeling) Islands
  • + *
  • CO - Colombia
  • + *
  • KM - Comoros
  • + *
  • CG - Congo
  • + *
  • CD - Congo (the Democratic Republic of the)
  • + *
  • CK - Cook Islands
  • + *
  • CR - Costa Rica
  • + *
  • CI - Côte d'Ivoire
  • + *
  • HR - Croatia
  • + *
  • CU - Cuba
  • + *
  • CW - Curaçao
  • + *
  • CY - Cyprus
  • + *
  • CZ - Czechia
  • + *
  • DK - Denmark
  • + *
  • DJ - Djibouti
  • + *
  • DM - Dominica
  • + *
  • DO - Dominican Republic
  • + *
  • EC - Ecuador
  • + *
  • EG - Egypt
  • + *
  • SV - El Salvador
  • + *
  • GQ - Equatorial Guinea
  • + *
  • ER - Eritrea
  • + *
  • EE - Estonia
  • + *
  • SZ - Eswatini
  • + *
  • ET - Ethiopia
  • + *
  • FK - Falkland Islands (Malvinas)
  • + *
  • FO - Faroe Islands
  • + *
  • FJ - Fiji
  • + *
  • FI - Finland
  • + *
  • FR - France
  • + *
  • GF - French Guiana
  • + *
  • PF - French Polynesia
  • + *
  • TF - French Southern Territories
  • + *
  • GA - Gabon
  • + *
  • GM - Gambia
  • + *
  • GE - Georgia
  • + *
  • DE - Germany
  • + *
  • GH - Ghana
  • + *
  • GI - Gibraltar
  • + *
  • GR - Greece
  • + *
  • GL - Greenland
  • + *
  • GD - Grenada
  • + *
  • GP - Guadeloupe
  • + *
  • GU - Guam
  • + *
  • GT - Guatemala
  • + *
  • GG - Guernsey
  • + *
  • GN - Guinea
  • + *
  • GW - Guinea-Bissau
  • + *
  • GY - Guyana
  • + *
  • HT - Haiti
  • + *
  • HM - Heard Island and McDonald Islands
  • + *
  • VA - Holy See
  • + *
  • HN - Honduras
  • + *
  • HK - Hong Kong
  • + *
  • HU - Hungary
  • + *
  • IS - Iceland
  • + *
  • IN - India
  • + *
  • ID - Indonesia
  • + *
  • IR - Iran
  • + *
  • IQ - Iraq
  • + *
  • IE - Ireland
  • + *
  • IM - Isle of Man
  • + *
  • IL - Israel
  • + *
  • IT - Italy
  • + *
  • JM - Jamaica
  • + *
  • JP - Japan
  • + *
  • JE - Jersey
  • + *
  • JO - Jordan
  • + *
  • KZ - Kazakhstan
  • + *
  • KE - Kenya
  • + *
  • KI - Kiribati
  • + *
  • KW - Kuwait
  • + *
  • KG - Kyrgyzstan
  • + *
  • LA - Laos
  • + *
  • LV - Latvia
  • + *
  • LB - Lebanon
  • + *
  • LS - Lesotho
  • + *
  • LR - Liberia
  • + *
  • LY - Libya
  • + *
  • LI - Liechtenstein
  • + *
  • LT - Lithuania
  • + *
  • LU - Luxembourg
  • + *
  • MO - Macao
  • + *
  • MG - Madagascar
  • + *
  • MW - Malawi
  • + *
  • MY - Malaysia
  • + *
  • MV - Maldives
  • + *
  • ML - Mali
  • + *
  • MT - Malta
  • + *
  • MH - Marshall Islands
  • + *
  • MQ - Martinique
  • + *
  • MR - Mauritania
  • + *
  • MU - Mauritius
  • + *
  • YT - Mayotte
  • + *
  • MX - Mexico
  • + *
  • FM - Micronesia (Federated States of)
  • + *
  • MD - Moldova
  • + *
  • MC - Monaco
  • + *
  • MN - Mongolia
  • + *
  • ME - Montenegro
  • + *
  • MS - Montserrat
  • + *
  • MA - Morocco
  • + *
  • MZ - Mozambique
  • + *
  • MM - Myanmar
  • + *
  • NA - Namibia
  • + *
  • NR - Nauru
  • + *
  • NP - Nepal
  • + *
  • NL - Netherlands
  • + *
  • NC - New Caledonia
  • + *
  • NZ - New Zealand
  • + *
  • NI - Nicaragua
  • + *
  • NE - Niger
  • + *
  • NG - Nigeria
  • + *
  • NU - Niue
  • + *
  • NF - Norfolk Island
  • + *
  • KP - North Korea
  • + *
  • MK - North Macedonia
  • + *
  • MP - Northern Mariana Islands
  • + *
  • NO - Norway
  • + *
  • OM - Oman
  • + *
  • PK - Pakistan
  • + *
  • PW - Palau
  • + *
  • PS - Palestine, State of
  • + *
  • PA - Panama
  • + *
  • PG - Papua New Guinea
  • + *
  • PY - Paraguay
  • + *
  • PE - Peru
  • + *
  • PH - Philippines
  • + *
  • PN - Pitcairn
  • + *
  • PL - Poland
  • + *
  • PT - Portugal
  • + *
  • PR - Puerto Rico
  • + *
  • QA - Qatar
  • + *
  • RE - Réunion
  • + *
  • RO - Romania
  • + *
  • RU - Russia
  • + *
  • RW - Rwanda
  • + *
  • BL - Saint Barthélemy
  • + *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • + *
  • KN - Saint Kitts and Nevis
  • + *
  • LC - Saint Lucia
  • + *
  • MF - Saint Martin (French part)
  • + *
  • PM - Saint Pierre and Miquelon
  • + *
  • VC - Saint Vincent and the Grenadines
  • + *
  • WS - Samoa
  • + *
  • SM - San Marino
  • + *
  • ST - Sao Tome and Principe
  • + *
  • SA - Saudi Arabia
  • + *
  • SN - Senegal
  • + *
  • RS - Serbia
  • + *
  • SC - Seychelles
  • + *
  • SL - Sierra Leone
  • + *
  • SG - Singapore
  • + *
  • SX - Sint Maarten (Dutch part)
  • + *
  • SK - Slovakia
  • + *
  • SI - Slovenia
  • + *
  • SB - Solomon Islands
  • + *
  • SO - Somalia
  • + *
  • ZA - South Africa
  • + *
  • GS - South Georgia and the South Sandwich Islands
  • + *
  • KR - South Korea
  • + *
  • SS - South Sudan
  • + *
  • ES - Spain
  • + *
  • LK - Sri Lanka
  • + *
  • SD - Sudan
  • + *
  • SR - Suriname
  • + *
  • SJ - Svalbard and Jan Mayen
  • + *
  • SE - Sweden
  • + *
  • CH - Switzerland
  • + *
  • SY - Syria
  • + *
  • TW - Taiwan
  • + *
  • TJ - Tajikistan
  • + *
  • TZ - Tanzania
  • + *
  • TH - Thailand
  • + *
  • TL - Timor-Leste
  • + *
  • TG - Togo
  • + *
  • TK - Tokelau
  • + *
  • TO - Tonga
  • + *
  • TT - Trinidad and Tobago
  • + *
  • TN - Tunisia
  • + *
  • TR - Turkey
  • + *
  • TM - Turkmenistan
  • + *
  • TC - Turks and Caicos Islands
  • + *
  • TV - Tuvalu
  • + *
  • UG - Uganda
  • + *
  • UA - Ukraine
  • + *
  • AE - United Arab Emirates
  • + *
  • GB - United Kingdom
  • + *
  • UM - United States Minor Outlying Islands
  • + *
  • US - United States of America
  • + *
  • UY - Uruguay
  • + *
  • UZ - Uzbekistan
  • + *
  • VU - Vanuatu
  • + *
  • VE - Venezuela
  • + *
  • VN - Vietnam
  • + *
  • VG - Virgin Islands (British)
  • + *
  • VI - Virgin Islands (U.S.)
  • + *
  • WF - Wallis and Futuna
  • + *
  • EH - Western Sahara
  • + *
  • YE - Yemen
  • + *
  • ZM - Zambia
  • + *
  • ZW - Zimbabwe
  • + *
+ */ + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + /** + * @return The address's zip code. + */ + @JsonProperty("zip_code") + public Optional getZipCode() { + return zipCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Address && equalTo((Address) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Address other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && type.equals(other.type) + && street1.equals(other.street1) + && street2.equals(other.street2) + && city.equals(other.city) + && state.equals(other.state) + && countrySubdivision.equals(other.countrySubdivision) + && country.equals(other.country) + && zipCode.equals(other.zipCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAt, + this.modifiedAt, + this.type, + this.street1, + this.street2, + this.city, + this.state, + this.countrySubdivision, + this.country, + this.zipCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional street1 = Optional.empty(); + + private Optional street2 = Optional.empty(); + + private Optional city = Optional.empty(); + + private Optional state = Optional.empty(); + + private Optional countrySubdivision = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional zipCode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Address other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + type(other.getType()); + street1(other.getStreet1()); + street2(other.getStreet2()); + city(other.getCity()); + state(other.getState()); + countrySubdivision(other.getCountrySubdivision()); + country(other.getCountry()); + zipCode(other.getZipCode()); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(AddressTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "street_1", nulls = Nulls.SKIP) + public Builder street1(Optional street1) { + this.street1 = street1; + return this; + } + + public Builder street1(String street1) { + this.street1 = Optional.ofNullable(street1); + return this; + } + + @JsonSetter(value = "street_2", nulls = Nulls.SKIP) + public Builder street2(Optional street2) { + this.street2 = street2; + return this; + } + + public Builder street2(String street2) { + this.street2 = Optional.ofNullable(street2); + return this; + } + + @JsonSetter(value = "city", nulls = Nulls.SKIP) + public Builder city(Optional city) { + this.city = city; + return this; + } + + public Builder city(String city) { + this.city = Optional.ofNullable(city); + return this; + } + + @JsonSetter(value = "state", nulls = Nulls.SKIP) + public Builder state(Optional state) { + this.state = state; + return this; + } + + public Builder state(JsonNode state) { + this.state = Optional.ofNullable(state); + return this; + } + + @JsonSetter(value = "country_subdivision", nulls = Nulls.SKIP) + public Builder countrySubdivision(Optional countrySubdivision) { + this.countrySubdivision = countrySubdivision; + return this; + } + + public Builder countrySubdivision(String countrySubdivision) { + this.countrySubdivision = Optional.ofNullable(countrySubdivision); + return this; + } + + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(CountryEnum country) { + this.country = Optional.ofNullable(country); + return this; + } + + @JsonSetter(value = "zip_code", nulls = Nulls.SKIP) + public Builder zipCode(Optional zipCode) { + this.zipCode = zipCode; + return this; + } + + public Builder zipCode(String zipCode) { + this.zipCode = Optional.ofNullable(zipCode); + return this; + } + + public Address build() { + return new Address( + createdAt, + modifiedAt, + type, + street1, + street2, + city, + state, + countrySubdivision, + country, + zipCode, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AddressRequest.java b/src/main/java/com/merge/api/accounting/types/AddressRequest.java new file mode 100644 index 000000000..cb8e95354 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AddressRequest.java @@ -0,0 +1,585 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AddressRequest.Builder.class) +public final class AddressRequest { + private final Optional type; + + private final Optional street1; + + private final Optional street2; + + private final Optional city; + + private final Optional countrySubdivision; + + private final Optional country; + + private final Optional zipCode; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private AddressRequest( + Optional type, + Optional street1, + Optional street2, + Optional city, + Optional countrySubdivision, + Optional country, + Optional zipCode, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.type = type; + this.street1 = street1; + this.street2 = street2; + this.city = city; + this.countrySubdivision = countrySubdivision; + this.country = country; + this.zipCode = zipCode; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The address type. + *
    + *
  • BILLING - BILLING
  • + *
  • SHIPPING - SHIPPING
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Line 1 of the address's street. + */ + @JsonProperty("street_1") + public Optional getStreet1() { + return street1; + } + + /** + * @return Line 2 of the address's street. + */ + @JsonProperty("street_2") + public Optional getStreet2() { + return street2; + } + + /** + * @return The address's city. + */ + @JsonProperty("city") + public Optional getCity() { + return city; + } + + /** + * @return The address's state or region. + */ + @JsonProperty("country_subdivision") + public Optional getCountrySubdivision() { + return countrySubdivision; + } + + /** + * @return The address's country. + *
    + *
  • AF - Afghanistan
  • + *
  • AX - Ã…land Islands
  • + *
  • AL - Albania
  • + *
  • DZ - Algeria
  • + *
  • AS - American Samoa
  • + *
  • AD - Andorra
  • + *
  • AO - Angola
  • + *
  • AI - Anguilla
  • + *
  • AQ - Antarctica
  • + *
  • AG - Antigua and Barbuda
  • + *
  • AR - Argentina
  • + *
  • AM - Armenia
  • + *
  • AW - Aruba
  • + *
  • AU - Australia
  • + *
  • AT - Austria
  • + *
  • AZ - Azerbaijan
  • + *
  • BS - Bahamas
  • + *
  • BH - Bahrain
  • + *
  • BD - Bangladesh
  • + *
  • BB - Barbados
  • + *
  • BY - Belarus
  • + *
  • BE - Belgium
  • + *
  • BZ - Belize
  • + *
  • BJ - Benin
  • + *
  • BM - Bermuda
  • + *
  • BT - Bhutan
  • + *
  • BO - Bolivia
  • + *
  • BQ - Bonaire, Sint Eustatius and Saba
  • + *
  • BA - Bosnia and Herzegovina
  • + *
  • BW - Botswana
  • + *
  • BV - Bouvet Island
  • + *
  • BR - Brazil
  • + *
  • IO - British Indian Ocean Territory
  • + *
  • BN - Brunei
  • + *
  • BG - Bulgaria
  • + *
  • BF - Burkina Faso
  • + *
  • BI - Burundi
  • + *
  • CV - Cabo Verde
  • + *
  • KH - Cambodia
  • + *
  • CM - Cameroon
  • + *
  • CA - Canada
  • + *
  • KY - Cayman Islands
  • + *
  • CF - Central African Republic
  • + *
  • TD - Chad
  • + *
  • CL - Chile
  • + *
  • CN - China
  • + *
  • CX - Christmas Island
  • + *
  • CC - Cocos (Keeling) Islands
  • + *
  • CO - Colombia
  • + *
  • KM - Comoros
  • + *
  • CG - Congo
  • + *
  • CD - Congo (the Democratic Republic of the)
  • + *
  • CK - Cook Islands
  • + *
  • CR - Costa Rica
  • + *
  • CI - Côte d'Ivoire
  • + *
  • HR - Croatia
  • + *
  • CU - Cuba
  • + *
  • CW - Curaçao
  • + *
  • CY - Cyprus
  • + *
  • CZ - Czechia
  • + *
  • DK - Denmark
  • + *
  • DJ - Djibouti
  • + *
  • DM - Dominica
  • + *
  • DO - Dominican Republic
  • + *
  • EC - Ecuador
  • + *
  • EG - Egypt
  • + *
  • SV - El Salvador
  • + *
  • GQ - Equatorial Guinea
  • + *
  • ER - Eritrea
  • + *
  • EE - Estonia
  • + *
  • SZ - Eswatini
  • + *
  • ET - Ethiopia
  • + *
  • FK - Falkland Islands (Malvinas)
  • + *
  • FO - Faroe Islands
  • + *
  • FJ - Fiji
  • + *
  • FI - Finland
  • + *
  • FR - France
  • + *
  • GF - French Guiana
  • + *
  • PF - French Polynesia
  • + *
  • TF - French Southern Territories
  • + *
  • GA - Gabon
  • + *
  • GM - Gambia
  • + *
  • GE - Georgia
  • + *
  • DE - Germany
  • + *
  • GH - Ghana
  • + *
  • GI - Gibraltar
  • + *
  • GR - Greece
  • + *
  • GL - Greenland
  • + *
  • GD - Grenada
  • + *
  • GP - Guadeloupe
  • + *
  • GU - Guam
  • + *
  • GT - Guatemala
  • + *
  • GG - Guernsey
  • + *
  • GN - Guinea
  • + *
  • GW - Guinea-Bissau
  • + *
  • GY - Guyana
  • + *
  • HT - Haiti
  • + *
  • HM - Heard Island and McDonald Islands
  • + *
  • VA - Holy See
  • + *
  • HN - Honduras
  • + *
  • HK - Hong Kong
  • + *
  • HU - Hungary
  • + *
  • IS - Iceland
  • + *
  • IN - India
  • + *
  • ID - Indonesia
  • + *
  • IR - Iran
  • + *
  • IQ - Iraq
  • + *
  • IE - Ireland
  • + *
  • IM - Isle of Man
  • + *
  • IL - Israel
  • + *
  • IT - Italy
  • + *
  • JM - Jamaica
  • + *
  • JP - Japan
  • + *
  • JE - Jersey
  • + *
  • JO - Jordan
  • + *
  • KZ - Kazakhstan
  • + *
  • KE - Kenya
  • + *
  • KI - Kiribati
  • + *
  • KW - Kuwait
  • + *
  • KG - Kyrgyzstan
  • + *
  • LA - Laos
  • + *
  • LV - Latvia
  • + *
  • LB - Lebanon
  • + *
  • LS - Lesotho
  • + *
  • LR - Liberia
  • + *
  • LY - Libya
  • + *
  • LI - Liechtenstein
  • + *
  • LT - Lithuania
  • + *
  • LU - Luxembourg
  • + *
  • MO - Macao
  • + *
  • MG - Madagascar
  • + *
  • MW - Malawi
  • + *
  • MY - Malaysia
  • + *
  • MV - Maldives
  • + *
  • ML - Mali
  • + *
  • MT - Malta
  • + *
  • MH - Marshall Islands
  • + *
  • MQ - Martinique
  • + *
  • MR - Mauritania
  • + *
  • MU - Mauritius
  • + *
  • YT - Mayotte
  • + *
  • MX - Mexico
  • + *
  • FM - Micronesia (Federated States of)
  • + *
  • MD - Moldova
  • + *
  • MC - Monaco
  • + *
  • MN - Mongolia
  • + *
  • ME - Montenegro
  • + *
  • MS - Montserrat
  • + *
  • MA - Morocco
  • + *
  • MZ - Mozambique
  • + *
  • MM - Myanmar
  • + *
  • NA - Namibia
  • + *
  • NR - Nauru
  • + *
  • NP - Nepal
  • + *
  • NL - Netherlands
  • + *
  • NC - New Caledonia
  • + *
  • NZ - New Zealand
  • + *
  • NI - Nicaragua
  • + *
  • NE - Niger
  • + *
  • NG - Nigeria
  • + *
  • NU - Niue
  • + *
  • NF - Norfolk Island
  • + *
  • KP - North Korea
  • + *
  • MK - North Macedonia
  • + *
  • MP - Northern Mariana Islands
  • + *
  • NO - Norway
  • + *
  • OM - Oman
  • + *
  • PK - Pakistan
  • + *
  • PW - Palau
  • + *
  • PS - Palestine, State of
  • + *
  • PA - Panama
  • + *
  • PG - Papua New Guinea
  • + *
  • PY - Paraguay
  • + *
  • PE - Peru
  • + *
  • PH - Philippines
  • + *
  • PN - Pitcairn
  • + *
  • PL - Poland
  • + *
  • PT - Portugal
  • + *
  • PR - Puerto Rico
  • + *
  • QA - Qatar
  • + *
  • RE - Réunion
  • + *
  • RO - Romania
  • + *
  • RU - Russia
  • + *
  • RW - Rwanda
  • + *
  • BL - Saint Barthélemy
  • + *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • + *
  • KN - Saint Kitts and Nevis
  • + *
  • LC - Saint Lucia
  • + *
  • MF - Saint Martin (French part)
  • + *
  • PM - Saint Pierre and Miquelon
  • + *
  • VC - Saint Vincent and the Grenadines
  • + *
  • WS - Samoa
  • + *
  • SM - San Marino
  • + *
  • ST - Sao Tome and Principe
  • + *
  • SA - Saudi Arabia
  • + *
  • SN - Senegal
  • + *
  • RS - Serbia
  • + *
  • SC - Seychelles
  • + *
  • SL - Sierra Leone
  • + *
  • SG - Singapore
  • + *
  • SX - Sint Maarten (Dutch part)
  • + *
  • SK - Slovakia
  • + *
  • SI - Slovenia
  • + *
  • SB - Solomon Islands
  • + *
  • SO - Somalia
  • + *
  • ZA - South Africa
  • + *
  • GS - South Georgia and the South Sandwich Islands
  • + *
  • KR - South Korea
  • + *
  • SS - South Sudan
  • + *
  • ES - Spain
  • + *
  • LK - Sri Lanka
  • + *
  • SD - Sudan
  • + *
  • SR - Suriname
  • + *
  • SJ - Svalbard and Jan Mayen
  • + *
  • SE - Sweden
  • + *
  • CH - Switzerland
  • + *
  • SY - Syria
  • + *
  • TW - Taiwan
  • + *
  • TJ - Tajikistan
  • + *
  • TZ - Tanzania
  • + *
  • TH - Thailand
  • + *
  • TL - Timor-Leste
  • + *
  • TG - Togo
  • + *
  • TK - Tokelau
  • + *
  • TO - Tonga
  • + *
  • TT - Trinidad and Tobago
  • + *
  • TN - Tunisia
  • + *
  • TR - Turkey
  • + *
  • TM - Turkmenistan
  • + *
  • TC - Turks and Caicos Islands
  • + *
  • TV - Tuvalu
  • + *
  • UG - Uganda
  • + *
  • UA - Ukraine
  • + *
  • AE - United Arab Emirates
  • + *
  • GB - United Kingdom
  • + *
  • UM - United States Minor Outlying Islands
  • + *
  • US - United States of America
  • + *
  • UY - Uruguay
  • + *
  • UZ - Uzbekistan
  • + *
  • VU - Vanuatu
  • + *
  • VE - Venezuela
  • + *
  • VN - Vietnam
  • + *
  • VG - Virgin Islands (British)
  • + *
  • VI - Virgin Islands (U.S.)
  • + *
  • WF - Wallis and Futuna
  • + *
  • EH - Western Sahara
  • + *
  • YE - Yemen
  • + *
  • ZM - Zambia
  • + *
  • ZW - Zimbabwe
  • + *
+ */ + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + /** + * @return The address's zip code. + */ + @JsonProperty("zip_code") + public Optional getZipCode() { + return zipCode; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AddressRequest && equalTo((AddressRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AddressRequest other) { + return type.equals(other.type) + && street1.equals(other.street1) + && street2.equals(other.street2) + && city.equals(other.city) + && countrySubdivision.equals(other.countrySubdivision) + && country.equals(other.country) + && zipCode.equals(other.zipCode) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.type, + this.street1, + this.street2, + this.city, + this.countrySubdivision, + this.country, + this.zipCode, + this.integrationParams, + this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional type = Optional.empty(); + + private Optional street1 = Optional.empty(); + + private Optional street2 = Optional.empty(); + + private Optional city = Optional.empty(); + + private Optional countrySubdivision = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional zipCode = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AddressRequest other) { + type(other.getType()); + street1(other.getStreet1()); + street2(other.getStreet2()); + city(other.getCity()); + countrySubdivision(other.getCountrySubdivision()); + country(other.getCountry()); + zipCode(other.getZipCode()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(AddressTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "street_1", nulls = Nulls.SKIP) + public Builder street1(Optional street1) { + this.street1 = street1; + return this; + } + + public Builder street1(String street1) { + this.street1 = Optional.ofNullable(street1); + return this; + } + + @JsonSetter(value = "street_2", nulls = Nulls.SKIP) + public Builder street2(Optional street2) { + this.street2 = street2; + return this; + } + + public Builder street2(String street2) { + this.street2 = Optional.ofNullable(street2); + return this; + } + + @JsonSetter(value = "city", nulls = Nulls.SKIP) + public Builder city(Optional city) { + this.city = city; + return this; + } + + public Builder city(String city) { + this.city = Optional.ofNullable(city); + return this; + } + + @JsonSetter(value = "country_subdivision", nulls = Nulls.SKIP) + public Builder countrySubdivision(Optional countrySubdivision) { + this.countrySubdivision = countrySubdivision; + return this; + } + + public Builder countrySubdivision(String countrySubdivision) { + this.countrySubdivision = Optional.ofNullable(countrySubdivision); + return this; + } + + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(CountryEnum country) { + this.country = Optional.ofNullable(country); + return this; + } + + @JsonSetter(value = "zip_code", nulls = Nulls.SKIP) + public Builder zipCode(Optional zipCode) { + this.zipCode = zipCode; + return this; + } + + public Builder zipCode(String zipCode) { + this.zipCode = Optional.ofNullable(zipCode); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public AddressRequest build() { + return new AddressRequest( + type, + street1, + street2, + city, + countrySubdivision, + country, + zipCode, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AddressTypeEnum.java b/src/main/java/com/merge/api/accounting/types/AddressTypeEnum.java new file mode 100644 index 000000000..b0ab9679e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AddressTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AddressTypeEnum { + BILLING("BILLING"), + + SHIPPING("SHIPPING"); + + private final String value; + + AddressTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/addresses/requests/AddressesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequest.java similarity index 78% rename from src/main/java/com/merge/api/resources/accounting/addresses/requests/AddressesRetrieveRequest.java rename to src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequest.java index 42ed97a10..7de4ccbea 100644 --- a/src/main/java/com/merge/api/resources/accounting/addresses/requests/AddressesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.addresses.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -22,6 +22,8 @@ public final class AddressesRetrieveRequest { private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -30,10 +32,12 @@ public final class AddressesRetrieveRequest { private AddressesRetrieveRequest( Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -47,6 +51,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -76,13 +88,14 @@ public Map getAdditionalProperties() { private boolean equalTo(AddressesRetrieveRequest other) { return includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash(this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -98,6 +111,8 @@ public static Builder builder() { public static final class Builder { private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -109,6 +124,7 @@ private Builder() {} public Builder from(AddressesRetrieveRequest other) { includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; @@ -125,6 +141,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -148,7 +175,8 @@ public Builder showEnumOrigins(String showEnumOrigins) { } public AddressesRetrieveRequest build() { - return new AddressesRetrieveRequest(includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + return new AddressesRetrieveRequest( + includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/accounting/types/AdvancedMetadata.java b/src/main/java/com/merge/api/accounting/types/AdvancedMetadata.java new file mode 100644 index 000000000..710a08449 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/accounting/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..45ef40e5c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/accounting/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..957daa930 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTask.java b/src/main/java/com/merge/api/accounting/types/AsyncPostTask.java similarity index 87% rename from src/main/java/com/merge/api/resources/accounting/types/AsyncPostTask.java rename to src/main/java/com/merge/api/accounting/types/AsyncPostTask.java index ee1917812..110dfc4d7 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTask.java +++ b/src/main/java/com/merge/api/accounting/types/AsyncPostTask.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -19,21 +19,21 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AsyncPostTask.Builder.class) public final class AsyncPostTask { - private final AsyncPostTaskStatus status; + private final AsyncPostTaskStatusEnum status; private final AsyncPostTaskResult result; private final Map additionalProperties; private AsyncPostTask( - AsyncPostTaskStatus status, AsyncPostTaskResult result, Map additionalProperties) { + AsyncPostTaskStatusEnum status, AsyncPostTaskResult result, Map additionalProperties) { this.status = status; this.result = result; this.additionalProperties = additionalProperties; } @JsonProperty("status") - public AsyncPostTaskStatus getStatus() { + public AsyncPostTaskStatusEnum getStatus() { return status; } @@ -72,7 +72,7 @@ public static StatusStage builder() { } public interface StatusStage { - ResultStage status(@NotNull AsyncPostTaskStatus status); + ResultStage status(@NotNull AsyncPostTaskStatusEnum status); Builder from(AsyncPostTask other); } @@ -87,7 +87,7 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements StatusStage, ResultStage, _FinalStage { - private AsyncPostTaskStatus status; + private AsyncPostTaskStatusEnum status; private AsyncPostTaskResult result; @@ -105,7 +105,7 @@ public Builder from(AsyncPostTask other) { @java.lang.Override @JsonSetter("status") - public ResultStage status(@NotNull AsyncPostTaskStatus status) { + public ResultStage status(@NotNull AsyncPostTaskStatusEnum status) { this.status = status; return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskResult.java b/src/main/java/com/merge/api/accounting/types/AsyncPostTaskResult.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskResult.java rename to src/main/java/com/merge/api/accounting/types/AsyncPostTaskResult.java index b3ba60d99..fb54a9c75 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskResult.java +++ b/src/main/java/com/merge/api/accounting/types/AsyncPostTaskResult.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskStatusEnum.java b/src/main/java/com/merge/api/accounting/types/AsyncPostTaskStatusEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskStatusEnum.java rename to src/main/java/com/merge/api/accounting/types/AsyncPostTaskStatusEnum.java index d87b7bad9..10a66d9ed 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskStatusEnum.java +++ b/src/main/java/com/merge/api/accounting/types/AsyncPostTaskStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java b/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java new file mode 100644 index 000000000..29fbf7188 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java @@ -0,0 +1,394 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsListRequest.Builder.class) +public final class AttachmentsListRequest { + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private AttachmentsListRequest( + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return accounting attachments for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsListRequest && equalTo((AttachmentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsListRequest other) { + return companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsListRequest other) { + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public AttachmentsListRequest build() { + return new AttachmentsListRequest( + companyId, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AttachmentsRetrieveRequest.java new file mode 100644 index 000000000..1e9beaae9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AttachmentsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) +public final class AttachmentsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private AttachmentsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsRetrieveRequest && equalTo((AttachmentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public AttachmentsRetrieveRequest build() { + return new AttachmentsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java b/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java new file mode 100644 index 000000000..b058a82bc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java @@ -0,0 +1,449 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final RoleEnum role; + + private final String ipAddress; + + private final EventTypeEnum eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + RoleEnum role, + String ipAddress, + EventTypeEnum eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ */ + @JsonProperty("role") + public RoleEnum getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ */ + @JsonProperty("event_type") + public EventTypeEnum getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + IpAddressStage role(@NotNull RoleEnum role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + EventDescriptionStage eventType(@NotNull EventTypeEnum eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private RoleEnum role; + + private String ipAddress; + + private EventTypeEnum eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

+ *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull RoleEnum role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

Designates the type of event that occurred.

+ *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull EventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The User's email at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

The User's full name at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/accounting/types/AuditTrailListRequest.java new file mode 100644 index 000000000..16ee0ac9a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AuditTrailListRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AvailableActions.java b/src/main/java/com/merge/api/accounting/types/AvailableActions.java new file mode 100644 index 000000000..8d197263a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BalanceSheet.java b/src/main/java/com/merge/api/accounting/types/BalanceSheet.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/BalanceSheet.java rename to src/main/java/com/merge/api/accounting/types/BalanceSheet.java index 34e3ccd9b..bca1270f3 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BalanceSheet.java +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheet.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class BalanceSheet { private final Optional name; - private final Optional currency; + private final Optional currency; private final Optional company; @@ -63,7 +63,7 @@ private BalanceSheet( Optional createdAt, Optional modifiedAt, Optional name, - Optional currency, + Optional currency, Optional company, Optional date, Optional netAssets, @@ -443,7 +443,7 @@ public Optional getName() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -584,7 +584,7 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional company = Optional.empty(); @@ -687,12 +687,12 @@ public Builder name(String name) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(BalanceSheetCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/BalanceSheetCompany.java b/src/main/java/com/merge/api/accounting/types/BalanceSheetCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/BalanceSheetCompany.java rename to src/main/java/com/merge/api/accounting/types/BalanceSheetCompany.java index 3d914eecb..348cfec5b 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BalanceSheetCompany.java +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public BalanceSheetCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public BalanceSheetCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/balancesheets/requests/BalanceSheetsListRequest.java b/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/balancesheets/requests/BalanceSheetsListRequest.java rename to src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java index dc0a835f3..f46c44502 100644 --- a/src/main/java/com/merge/api/resources/accounting/balancesheets/requests/BalanceSheetsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.balancesheets.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BalanceSheetsListRequest.Builder.class) public final class BalanceSheetsListRequest { + private final Optional> expand; + private final Optional companyId; private final Optional createdAfter; @@ -29,8 +33,6 @@ public final class BalanceSheetsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -48,11 +50,11 @@ public final class BalanceSheetsListRequest { private final Map additionalProperties; private BalanceSheetsListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,11 +63,11 @@ private BalanceSheetsListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -76,6 +78,14 @@ private BalanceSheetsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return balance sheets for this company. */ @@ -108,14 +118,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -184,11 +186,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(BalanceSheetsListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -201,11 +203,11 @@ private boolean equalTo(BalanceSheetsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -226,6 +228,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -234,8 +238,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -256,11 +258,11 @@ public static final class Builder { private Builder() {} public Builder from(BalanceSheetsListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -271,6 +273,22 @@ public Builder from(BalanceSheetsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -315,17 +333,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -405,11 +412,11 @@ public Builder remoteId(String remoteId) { public BalanceSheetsListRequest build() { return new BalanceSheetsListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequest.java new file mode 100644 index 000000000..0a709b786 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BalanceSheetsRetrieveRequest.Builder.class) +public final class BalanceSheetsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private BalanceSheetsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BalanceSheetsRetrieveRequest && equalTo((BalanceSheetsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BalanceSheetsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BalanceSheetsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public BalanceSheetsRetrieveRequest build() { + return new BalanceSheetsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccount.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/BankFeedAccount.java rename to src/main/java/com/merge/api/accounting/types/BankFeedAccount.java index 71bab0d50..4c8bf2d8f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccount.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -41,15 +41,15 @@ public final class BankFeedAccount { private final Optional targetAccountName; - private final Optional currency; + private final Optional currency; - private final Optional feedStatus; + private final Optional feedStatus; private final Optional feedStartDate; private final Optional sourceAccountBalance; - private final Optional accountType; + private final Optional accountType; private final Optional remoteWasDeleted; @@ -69,11 +69,11 @@ private BankFeedAccount( Optional sourceAccountName, Optional sourceAccountNumber, Optional targetAccountName, - Optional currency, - Optional feedStatus, + Optional currency, + Optional feedStatus, Optional feedStartDate, Optional sourceAccountBalance, - Optional accountType, + Optional accountType, Optional remoteWasDeleted, Optional> fieldMappings, Optional>>> remoteData, @@ -479,7 +479,7 @@ public Optional getTargetAccountName() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -491,7 +491,7 @@ public Optional getCurrency() { * */ @JsonProperty("feed_status") - public Optional getFeedStatus() { + public Optional getFeedStatus() { return feedStatus; } @@ -519,7 +519,7 @@ public Optional getSourceAccountBalance() { * */ @JsonProperty("account_type") - public Optional getAccountType() { + public Optional getAccountType() { return accountType; } @@ -623,15 +623,15 @@ public static final class Builder { private Optional targetAccountName = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); - private Optional feedStatus = Optional.empty(); + private Optional feedStatus = Optional.empty(); private Optional feedStartDate = Optional.empty(); private Optional sourceAccountBalance = Optional.empty(); - private Optional accountType = Optional.empty(); + private Optional accountType = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -765,23 +765,23 @@ public Builder targetAccountName(String targetAccountName) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(BankFeedAccountCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @JsonSetter(value = "feed_status", nulls = Nulls.SKIP) - public Builder feedStatus(Optional feedStatus) { + public Builder feedStatus(Optional feedStatus) { this.feedStatus = feedStatus; return this; } - public Builder feedStatus(BankFeedAccountFeedStatus feedStatus) { + public Builder feedStatus(FeedStatusEnum feedStatus) { this.feedStatus = Optional.ofNullable(feedStatus); return this; } @@ -809,12 +809,12 @@ public Builder sourceAccountBalance(Double sourceAccountBalance) { } @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { + public Builder accountType(Optional accountType) { this.accountType = accountType; return this; } - public Builder accountType(BankFeedAccountAccountType accountType) { + public Builder accountType(BankFeedAccountAccountTypeEnum accountType) { this.accountType = Optional.ofNullable(accountType); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountAccountTypeEnum.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountAccountTypeEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountAccountTypeEnum.java rename to src/main/java/com/merge/api/accounting/types/BankFeedAccountAccountTypeEnum.java index 2df95f1f2..bbe749b91 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountAccountTypeEnum.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountAccountTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/BankFeedAccountEndpointRequest.java index d14df4727..2c1826c16 100644 --- a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.bankfeedaccounts.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.BankFeedAccountRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequest.java rename to src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java index c11110e34..364f73469 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,15 +32,15 @@ public final class BankFeedAccountRequest { private final Optional targetAccountName; - private final Optional currency; + private final Optional currency; - private final Optional feedStatus; + private final Optional feedStatus; private final Optional feedStartDate; private final Optional sourceAccountBalance; - private final Optional accountType; + private final Optional accountType; private final Optional> integrationParams; @@ -54,11 +54,11 @@ private BankFeedAccountRequest( Optional sourceAccountName, Optional sourceAccountNumber, Optional targetAccountName, - Optional currency, - Optional feedStatus, + Optional currency, + Optional feedStatus, Optional feedStartDate, Optional sourceAccountBalance, - Optional accountType, + Optional accountType, Optional> integrationParams, Optional> linkedAccountParams, Map additionalProperties) { @@ -429,7 +429,7 @@ public Optional getTargetAccountName() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -441,7 +441,7 @@ public Optional getCurrency() { * */ @JsonProperty("feed_status") - public Optional getFeedStatus() { + public Optional getFeedStatus() { return feedStatus; } @@ -469,7 +469,7 @@ public Optional getSourceAccountBalance() { * */ @JsonProperty("account_type") - public Optional getAccountType() { + public Optional getAccountType() { return accountType; } @@ -547,15 +547,15 @@ public static final class Builder { private Optional targetAccountName = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); - private Optional feedStatus = Optional.empty(); + private Optional feedStatus = Optional.empty(); private Optional feedStartDate = Optional.empty(); private Optional sourceAccountBalance = Optional.empty(); - private Optional accountType = Optional.empty(); + private Optional accountType = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -638,23 +638,23 @@ public Builder targetAccountName(String targetAccountName) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(BankFeedAccountRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @JsonSetter(value = "feed_status", nulls = Nulls.SKIP) - public Builder feedStatus(Optional feedStatus) { + public Builder feedStatus(Optional feedStatus) { this.feedStatus = feedStatus; return this; } - public Builder feedStatus(BankFeedAccountRequestFeedStatus feedStatus) { + public Builder feedStatus(FeedStatusEnum feedStatus) { this.feedStatus = Optional.ofNullable(feedStatus); return this; } @@ -682,12 +682,12 @@ public Builder sourceAccountBalance(Double sourceAccountBalance) { } @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { + public Builder accountType(Optional accountType) { this.accountType = accountType; return this; } - public Builder accountType(BankFeedAccountRequestAccountType accountType) { + public Builder accountType(BankFeedAccountAccountTypeEnum accountType) { this.accountType = Optional.ofNullable(accountType); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountResponse.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountResponse.java rename to src/main/java/com/merge/api/accounting/types/BankFeedAccountResponse.java index 6a76a6d2c..82fb8ad13 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountResponse.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsListRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsListRequest.java rename to src/main/java/com/merge/api/accounting/types/BankFeedAccountsListRequest.java index 4087db08f..c3591eab5 100644 --- a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.bankfeedaccounts.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedAccountsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountsRetrieveRequest.java new file mode 100644 index 000000000..88326a7b1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BankFeedAccountsRetrieveRequest.Builder.class) +public final class BankFeedAccountsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private BankFeedAccountsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedAccountsRetrieveRequest && equalTo((BankFeedAccountsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedAccountsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BankFeedAccountsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public BankFeedAccountsRetrieveRequest build() { + return new BankFeedAccountsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransaction.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/BankFeedTransaction.java rename to src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java index fe71aaff7..0b8a64bdd 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransaction.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -43,7 +43,7 @@ public final class BankFeedTransaction { private final Optional payee; - private final Optional creditOrDebit; + private final Optional creditOrDebit; private final Optional sourceTransactionId; @@ -65,7 +65,7 @@ private BankFeedTransaction( Optional description, Optional transactionType, Optional payee, - Optional creditOrDebit, + Optional creditOrDebit, Optional sourceTransactionId, Optional remoteWasDeleted, Optional isProcessed, @@ -181,7 +181,7 @@ public Optional getPayee() { * */ @JsonProperty("credit_or_debit") - public Optional getCreditOrDebit() { + public Optional getCreditOrDebit() { return creditOrDebit; } @@ -291,7 +291,7 @@ public static final class Builder { private Optional payee = Optional.empty(); - private Optional creditOrDebit = Optional.empty(); + private Optional creditOrDebit = Optional.empty(); private Optional sourceTransactionId = Optional.empty(); @@ -445,12 +445,12 @@ public Builder payee(String payee) { } @JsonSetter(value = "credit_or_debit", nulls = Nulls.SKIP) - public Builder creditOrDebit(Optional creditOrDebit) { + public Builder creditOrDebit(Optional creditOrDebit) { this.creditOrDebit = creditOrDebit; return this; } - public Builder creditOrDebit(BankFeedTransactionCreditOrDebit creditOrDebit) { + public Builder creditOrDebit(CreditOrDebitEnum creditOrDebit) { this.creditOrDebit = Optional.ofNullable(creditOrDebit); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionBankFeedAccount.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionBankFeedAccount.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionBankFeedAccount.java rename to src/main/java/com/merge/api/accounting/types/BankFeedTransactionBankFeedAccount.java index 5f86f69cb..6183f3354 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionBankFeedAccount.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionBankFeedAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer payee; - private final Optional creditOrDebit; + private final Optional creditOrDebit; private final Optional sourceTransactionId; @@ -54,7 +54,7 @@ private BankFeedTransactionRequestRequest( Optional description, Optional transactionType, Optional payee, - Optional creditOrDebit, + Optional creditOrDebit, Optional sourceTransactionId, Optional> integrationParams, Optional> linkedAccountParams, @@ -137,7 +137,7 @@ public Optional getPayee() { * */ @JsonProperty("credit_or_debit") - public Optional getCreditOrDebit() { + public Optional getCreditOrDebit() { return creditOrDebit; } @@ -225,7 +225,7 @@ public static final class Builder { private Optional payee = Optional.empty(); - private Optional creditOrDebit = Optional.empty(); + private Optional creditOrDebit = Optional.empty(); private Optional sourceTransactionId = Optional.empty(); @@ -331,12 +331,12 @@ public Builder payee(String payee) { } @JsonSetter(value = "credit_or_debit", nulls = Nulls.SKIP) - public Builder creditOrDebit(Optional creditOrDebit) { + public Builder creditOrDebit(Optional creditOrDebit) { this.creditOrDebit = creditOrDebit; return this; } - public Builder creditOrDebit(BankFeedTransactionRequestRequestCreditOrDebit creditOrDebit) { + public Builder creditOrDebit(CreditOrDebitEnum creditOrDebit) { this.creditOrDebit = Optional.ofNullable(creditOrDebit); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java similarity index 94% rename from src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java rename to src/main/java/com/merge/api/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java index 5e848f268..0f18ad810 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionRequestRequestBankFeedAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,8 +80,8 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -48,10 +50,10 @@ public final class BankFeedTransactionsListRequest { private final Map additionalProperties; private BankFeedTransactionsListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,10 +63,10 @@ private BankFeedTransactionsListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -76,6 +78,14 @@ private BankFeedTransactionsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -100,14 +110,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -184,10 +186,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(BankFeedTransactionsListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -201,10 +203,10 @@ private boolean equalTo(BankFeedTransactionsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -226,14 +228,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -256,10 +258,10 @@ public static final class Builder { private Builder() {} public Builder from(BankFeedTransactionsListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -271,6 +273,22 @@ public Builder from(BankFeedTransactionsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -304,17 +322,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -405,10 +412,10 @@ public Builder remoteId(String remoteId) { public BankFeedTransactionsListRequest build() { return new BankFeedTransactionsListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequest.java new file mode 100644 index 000000000..864cb7fc7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BankFeedTransactionsRetrieveRequest.Builder.class) +public final class BankFeedTransactionsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private BankFeedTransactionsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BankFeedTransactionsRetrieveRequest + && equalTo((BankFeedTransactionsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BankFeedTransactionsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BankFeedTransactionsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public BankFeedTransactionsRetrieveRequest build() { + return new BankFeedTransactionsRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CashFlowStatement.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatement.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/CashFlowStatement.java rename to src/main/java/com/merge/api/accounting/types/CashFlowStatement.java index 506706222..5dc0e02f3 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CashFlowStatement.java +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatement.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class CashFlowStatement { private final Optional name; - private final Optional currency; + private final Optional currency; private final Optional company; @@ -67,7 +67,7 @@ private CashFlowStatement( Optional createdAt, Optional modifiedAt, Optional name, - Optional currency, + Optional currency, Optional company, Optional startPeriod, Optional endPeriod, @@ -451,7 +451,7 @@ public Optional getName() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -612,7 +612,7 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional company = Optional.empty(); @@ -721,12 +721,12 @@ public Builder name(String name) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(CashFlowStatementCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/CashFlowStatementCompany.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatementCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/CashFlowStatementCompany.java rename to src/main/java/com/merge/api/accounting/types/CashFlowStatementCompany.java index 5c0ee3eac..2fd3fc061 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CashFlowStatementCompany.java +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatementCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional companyId; private final Optional createdAfter; @@ -29,8 +33,6 @@ public final class CashFlowStatementsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -48,11 +50,11 @@ public final class CashFlowStatementsListRequest { private final Map additionalProperties; private CashFlowStatementsListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,11 +63,11 @@ private CashFlowStatementsListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -76,6 +78,14 @@ private CashFlowStatementsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return cash flow statements for this company. */ @@ -108,14 +118,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -184,11 +186,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(CashFlowStatementsListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -201,11 +203,11 @@ private boolean equalTo(CashFlowStatementsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -226,6 +228,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -234,8 +238,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -256,11 +258,11 @@ public static final class Builder { private Builder() {} public Builder from(CashFlowStatementsListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -271,6 +273,22 @@ public Builder from(CashFlowStatementsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -315,17 +333,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -405,11 +412,11 @@ public Builder remoteId(String remoteId) { public CashFlowStatementsListRequest build() { return new CashFlowStatementsListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequest.java new file mode 100644 index 000000000..d07f57c16 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequest.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CashFlowStatementsRetrieveRequest.Builder.class) +public final class CashFlowStatementsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private CashFlowStatementsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CashFlowStatementsRetrieveRequest && equalTo((CashFlowStatementsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CashFlowStatementsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CashFlowStatementsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public CashFlowStatementsRetrieveRequest build() { + return new CashFlowStatementsRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CategoriesEnum.java b/src/main/java/com/merge/api/accounting/types/CategoriesEnum.java new file mode 100644 index 000000000..29381dd71 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoriesEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoriesEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CategoryEnum.java b/src/main/java/com/merge/api/accounting/types/CategoryEnum.java new file mode 100644 index 000000000..84f25e4ef --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoryEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CategoryTypeEnum.java b/src/main/java/com/merge/api/accounting/types/CategoryTypeEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/CategoryTypeEnum.java rename to src/main/java/com/merge/api/accounting/types/CategoryTypeEnum.java index 6092f9dc9..1f59b9f04 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CategoryTypeEnum.java +++ b/src/main/java/com/merge/api/accounting/types/CategoryTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/types/ClassificationEnum.java b/src/main/java/com/merge/api/accounting/types/ClassificationEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/accounting/types/ClassificationEnum.java rename to src/main/java/com/merge/api/accounting/types/ClassificationEnum.java index a522ff5a2..f36992029 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ClassificationEnum.java +++ b/src/main/java/com/merge/api/accounting/types/ClassificationEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/accounting/types/CommonModelScopeApi.java new file mode 100644 index 000000000..94aaac58f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CommonModelScopeApi.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/accounting/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..deace2ea7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CompanyInfo.java b/src/main/java/com/merge/api/accounting/types/CompanyInfo.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/CompanyInfo.java rename to src/main/java/com/merge/api/accounting/types/CompanyInfo.java index 5f5c8467a..1c85dca4d 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CompanyInfo.java +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfo.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -41,7 +41,7 @@ public final class CompanyInfo { private final Optional fiscalYearEndDay; - private final Optional currency; + private final Optional currency; private final Optional remoteCreatedAt; @@ -69,7 +69,7 @@ private CompanyInfo( Optional taxNumber, Optional fiscalYearEndMonth, Optional fiscalYearEndDay, - Optional currency, + Optional currency, Optional remoteCreatedAt, Optional>> urls, Optional> addresses, @@ -479,7 +479,7 @@ public Optional getFiscalYearEndDay() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -609,7 +609,7 @@ public static final class Builder { private Optional fiscalYearEndDay = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional remoteCreatedAt = Optional.empty(); @@ -751,12 +751,12 @@ public Builder fiscalYearEndDay(Integer fiscalYearEndDay) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(CompanyInfoCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/companyinfo/requests/CompanyInfoListRequest.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java similarity index 93% rename from src/main/java/com/merge/api/resources/accounting/companyinfo/requests/CompanyInfoListRequest.java rename to src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java index dded57e3a..a0eb02b5a 100644 --- a/src/main/java/com/merge/api/resources/accounting/companyinfo/requests/CompanyInfoListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.companyinfo.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.companyinfo.types.CompanyInfoListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CompanyInfoListRequest.Builder.class) public final class CompanyInfoListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -47,10 +48,10 @@ public final class CompanyInfoListRequest { private final Map additionalProperties; private CompanyInfoListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -59,10 +60,10 @@ private CompanyInfoListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -73,6 +74,14 @@ private CompanyInfoListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -97,14 +106,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -173,10 +174,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(CompanyInfoListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -189,10 +190,10 @@ private boolean equalTo(CompanyInfoListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -213,14 +214,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -241,10 +242,10 @@ public static final class Builder { private Builder() {} public Builder from(CompanyInfoListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -255,6 +256,22 @@ public Builder from(CompanyInfoListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CompanyInfoListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -288,17 +305,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CompanyInfoListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -378,10 +384,10 @@ public Builder remoteId(String remoteId) { public CompanyInfoListRequest build() { return new CompanyInfoListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequestExpandItem.java new file mode 100644 index 000000000..4e4ea4cd1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CompanyInfoListRequestExpandItem { + ADDRESSES("addresses"), + + PHONE_NUMBERS("phone_numbers"); + + private final String value; + + CompanyInfoListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfoRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoRetrieveRequest.java new file mode 100644 index 000000000..8fc1e5972 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CompanyInfoRetrieveRequest.Builder.class) +public final class CompanyInfoRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private CompanyInfoRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyInfoRetrieveRequest && equalTo((CompanyInfoRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompanyInfoRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CompanyInfoRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CompanyInfoRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public CompanyInfoRetrieveRequest build() { + return new CompanyInfoRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfoRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoRetrieveRequestExpandItem.java new file mode 100644 index 000000000..7cf0c2ebe --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CompanyInfoRetrieveRequestExpandItem { + ADDRESSES("addresses"), + + PHONE_NUMBERS("phone_numbers"); + + private final String value; + + CompanyInfoRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ComponentTypeEnum.java b/src/main/java/com/merge/api/accounting/types/ComponentTypeEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/ComponentTypeEnum.java rename to src/main/java/com/merge/api/accounting/types/ComponentTypeEnum.java index 481ba82c6..53a7fc22e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ComponentTypeEnum.java +++ b/src/main/java/com/merge/api/accounting/types/ComponentTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/Contact.java b/src/main/java/com/merge/api/accounting/types/Contact.java new file mode 100644 index 000000000..15c42ba4e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/Contact.java @@ -0,0 +1,620 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Contact.Builder.class) +public final class Contact { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional isSupplier; + + private final Optional isCustomer; + + private final Optional emailAddress; + + private final Optional taxNumber; + + private final Optional status; + + private final Optional currency; + + private final Optional remoteUpdatedAt; + + private final Optional company; + + private final Optional>> addresses; + + private final Optional> phoneNumbers; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Contact( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional isSupplier, + Optional isCustomer, + Optional emailAddress, + Optional taxNumber, + Optional status, + Optional currency, + Optional remoteUpdatedAt, + Optional company, + Optional>> addresses, + Optional> phoneNumbers, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.isSupplier = isSupplier; + this.isCustomer = isCustomer; + this.emailAddress = emailAddress; + this.taxNumber = taxNumber; + this.status = status; + this.currency = currency; + this.remoteUpdatedAt = remoteUpdatedAt; + this.company = company; + this.addresses = addresses; + this.phoneNumbers = phoneNumbers; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The contact's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the contact is a supplier. + */ + @JsonProperty("is_supplier") + public Optional getIsSupplier() { + return isSupplier; + } + + /** + * @return Whether the contact is a customer. + */ + @JsonProperty("is_customer") + public Optional getIsCustomer() { + return isCustomer; + } + + /** + * @return The contact's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The contact's tax number. + */ + @JsonProperty("tax_number") + public Optional getTaxNumber() { + return taxNumber; + } + + /** + * @return The contact's status + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • ARCHIVED - ARCHIVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The currency the contact's transactions are in. + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return When the third party's contact was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return The company the contact belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return Address object IDs for the given Contacts object. + */ + @JsonProperty("addresses") + public Optional>> getAddresses() { + return addresses; + } + + /** + * @return AccountingPhoneNumber object for the given Contacts object. + */ + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Contact && equalTo((Contact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Contact other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && isSupplier.equals(other.isSupplier) + && isCustomer.equals(other.isCustomer) + && emailAddress.equals(other.emailAddress) + && taxNumber.equals(other.taxNumber) + && status.equals(other.status) + && currency.equals(other.currency) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && company.equals(other.company) + && addresses.equals(other.addresses) + && phoneNumbers.equals(other.phoneNumbers) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.isSupplier, + this.isCustomer, + this.emailAddress, + this.taxNumber, + this.status, + this.currency, + this.remoteUpdatedAt, + this.company, + this.addresses, + this.phoneNumbers, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional isSupplier = Optional.empty(); + + private Optional isCustomer = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional taxNumber = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional>> addresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Contact other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + isSupplier(other.getIsSupplier()); + isCustomer(other.getIsCustomer()); + emailAddress(other.getEmailAddress()); + taxNumber(other.getTaxNumber()); + status(other.getStatus()); + currency(other.getCurrency()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + company(other.getCompany()); + addresses(other.getAddresses()); + phoneNumbers(other.getPhoneNumbers()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "is_supplier", nulls = Nulls.SKIP) + public Builder isSupplier(Optional isSupplier) { + this.isSupplier = isSupplier; + return this; + } + + public Builder isSupplier(Boolean isSupplier) { + this.isSupplier = Optional.ofNullable(isSupplier); + return this; + } + + @JsonSetter(value = "is_customer", nulls = Nulls.SKIP) + public Builder isCustomer(Optional isCustomer) { + this.isCustomer = isCustomer; + return this; + } + + public Builder isCustomer(Boolean isCustomer) { + this.isCustomer = Optional.ofNullable(isCustomer); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "tax_number", nulls = Nulls.SKIP) + public Builder taxNumber(Optional taxNumber) { + this.taxNumber = taxNumber; + return this; + } + + public Builder taxNumber(String taxNumber) { + this.taxNumber = Optional.ofNullable(taxNumber); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(Status7D1Enum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(String currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(String company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) + public Builder addresses(Optional>> addresses) { + this.addresses = addresses; + return this; + } + + public Builder addresses(List> addresses) { + this.addresses = Optional.ofNullable(addresses); + return this; + } + + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) + public Builder phoneNumbers(Optional> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder phoneNumbers(List phoneNumbers) { + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public Contact build() { + return new Contact( + id, + remoteId, + createdAt, + modifiedAt, + name, + isSupplier, + isCustomer, + emailAddress, + taxNumber, + status, + currency, + remoteUpdatedAt, + company, + addresses, + phoneNumbers, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ContactAddressesItem.java b/src/main/java/com/merge/api/accounting/types/ContactAddressesItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ContactAddressesItem.java rename to src/main/java/com/merge/api/accounting/types/ContactAddressesItem.java index 61b65a1c3..e3caa27ed 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ContactAddressesItem.java +++ b/src/main/java/com/merge/api/accounting/types/ContactAddressesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ContactAddressesItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ContactAddressesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/ContactEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/ContactEndpointRequest.java index a86c0b627..d88cc0610 100644 --- a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.contacts.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.ContactRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/accounting/types/ContactRequest.java b/src/main/java/com/merge/api/accounting/types/ContactRequest.java new file mode 100644 index 000000000..568fb1bbb --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactRequest.java @@ -0,0 +1,448 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactRequest.Builder.class) +public final class ContactRequest { + private final Optional name; + + private final Optional isSupplier; + + private final Optional isCustomer; + + private final Optional emailAddress; + + private final Optional taxNumber; + + private final Optional status; + + private final Optional currency; + + private final Optional company; + + private final Optional>> addresses; + + private final Optional> phoneNumbers; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ContactRequest( + Optional name, + Optional isSupplier, + Optional isCustomer, + Optional emailAddress, + Optional taxNumber, + Optional status, + Optional currency, + Optional company, + Optional>> addresses, + Optional> phoneNumbers, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.name = name; + this.isSupplier = isSupplier; + this.isCustomer = isCustomer; + this.emailAddress = emailAddress; + this.taxNumber = taxNumber; + this.status = status; + this.currency = currency; + this.company = company; + this.addresses = addresses; + this.phoneNumbers = phoneNumbers; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The contact's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the contact is a supplier. + */ + @JsonProperty("is_supplier") + public Optional getIsSupplier() { + return isSupplier; + } + + /** + * @return Whether the contact is a customer. + */ + @JsonProperty("is_customer") + public Optional getIsCustomer() { + return isCustomer; + } + + /** + * @return The contact's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The contact's tax number. + */ + @JsonProperty("tax_number") + public Optional getTaxNumber() { + return taxNumber; + } + + /** + * @return The contact's status + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • ARCHIVED - ARCHIVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The currency the contact's transactions are in. + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return The company the contact belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return Address object IDs for the given Contacts object. + */ + @JsonProperty("addresses") + public Optional>> getAddresses() { + return addresses; + } + + /** + * @return AccountingPhoneNumber object for the given Contacts object. + */ + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequest && equalTo((ContactRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactRequest other) { + return name.equals(other.name) + && isSupplier.equals(other.isSupplier) + && isCustomer.equals(other.isCustomer) + && emailAddress.equals(other.emailAddress) + && taxNumber.equals(other.taxNumber) + && status.equals(other.status) + && currency.equals(other.currency) + && company.equals(other.company) + && addresses.equals(other.addresses) + && phoneNumbers.equals(other.phoneNumbers) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.isSupplier, + this.isCustomer, + this.emailAddress, + this.taxNumber, + this.status, + this.currency, + this.company, + this.addresses, + this.phoneNumbers, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional isSupplier = Optional.empty(); + + private Optional isCustomer = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional taxNumber = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional>> addresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactRequest other) { + name(other.getName()); + isSupplier(other.getIsSupplier()); + isCustomer(other.getIsCustomer()); + emailAddress(other.getEmailAddress()); + taxNumber(other.getTaxNumber()); + status(other.getStatus()); + currency(other.getCurrency()); + company(other.getCompany()); + addresses(other.getAddresses()); + phoneNumbers(other.getPhoneNumbers()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "is_supplier", nulls = Nulls.SKIP) + public Builder isSupplier(Optional isSupplier) { + this.isSupplier = isSupplier; + return this; + } + + public Builder isSupplier(Boolean isSupplier) { + this.isSupplier = Optional.ofNullable(isSupplier); + return this; + } + + @JsonSetter(value = "is_customer", nulls = Nulls.SKIP) + public Builder isCustomer(Optional isCustomer) { + this.isCustomer = isCustomer; + return this; + } + + public Builder isCustomer(Boolean isCustomer) { + this.isCustomer = Optional.ofNullable(isCustomer); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "tax_number", nulls = Nulls.SKIP) + public Builder taxNumber(Optional taxNumber) { + this.taxNumber = taxNumber; + return this; + } + + public Builder taxNumber(String taxNumber) { + this.taxNumber = Optional.ofNullable(taxNumber); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(Status7D1Enum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(String currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(String company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) + public Builder addresses(Optional>> addresses) { + this.addresses = addresses; + return this; + } + + public Builder addresses(List> addresses) { + this.addresses = Optional.ofNullable(addresses); + return this; + } + + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) + public Builder phoneNumbers(Optional> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder phoneNumbers(List phoneNumbers) { + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ContactRequest build() { + return new ContactRequest( + name, + isSupplier, + isCustomer, + emailAddress, + taxNumber, + status, + currency, + company, + addresses, + phoneNumbers, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ContactRequestAddressesItem.java b/src/main/java/com/merge/api/accounting/types/ContactRequestAddressesItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ContactRequestAddressesItem.java rename to src/main/java/com/merge/api/accounting/types/ContactRequestAddressesItem.java index 3fa0d8882..0e600d44d 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ContactRequestAddressesItem.java +++ b/src/main/java/com/merge/api/accounting/types/ContactRequestAddressesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer> expand; + + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional emailAddress; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional isCustomer; + + private final Optional isSupplier; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional name; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Optional status; + + private final Map additionalProperties; + + private ContactsListRequest( + Optional> expand, + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional emailAddress, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional isCustomer, + Optional isSupplier, + Optional modifiedAfter, + Optional modifiedBefore, + Optional name, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Optional status, + Map additionalProperties) { + this.expand = expand; + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.emailAddress = emailAddress; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.isCustomer = isCustomer; + this.isSupplier = isSupplier; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.name = name; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return contacts for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return Contacts that match this email. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return Contacts that are denoted as customers. + */ + @JsonProperty("is_customer") + public Optional getIsCustomer() { + return isCustomer; + } + + /** + * @return If provided, will only return Contacts that are denoted as suppliers. + */ + @JsonProperty("is_supplier") + public Optional getIsSupplier() { + return isSupplier; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return If provided, will only return Contacts that match this name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + /** + * @return If provided, will only return Contacts that match this status. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsListRequest && equalTo((ContactsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsListRequest other) { + return expand.equals(other.expand) + && companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && emailAddress.equals(other.emailAddress) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && isCustomer.equals(other.isCustomer) + && isSupplier.equals(other.isSupplier) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.emailAddress, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCustomer, + this.isSupplier, + this.modifiedAfter, + this.modifiedBefore, + this.name, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCustomer = Optional.empty(); + + private Optional isSupplier = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsListRequest other) { + expand(other.getExpand()); + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + emailAddress(other.getEmailAddress()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + isCustomer(other.getIsCustomer()); + isSupplier(other.getIsSupplier()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + name(other.getName()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ContactsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "is_customer", nulls = Nulls.SKIP) + public Builder isCustomer(Optional isCustomer) { + this.isCustomer = isCustomer; + return this; + } + + public Builder isCustomer(String isCustomer) { + this.isCustomer = Optional.ofNullable(isCustomer); + return this; + } + + @JsonSetter(value = "is_supplier", nulls = Nulls.SKIP) + public Builder isSupplier(Optional isSupplier) { + this.isSupplier = isSupplier; + return this; + } + + public Builder isSupplier(String isSupplier) { + this.isSupplier = Optional.ofNullable(isSupplier); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public ContactsListRequest build() { + return new ContactsListRequest( + expand, + companyId, + createdAfter, + createdBefore, + cursor, + emailAddress, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCustomer, + isSupplier, + modifiedAfter, + modifiedBefore, + name, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ContactsListRequestExpandItem.java new file mode 100644 index 000000000..b70df6171 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ContactsListRequestExpandItem { + ADDRESSES("addresses"), + + COMPANY("company"), + + PHONE_NUMBERS("phone_numbers"); + + private final String value; + + ContactsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..2f98b6c1b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java @@ -0,0 +1,249 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsRemoteFieldClassesListRequest.Builder.class) +public final class ContactsRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ContactsRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonModelField, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsRemoteFieldClassesListRequest + && equalTo((ContactsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ContactsRemoteFieldClassesListRequest build() { + return new ContactsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequest.java new file mode 100644 index 000000000..74cfa0926 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequest.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsRetrieveRequest.Builder.class) +public final class ContactsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private ContactsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsRetrieveRequest && equalTo((ContactsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ContactsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public ContactsRetrieveRequest build() { + return new ContactsRetrieveRequest( + expand, + includeRemoteData, + includeRemoteFields, + includeShellData, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..24f98dce9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ContactsRetrieveRequestExpandItem { + ADDRESSES("addresses"), + + COMPANY("company"), + + PHONE_NUMBERS("phone_numbers"); + + private final String value; + + ContactsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CountryEnum.java b/src/main/java/com/merge/api/accounting/types/CountryEnum.java new file mode 100644 index 000000000..b7949de73 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CountryEnum.java @@ -0,0 +1,518 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CountryEnum { + AF("AF"), + + AX("AX"), + + AL("AL"), + + DZ("DZ"), + + AS("AS"), + + AD("AD"), + + AO("AO"), + + AI("AI"), + + AQ("AQ"), + + AG("AG"), + + AR("AR"), + + AM("AM"), + + AW("AW"), + + AU("AU"), + + AT("AT"), + + AZ("AZ"), + + BS("BS"), + + BH("BH"), + + BD("BD"), + + BB("BB"), + + BY("BY"), + + BE("BE"), + + BZ("BZ"), + + BJ("BJ"), + + BM("BM"), + + BT("BT"), + + BO("BO"), + + BQ("BQ"), + + BA("BA"), + + BW("BW"), + + BV("BV"), + + BR("BR"), + + IO("IO"), + + BN("BN"), + + BG("BG"), + + BF("BF"), + + BI("BI"), + + CV("CV"), + + KH("KH"), + + CM("CM"), + + CA("CA"), + + KY("KY"), + + CF("CF"), + + TD("TD"), + + CL("CL"), + + CN("CN"), + + CX("CX"), + + CC("CC"), + + CO("CO"), + + KM("KM"), + + CG("CG"), + + CD("CD"), + + CK("CK"), + + CR("CR"), + + CI("CI"), + + HR("HR"), + + CU("CU"), + + CW("CW"), + + CY("CY"), + + CZ("CZ"), + + DK("DK"), + + DJ("DJ"), + + DM("DM"), + + DO("DO"), + + EC("EC"), + + EG("EG"), + + SV("SV"), + + GQ("GQ"), + + ER("ER"), + + EE("EE"), + + SZ("SZ"), + + ET("ET"), + + FK("FK"), + + FO("FO"), + + FJ("FJ"), + + FI("FI"), + + FR("FR"), + + GF("GF"), + + PF("PF"), + + TF("TF"), + + GA("GA"), + + GM("GM"), + + GE("GE"), + + DE("DE"), + + GH("GH"), + + GI("GI"), + + GR("GR"), + + GL("GL"), + + GD("GD"), + + GP("GP"), + + GU("GU"), + + GT("GT"), + + GG("GG"), + + GN("GN"), + + GW("GW"), + + GY("GY"), + + HT("HT"), + + HM("HM"), + + VA("VA"), + + HN("HN"), + + HK("HK"), + + HU("HU"), + + IS("IS"), + + IN("IN"), + + ID("ID"), + + IR("IR"), + + IQ("IQ"), + + IE("IE"), + + IM("IM"), + + IL("IL"), + + IT("IT"), + + JM("JM"), + + JP("JP"), + + JE("JE"), + + JO("JO"), + + KZ("KZ"), + + KE("KE"), + + KI("KI"), + + KW("KW"), + + KG("KG"), + + LA("LA"), + + LV("LV"), + + LB("LB"), + + LS("LS"), + + LR("LR"), + + LY("LY"), + + LI("LI"), + + LT("LT"), + + LU("LU"), + + MO("MO"), + + MG("MG"), + + MW("MW"), + + MY("MY"), + + MV("MV"), + + ML("ML"), + + MT("MT"), + + MH("MH"), + + MQ("MQ"), + + MR("MR"), + + MU("MU"), + + YT("YT"), + + MX("MX"), + + FM("FM"), + + MD("MD"), + + MC("MC"), + + MN("MN"), + + ME("ME"), + + MS("MS"), + + MA("MA"), + + MZ("MZ"), + + MM("MM"), + + NA("NA"), + + NR("NR"), + + NP("NP"), + + NL("NL"), + + NC("NC"), + + NZ("NZ"), + + NI("NI"), + + NE("NE"), + + NG("NG"), + + NU("NU"), + + NF("NF"), + + KP("KP"), + + MK("MK"), + + MP("MP"), + + NO("NO"), + + OM("OM"), + + PK("PK"), + + PW("PW"), + + PS("PS"), + + PA("PA"), + + PG("PG"), + + PY("PY"), + + PE("PE"), + + PH("PH"), + + PN("PN"), + + PL("PL"), + + PT("PT"), + + PR("PR"), + + QA("QA"), + + RE("RE"), + + RO("RO"), + + RU("RU"), + + RW("RW"), + + BL("BL"), + + SH("SH"), + + KN("KN"), + + LC("LC"), + + MF("MF"), + + PM("PM"), + + VC("VC"), + + WS("WS"), + + SM("SM"), + + ST("ST"), + + SA("SA"), + + SN("SN"), + + RS("RS"), + + SC("SC"), + + SL("SL"), + + SG("SG"), + + SX("SX"), + + SK("SK"), + + SI("SI"), + + SB("SB"), + + SO("SO"), + + ZA("ZA"), + + GS("GS"), + + KR("KR"), + + SS("SS"), + + ES("ES"), + + LK("LK"), + + SD("SD"), + + SR("SR"), + + SJ("SJ"), + + SE("SE"), + + CH("CH"), + + SY("SY"), + + TW("TW"), + + TJ("TJ"), + + TZ("TZ"), + + TH("TH"), + + TL("TL"), + + TG("TG"), + + TK("TK"), + + TO("TO"), + + TT("TT"), + + TN("TN"), + + TR("TR"), + + TM("TM"), + + TC("TC"), + + TV("TV"), + + UG("UG"), + + UA("UA"), + + AE("AE"), + + GB("GB"), + + UM("UM"), + + US("US"), + + UY("UY"), + + UZ("UZ"), + + VU("VU"), + + VE("VE"), + + VN("VN"), + + VG("VG"), + + VI("VI"), + + WF("WF"), + + EH("EH"), + + YE("YE"), + + ZM("ZM"), + + ZW("ZW"); + + private final String value; + + CountryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/accounting/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..0dfd29e64 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CreateFieldMappingRequest.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final String targetFieldName; + + private final String targetFieldDescription; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + String targetFieldName, + String targetFieldDescription, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return The name of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_name") + public String getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_description") + public String getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TargetFieldNameStage builder() { + return new Builder(); + } + + public interface TargetFieldNameStage { + TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); + + Builder from(CreateFieldMappingRequest other); + } + + public interface TargetFieldDescriptionStage { + RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); + } + + public interface RemoteMethodStage { + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + } + + public interface RemoteUrlPathStage { + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TargetFieldNameStage, + TargetFieldDescriptionStage, + RemoteMethodStage, + RemoteUrlPathStage, + CommonModelNameStage, + _FinalStage { + private String targetFieldName; + + private String targetFieldDescription; + + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + return this; + } + + /** + *

The name of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_name") + public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

The description of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_description") + public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

The method of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

The path of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

The name of the Common Model that the remote field corresponds to in a given category.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNote.java b/src/main/java/com/merge/api/accounting/types/CreditNote.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNote.java rename to src/main/java/com/merge/api/accounting/types/CreditNote.java index 4666752e4..1a304dc7f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNote.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNote.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class CreditNote { private final Optional transactionDate; - private final Optional status; + private final Optional status; private final Optional number; @@ -53,7 +53,7 @@ public final class CreditNote { private final Optional>> trackingCategories; - private final Optional currency; + private final Optional currency; private final Optional remoteCreatedAt; @@ -81,7 +81,7 @@ private CreditNote( Optional createdAt, Optional modifiedAt, Optional transactionDate, - Optional status, + Optional status, Optional number, Optional contact, Optional company, @@ -91,7 +91,7 @@ private CreditNote( Optional inclusiveOfTax, Optional> lineItems, Optional>> trackingCategories, - Optional currency, + Optional currency, Optional remoteCreatedAt, Optional remoteUpdatedAt, Optional>> payments, @@ -176,7 +176,7 @@ public Optional getTransactionDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -558,7 +558,7 @@ public Optional>> getTrackingCat * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -718,7 +718,7 @@ public static final class Builder { private Optional transactionDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional number = Optional.empty(); @@ -738,7 +738,7 @@ public static final class Builder { private Optional>> trackingCategories = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional remoteCreatedAt = Optional.empty(); @@ -848,12 +848,12 @@ public Builder transactionDate(OffsetDateTime transactionDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(CreditNoteStatus status) { + public Builder status(CreditNoteStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -959,12 +959,12 @@ public Builder trackingCategories(List currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(CreditNoteCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/CreditNoteAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteAccountingPeriod.java index 7119b7f59..9513abe54 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CreditNoteCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CreditNoteCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteContact.java b/src/main/java/com/merge/api/accounting/types/CreditNoteContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteContact.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteContact.java index 4d245b9a0..0f278d5d0 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteContact.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CreditNoteContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CreditNoteContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/requests/CreditNoteEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNoteEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/creditnotes/requests/CreditNoteEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteEndpointRequest.java index c1d7c2879..f7e405ca6 100644 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/requests/CreditNoteEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.creditnotes.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.CreditNoteRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItem.java b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItem.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItem.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteLineItem.java index f901f7d29..285a81daa 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemCompany.java b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemCompany.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteLineItemCompany.java index cf69565e5..9a9945efe 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemCompany.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public CreditNoteLineItemItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CreditNoteLineItemItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemRequest.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequest.java index a8fe33a81..d5b61b15a 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemRequestCompany.java b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequestCompany.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemRequestCompany.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequestCompany.java index 5142fcf9c..1ef25e3e7 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteLineItemRequestCompany.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequestCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public CreditNotePaymentsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CreditNotePaymentsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNoteRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequest.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteRequest.java index 2d5767360..45ea67f1d 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -25,7 +25,7 @@ public final class CreditNoteRequest { private final Optional transactionDate; - private final Optional status; + private final Optional status; private final Optional number; @@ -45,7 +45,7 @@ public final class CreditNoteRequest { private final Optional>> trackingCategories; - private final Optional currency; + private final Optional currency; private final Optional>> payments; @@ -63,7 +63,7 @@ public final class CreditNoteRequest { private CreditNoteRequest( Optional transactionDate, - Optional status, + Optional status, Optional number, Optional contact, Optional company, @@ -73,7 +73,7 @@ private CreditNoteRequest( Optional inclusiveOfTax, Optional> lineItems, Optional>> trackingCategories, - Optional currency, + Optional currency, Optional>> payments, Optional>> appliedPayments, Optional accountingPeriod, @@ -119,7 +119,7 @@ public Optional getTransactionDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -501,7 +501,7 @@ public Optional>> getTrac * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -615,7 +615,7 @@ public static Builder builder() { public static final class Builder { private Optional transactionDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional number = Optional.empty(); @@ -635,7 +635,7 @@ public static final class Builder { private Optional>> trackingCategories = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional>> payments = Optional.empty(); @@ -688,12 +688,12 @@ public Builder transactionDate(OffsetDateTime transactionDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(CreditNoteRequestStatus status) { + public Builder status(CreditNoteStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -799,12 +799,12 @@ public Builder trackingCategories(List currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(CreditNoteRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/CreditNoteRequestAccountingPeriod.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/CreditNoteRequestAccountingPeriod.java index 4d9b61fc3..b1ab71bd2 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteRequestAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional companyId; private final Optional createdAfter; @@ -32,8 +33,6 @@ public final class CreditNotesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,11 +58,11 @@ public final class CreditNotesListRequest { private final Map additionalProperties; private CreditNotesListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -76,11 +75,11 @@ private CreditNotesListRequest( Optional transactionDateAfter, Optional transactionDateBefore, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -95,6 +94,14 @@ private CreditNotesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return credit notes for this company. */ @@ -127,14 +134,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -235,11 +234,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreditNotesListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -256,11 +255,11 @@ private boolean equalTo(CreditNotesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -285,6 +284,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -293,8 +294,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -323,11 +322,11 @@ public static final class Builder { private Builder() {} public Builder from(CreditNotesListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -342,6 +341,22 @@ public Builder from(CreditNotesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CreditNotesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -386,17 +401,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CreditNotesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -520,11 +524,11 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { public CreditNotesListRequest build() { return new CreditNotesListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/CreditNotesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequestExpandItem.java new file mode 100644 index 000000000..a2313193e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequestExpandItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditNotesListRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_PAYMENTS("applied_payments"), + + COMPANY("company"), + + CONTACT("contact"), + + LINE_ITEMS("line_items"), + + PAYMENTS("payments"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + CreditNotesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequestRemoteFields.java similarity index 88% rename from src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestRemoteFields.java rename to src/main/java/com/merge/api/accounting/types/CreditNotesListRequestRemoteFields.java index 41d3c6365..c37523f8a 100644 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.creditnotes.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequestShowEnumOrigins.java similarity index 88% rename from src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/accounting/types/CreditNotesListRequestShowEnumOrigins.java index 3868fee91..0e22db305 100644 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.creditnotes.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequest.java new file mode 100644 index 000000000..ffecba3e3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreditNotesRetrieveRequest.Builder.class) +public final class CreditNotesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private CreditNotesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNotesRetrieveRequest && equalTo((CreditNotesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreditNotesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreditNotesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CreditNotesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(CreditNotesRetrieveRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(CreditNotesRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public CreditNotesRetrieveRequest build() { + return new CreditNotesRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..b52b64386 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestExpandItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CreditNotesRetrieveRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_PAYMENTS("applied_payments"), + + COMPANY("company"), + + CONTACT("contact"), + + LINE_ITEMS("line_items"), + + PAYMENTS("payments"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + CreditNotesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestRemoteFields.java similarity index 88% rename from src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestRemoteFields.java index 40c38066a..85e8152f6 100644 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.creditnotes.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestShowEnumOrigins.java similarity index 88% rename from src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestShowEnumOrigins.java index c078a87f2..d81e01a18 100644 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.creditnotes.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditOrDebitEnum.java b/src/main/java/com/merge/api/accounting/types/CreditOrDebitEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/CreditOrDebitEnum.java rename to src/main/java/com/merge/api/accounting/types/CreditOrDebitEnum.java index f8284239d..525c1eebb 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditOrDebitEnum.java +++ b/src/main/java/com/merge/api/accounting/types/CreditOrDebitEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/accounting/types/DataPassthroughRequest.java new file mode 100644 index 000000000..05b1d0ecb --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/DataPassthroughRequest.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final MethodEnum method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + MethodEnum method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public MethodEnum getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull MethodEnum method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + _FinalStage data(Optional data); + + _FinalStage data(String data); + + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(RequestFormatEnum requestFormat); + + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private MethodEnum method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull MethodEnum method) { + this.method = method; + return this; + } + + /** + *

The path of the request in the third party's platform.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

The data with the request. You must include a request_format parameter matching the data's format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

An optional override of the third party's base url for the request.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/DebugModeLog.java b/src/main/java/com/merge/api/accounting/types/DebugModeLog.java new file mode 100644 index 000000000..42b4ef7c9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/accounting/types/DebugModelLogSummary.java new file mode 100644 index 000000000..5ad273e26 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/Employee.java b/src/main/java/com/merge/api/accounting/types/Employee.java new file mode 100644 index 000000000..441ff987e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/Employee.java @@ -0,0 +1,613 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Employee.Builder.class) +public final class Employee { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional firstName; + + private final Optional lastName; + + private final Optional isContractor; + + private final Optional employeeNumber; + + private final Optional emailAddress; + + private final Optional company; + + private final Status895Enum status; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Employee( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional firstName, + Optional lastName, + Optional isContractor, + Optional employeeNumber, + Optional emailAddress, + Optional company, + Status895Enum status, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.firstName = firstName; + this.lastName = lastName; + this.isContractor = isContractor; + this.employeeNumber = employeeNumber; + this.emailAddress = emailAddress; + this.company = company; + this.status = status; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The employee's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The employee's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return True if the employee is a contractor, False if not. + */ + @JsonProperty("is_contractor") + public Optional getIsContractor() { + return isContractor; + } + + /** + * @return The employee's internal identification number. + */ + @JsonProperty("employee_number") + public Optional getEmployeeNumber() { + return employeeNumber; + } + + /** + * @return The employee's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The subsidiary that the employee belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The employee's status in the accounting system. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • INACTIVE - INACTIVE
  • + *
+ */ + @JsonProperty("status") + public Status895Enum getStatus() { + return status; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Employee && equalTo((Employee) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Employee other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && isContractor.equals(other.isContractor) + && employeeNumber.equals(other.employeeNumber) + && emailAddress.equals(other.emailAddress) + && company.equals(other.company) + && status.equals(other.status) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.firstName, + this.lastName, + this.isContractor, + this.employeeNumber, + this.emailAddress, + this.company, + this.status, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static StatusStage builder() { + return new Builder(); + } + + public interface StatusStage { + _FinalStage status(@NotNull Status895Enum status); + + Builder from(Employee other); + } + + public interface _FinalStage { + Employee build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage remoteId(Optional remoteId); + + _FinalStage remoteId(String remoteId); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + _FinalStage modifiedAt(Optional modifiedAt); + + _FinalStage modifiedAt(OffsetDateTime modifiedAt); + + _FinalStage firstName(Optional firstName); + + _FinalStage firstName(String firstName); + + _FinalStage lastName(Optional lastName); + + _FinalStage lastName(String lastName); + + _FinalStage isContractor(Optional isContractor); + + _FinalStage isContractor(Boolean isContractor); + + _FinalStage employeeNumber(Optional employeeNumber); + + _FinalStage employeeNumber(String employeeNumber); + + _FinalStage emailAddress(Optional emailAddress); + + _FinalStage emailAddress(String emailAddress); + + _FinalStage company(Optional company); + + _FinalStage company(EmployeeCompany company); + + _FinalStage remoteWasDeleted(Optional remoteWasDeleted); + + _FinalStage remoteWasDeleted(Boolean remoteWasDeleted); + + _FinalStage fieldMappings(Optional> fieldMappings); + + _FinalStage fieldMappings(Map fieldMappings); + + _FinalStage remoteData(Optional> remoteData); + + _FinalStage remoteData(List remoteData); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements StatusStage, _FinalStage { + private Status895Enum status; + + private Optional> remoteData = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional employeeNumber = Optional.empty(); + + private Optional isContractor = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Employee other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + isContractor(other.getIsContractor()); + employeeNumber(other.getEmployeeNumber()); + emailAddress(other.getEmailAddress()); + company(other.getCompany()); + status(other.getStatus()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + /** + *

The employee's status in the accounting system.

+ *
    + *
  • ACTIVE - ACTIVE
  • + *
  • INACTIVE - INACTIVE
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(@NotNull Status895Enum status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public _FinalStage remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + @java.lang.Override + public _FinalStage fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public _FinalStage fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + /** + *

Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public _FinalStage remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + /** + *

The subsidiary that the employee belongs to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage company(EmployeeCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public _FinalStage company(Optional company) { + this.company = company; + return this; + } + + /** + *

The employee's email address.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @java.lang.Override + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public _FinalStage emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + *

The employee's internal identification number.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage employeeNumber(String employeeNumber) { + this.employeeNumber = Optional.ofNullable(employeeNumber); + return this; + } + + @java.lang.Override + @JsonSetter(value = "employee_number", nulls = Nulls.SKIP) + public _FinalStage employeeNumber(Optional employeeNumber) { + this.employeeNumber = employeeNumber; + return this; + } + + /** + *

True if the employee is a contractor, False if not.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isContractor(Boolean isContractor) { + this.isContractor = Optional.ofNullable(isContractor); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_contractor", nulls = Nulls.SKIP) + public _FinalStage isContractor(Optional isContractor) { + this.isContractor = isContractor; + return this; + } + + /** + *

The employee's last name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_name", nulls = Nulls.SKIP) + public _FinalStage lastName(Optional lastName) { + this.lastName = lastName; + return this; + } + + /** + *

The employee's first name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public _FinalStage firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + /** + *

The datetime that this object was modified by Merge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public _FinalStage modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + *

The datetime that this object was created by Merge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The third-party API ID of the matching object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public _FinalStage remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Employee build() { + return new Employee( + id, + remoteId, + createdAt, + modifiedAt, + firstName, + lastName, + isContractor, + employeeNumber, + emailAddress, + company, + status, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EmployeeCompany.java b/src/main/java/com/merge/api/accounting/types/EmployeeCompany.java new file mode 100644 index 000000000..ecff2db05 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EmployeeCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeCompany.Deserializer.class) +public final class EmployeeCompany { + private final Object value; + + private final int type; + + private EmployeeCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeCompany && equalTo((EmployeeCompany) other); + } + + private boolean equalTo(EmployeeCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeCompany of(String value) { + return new EmployeeCompany(value, 0); + } + + public static EmployeeCompany of(CompanyInfo value) { + return new EmployeeCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeCompany.class); + } + + @java.lang.Override + public EmployeeCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java b/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java new file mode 100644 index 000000000..fdad31887 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeesListRequest.Builder.class) +public final class EmployeesListRequest { + private final Optional> expand; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private EmployeesListRequest( + Optional> expand, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional pageSize, + Map additionalProperties) { + this.expand = expand; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeesListRequest && equalTo((EmployeesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeesListRequest other) { + return expand.equals(other.expand) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployeesListRequest other) { + expand(other.getExpand()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public EmployeesListRequest build() { + return new EmployeesListRequest( + expand, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequest.java new file mode 100644 index 000000000..ac3f394e8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeesRetrieveRequest.Builder.class) +public final class EmployeesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private EmployeesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeesRetrieveRequest && equalTo((EmployeesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployeesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public EmployeesRetrieveRequest build() { + return new EmployeesRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/accounting/types/EnabledActionsEnum.java new file mode 100644 index 000000000..42ff3f4eb --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EnabledActionsEnum { + READ("READ"), + + WRITE("WRITE"); + + private final String value; + + EnabledActionsEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EncodingEnum.java b/src/main/java/com/merge/api/accounting/types/EncodingEnum.java new file mode 100644 index 000000000..e1831d861 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EncodingEnum { + RAW("RAW"), + + BASE_64("BASE64"), + + GZIP_BASE_64("GZIP_BASE64"); + + private final String value; + + EncodingEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..5d47f45a5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java @@ -0,0 +1,607 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + _FinalStage language(Optional language); + + _FinalStage language(LanguageEnum language); + + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + return this; + } + + /** + *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

Your end user's organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

A JSON object containing integration-specific configuration options.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

The following subset of IETF language tags can be used to configure localization.

+ *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/accounting/types/ErrorValidationProblem.java new file mode 100644 index 000000000..ba0762ffa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ErrorValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EventTypeEnum.java b/src/main/java/com/merge/api/accounting/types/EventTypeEnum.java new file mode 100644 index 000000000..3d5291644 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EventTypeEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EventTypeEnum { + CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), + + DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), + + CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), + + DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), + + REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), + + INVITED_USER("INVITED_USER"), + + TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), + + TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), + + DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), + + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT("DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"), + + CREATED_DESTINATION("CREATED_DESTINATION"), + + DELETED_DESTINATION("DELETED_DESTINATION"), + + CHANGED_DESTINATION("CHANGED_DESTINATION"), + + CHANGED_SCOPES("CHANGED_SCOPES"), + + CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), + + CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), + + ENABLED_INTEGRATION("ENABLED_INTEGRATION"), + + DISABLED_INTEGRATION("DISABLED_INTEGRATION"), + + ENABLED_CATEGORY("ENABLED_CATEGORY"), + + DISABLED_CATEGORY("DISABLED_CATEGORY"), + + CHANGED_PASSWORD("CHANGED_PASSWORD"), + + RESET_PASSWORD("RESET_PASSWORD"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), + + DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), + + DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), + + MUTED_ISSUE("MUTED_ISSUE"), + + GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), + + ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), + + DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), + + MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), + + END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); + + private final String value; + + EventTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Expense.java b/src/main/java/com/merge/api/accounting/types/Expense.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/Expense.java rename to src/main/java/com/merge/api/accounting/types/Expense.java index a92c2ebb9..16b9ba32e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/Expense.java +++ b/src/main/java/com/merge/api/accounting/types/Expense.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -45,7 +45,7 @@ public final class Expense { private final Optional totalTaxAmount; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -85,7 +85,7 @@ private Expense( Optional totalAmount, Optional subTotal, Optional totalTaxAmount, - Optional currency, + Optional currency, Optional exchangeRate, Optional inclusiveOfTax, Optional company, @@ -523,7 +523,7 @@ public Optional getTotalTaxAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -708,7 +708,7 @@ public static final class Builder { private Optional totalTaxAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -889,12 +889,12 @@ public Builder totalTaxAmount(Double totalTaxAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(ExpenseCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseAccount.java b/src/main/java/com/merge/api/accounting/types/ExpenseAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseAccount.java rename to src/main/java/com/merge/api/accounting/types/ExpenseAccount.java index 317bc9118..d48eedbca 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseAccount.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/ExpenseAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/ExpenseAccountingPeriod.java index 91b02c345..6672df199 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public ExpenseAccountingPeriod deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseAccountingPeriod deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseCompany.java b/src/main/java/com/merge/api/accounting/types/ExpenseCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseCompany.java rename to src/main/java/com/merge/api/accounting/types/ExpenseCompany.java index 990d6e5f3..d7b8b43c9 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseCompany.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseContact.java b/src/main/java/com/merge/api/accounting/types/ExpenseContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseContact.java rename to src/main/java/com/merge/api/accounting/types/ExpenseContact.java index 8fcf5a29a..e8606f4f8 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseContact.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseEmployee.java b/src/main/java/com/merge/api/accounting/types/ExpenseEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseEmployee.java rename to src/main/java/com/merge/api/accounting/types/ExpenseEmployee.java index 3fb529ae1..b551e86d4 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpenseEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpenseEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/ExpenseEndpointRequest.java index 015ca481d..4b5051148 100644 --- a/src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpenseEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.expenses.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.ExpenseRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLine.java b/src/main/java/com/merge/api/accounting/types/ExpenseLine.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLine.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLine.java index cea0ed66e..08197ec9b 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLine.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLine.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -42,7 +42,7 @@ public final class ExpenseLine { private final Optional employee; - private final Optional currency; + private final Optional currency; private final Optional account; @@ -69,7 +69,7 @@ private ExpenseLine( Optional>> trackingCategories, Optional company, Optional employee, - Optional currency, + Optional currency, Optional account, Optional contact, Optional description, @@ -483,7 +483,7 @@ public Optional getEmployee() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -619,7 +619,7 @@ public static final class Builder { private Optional employee = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional account = Optional.empty(); @@ -771,12 +771,12 @@ public Builder employee(ExpenseLineEmployee employee) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(ExpenseLineCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineAccount.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLineAccount.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLineAccount.java index f155ebd80..2ebf38b75 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineAccount.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseLineAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseLineAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineContact.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLineContact.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLineContact.java index f6774174b..33c72fb9f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineContact.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseLineContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseLineContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineEmployee.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLineEmployee.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLineEmployee.java index 31a66e744..6165ec8c4 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseLineEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseLineEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLineItem.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLineItem.java index 1a55e8102..3f8ba65b8 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseLineItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseLineItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequest.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java index 7b94fcca9..fc36c329e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -36,7 +36,7 @@ public final class ExpenseLineRequest { private final Optional employee; - private final Optional currency; + private final Optional currency; private final Optional account; @@ -64,7 +64,7 @@ private ExpenseLineRequest( Optional>> trackingCategories, Optional company, Optional employee, - Optional currency, + Optional currency, Optional account, Optional contact, Optional description, @@ -458,7 +458,7 @@ public Optional getEmployee() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -594,7 +594,7 @@ public static final class Builder { private Optional employee = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional account = Optional.empty(); @@ -716,12 +716,12 @@ public Builder employee(ExpenseLineRequestEmployee employee) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(ExpenseLineRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestAccount.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLineRequestAccount.java index 86efa6eea..e7ff6c037 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public ExpenseLineRequestItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseLineRequestItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java index b7422d7c0..463df83bf 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequestTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer totalTaxAmount; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -68,7 +68,7 @@ private ExpenseRequest( Optional totalAmount, Optional subTotal, Optional totalTaxAmount, - Optional currency, + Optional currency, Optional exchangeRate, Optional inclusiveOfTax, Optional company, @@ -462,7 +462,7 @@ public Optional getTotalTaxAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -617,7 +617,7 @@ public static final class Builder { private Optional totalTaxAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -735,12 +735,12 @@ public Builder totalTaxAmount(Double totalTaxAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(ExpenseRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestAccount.java b/src/main/java/com/merge/api/accounting/types/ExpenseRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/ExpenseRequestAccount.java index 55a80a266..ac597f015 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseRequestAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/ExpenseRequestAccountingPeriod.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/ExpenseRequestAccountingPeriod.java index 7474e1f72..f168dcdfc 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequestAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseRequestCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestContact.java b/src/main/java/com/merge/api/accounting/types/ExpenseRequestContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestContact.java rename to src/main/java/com/merge/api/accounting/types/ExpenseRequestContact.java index bb8bc9ac9..b469f1599 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestContact.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequestContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ExpenseRequestContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestEmployee.java b/src/main/java/com/merge/api/accounting/types/ExpenseRequestEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestEmployee.java rename to src/main/java/com/merge/api/accounting/types/ExpenseRequestEmployee.java index fc8874a6a..37f940643 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequestEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public ExpenseRequestEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ExpenseRequestEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseRequestTrackingCategoriesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/ExpenseRequestTrackingCategoriesItem.java index a6dad3125..b0311b92f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequestTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional companyId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class ExpensesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -55,11 +56,11 @@ public final class ExpensesListRequest { private final Map additionalProperties; private ExpensesListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -71,11 +72,11 @@ private ExpensesListRequest( Optional transactionDateAfter, Optional transactionDateBefore, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -89,6 +90,14 @@ private ExpensesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return expenses for this company. */ @@ -121,14 +130,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -221,11 +222,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(ExpensesListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -241,11 +242,11 @@ private boolean equalTo(ExpensesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -269,6 +270,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -277,8 +280,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -305,11 +306,11 @@ public static final class Builder { private Builder() {} public Builder from(ExpensesListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -323,6 +324,22 @@ public Builder from(ExpensesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ExpensesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -367,17 +384,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ExpensesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -490,11 +496,11 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { public ExpensesListRequest build() { return new ExpensesListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/accounting/types/ExpensesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ExpensesListRequestExpandItem.java new file mode 100644 index 000000000..da9632ca8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpensesListRequestExpandItem.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ExpensesListRequestExpandItem { + ACCOUNT("account"), + + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + CONTACT("contact"), + + EMPLOYEE("employee"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + ExpensesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpensesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpensesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java index 9338f8143..99e805c69 100644 --- a/src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpensesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.expenses.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/ExpensesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ExpensesRetrieveRequest.java new file mode 100644 index 000000000..cd89ed3a6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpensesRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpensesRetrieveRequest.Builder.class) +public final class ExpensesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ExpensesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpensesRetrieveRequest && equalTo((ExpensesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpensesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpensesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ExpensesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ExpensesRetrieveRequest build() { + return new ExpensesRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpensesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ExpensesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..3806f3929 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpensesRetrieveRequestExpandItem.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ExpensesRetrieveRequestExpandItem { + ACCOUNT("account"), + + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + CONTACT("contact"), + + EMPLOYEE("employee"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + ExpensesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..085d477c4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..bb23365c4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,699 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> account; + + private final Optional> accountingAttachment; + + private final Optional> balanceSheet; + + private final Optional> cashFlowStatement; + + private final Optional> companyInfo; + + private final Optional> contact; + + private final Optional> incomeStatement; + + private final Optional> creditNote; + + private final Optional> item; + + private final Optional> purchaseOrder; + + private final Optional> trackingCategory; + + private final Optional> journalEntry; + + private final Optional> taxRate; + + private final Optional> invoice; + + private final Optional> payment; + + private final Optional> expense; + + private final Optional> vendorCredit; + + private final Optional> transaction; + + private final Optional> accountingPeriod; + + private final Optional> generalLedgerTransaction; + + private final Optional> bankFeedAccount; + + private final Optional> employee; + + private final Optional> paymentMethod; + + private final Optional> paymentTerm; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> account, + Optional> accountingAttachment, + Optional> balanceSheet, + Optional> cashFlowStatement, + Optional> companyInfo, + Optional> contact, + Optional> incomeStatement, + Optional> creditNote, + Optional> item, + Optional> purchaseOrder, + Optional> trackingCategory, + Optional> journalEntry, + Optional> taxRate, + Optional> invoice, + Optional> payment, + Optional> expense, + Optional> vendorCredit, + Optional> transaction, + Optional> accountingPeriod, + Optional> generalLedgerTransaction, + Optional> bankFeedAccount, + Optional> employee, + Optional> paymentMethod, + Optional> paymentTerm, + Map additionalProperties) { + this.account = account; + this.accountingAttachment = accountingAttachment; + this.balanceSheet = balanceSheet; + this.cashFlowStatement = cashFlowStatement; + this.companyInfo = companyInfo; + this.contact = contact; + this.incomeStatement = incomeStatement; + this.creditNote = creditNote; + this.item = item; + this.purchaseOrder = purchaseOrder; + this.trackingCategory = trackingCategory; + this.journalEntry = journalEntry; + this.taxRate = taxRate; + this.invoice = invoice; + this.payment = payment; + this.expense = expense; + this.vendorCredit = vendorCredit; + this.transaction = transaction; + this.accountingPeriod = accountingPeriod; + this.generalLedgerTransaction = generalLedgerTransaction; + this.bankFeedAccount = bankFeedAccount; + this.employee = employee; + this.paymentMethod = paymentMethod; + this.paymentTerm = paymentTerm; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("AccountingAttachment") + public Optional> getAccountingAttachment() { + return accountingAttachment; + } + + @JsonProperty("BalanceSheet") + public Optional> getBalanceSheet() { + return balanceSheet; + } + + @JsonProperty("CashFlowStatement") + public Optional> getCashFlowStatement() { + return cashFlowStatement; + } + + @JsonProperty("CompanyInfo") + public Optional> getCompanyInfo() { + return companyInfo; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @JsonProperty("IncomeStatement") + public Optional> getIncomeStatement() { + return incomeStatement; + } + + @JsonProperty("CreditNote") + public Optional> getCreditNote() { + return creditNote; + } + + @JsonProperty("Item") + public Optional> getItem() { + return item; + } + + @JsonProperty("PurchaseOrder") + public Optional> getPurchaseOrder() { + return purchaseOrder; + } + + @JsonProperty("TrackingCategory") + public Optional> getTrackingCategory() { + return trackingCategory; + } + + @JsonProperty("JournalEntry") + public Optional> getJournalEntry() { + return journalEntry; + } + + @JsonProperty("TaxRate") + public Optional> getTaxRate() { + return taxRate; + } + + @JsonProperty("Invoice") + public Optional> getInvoice() { + return invoice; + } + + @JsonProperty("Payment") + public Optional> getPayment() { + return payment; + } + + @JsonProperty("Expense") + public Optional> getExpense() { + return expense; + } + + @JsonProperty("VendorCredit") + public Optional> getVendorCredit() { + return vendorCredit; + } + + @JsonProperty("Transaction") + public Optional> getTransaction() { + return transaction; + } + + @JsonProperty("AccountingPeriod") + public Optional> getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("GeneralLedgerTransaction") + public Optional> getGeneralLedgerTransaction() { + return generalLedgerTransaction; + } + + @JsonProperty("BankFeedAccount") + public Optional> getBankFeedAccount() { + return bankFeedAccount; + } + + @JsonProperty("Employee") + public Optional> getEmployee() { + return employee; + } + + @JsonProperty("PaymentMethod") + public Optional> getPaymentMethod() { + return paymentMethod; + } + + @JsonProperty("PaymentTerm") + public Optional> getPaymentTerm() { + return paymentTerm; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return account.equals(other.account) + && accountingAttachment.equals(other.accountingAttachment) + && balanceSheet.equals(other.balanceSheet) + && cashFlowStatement.equals(other.cashFlowStatement) + && companyInfo.equals(other.companyInfo) + && contact.equals(other.contact) + && incomeStatement.equals(other.incomeStatement) + && creditNote.equals(other.creditNote) + && item.equals(other.item) + && purchaseOrder.equals(other.purchaseOrder) + && trackingCategory.equals(other.trackingCategory) + && journalEntry.equals(other.journalEntry) + && taxRate.equals(other.taxRate) + && invoice.equals(other.invoice) + && payment.equals(other.payment) + && expense.equals(other.expense) + && vendorCredit.equals(other.vendorCredit) + && transaction.equals(other.transaction) + && accountingPeriod.equals(other.accountingPeriod) + && generalLedgerTransaction.equals(other.generalLedgerTransaction) + && bankFeedAccount.equals(other.bankFeedAccount) + && employee.equals(other.employee) + && paymentMethod.equals(other.paymentMethod) + && paymentTerm.equals(other.paymentTerm); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.account, + this.accountingAttachment, + this.balanceSheet, + this.cashFlowStatement, + this.companyInfo, + this.contact, + this.incomeStatement, + this.creditNote, + this.item, + this.purchaseOrder, + this.trackingCategory, + this.journalEntry, + this.taxRate, + this.invoice, + this.payment, + this.expense, + this.vendorCredit, + this.transaction, + this.accountingPeriod, + this.generalLedgerTransaction, + this.bankFeedAccount, + this.employee, + this.paymentMethod, + this.paymentTerm); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> account = Optional.empty(); + + private Optional> accountingAttachment = Optional.empty(); + + private Optional> balanceSheet = Optional.empty(); + + private Optional> cashFlowStatement = Optional.empty(); + + private Optional> companyInfo = Optional.empty(); + + private Optional> contact = Optional.empty(); + + private Optional> incomeStatement = Optional.empty(); + + private Optional> creditNote = Optional.empty(); + + private Optional> item = Optional.empty(); + + private Optional> purchaseOrder = Optional.empty(); + + private Optional> trackingCategory = Optional.empty(); + + private Optional> journalEntry = Optional.empty(); + + private Optional> taxRate = Optional.empty(); + + private Optional> invoice = Optional.empty(); + + private Optional> payment = Optional.empty(); + + private Optional> expense = Optional.empty(); + + private Optional> vendorCredit = Optional.empty(); + + private Optional> transaction = Optional.empty(); + + private Optional> accountingPeriod = Optional.empty(); + + private Optional> generalLedgerTransaction = Optional.empty(); + + private Optional> bankFeedAccount = Optional.empty(); + + private Optional> employee = Optional.empty(); + + private Optional> paymentMethod = Optional.empty(); + + private Optional> paymentTerm = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + account(other.getAccount()); + accountingAttachment(other.getAccountingAttachment()); + balanceSheet(other.getBalanceSheet()); + cashFlowStatement(other.getCashFlowStatement()); + companyInfo(other.getCompanyInfo()); + contact(other.getContact()); + incomeStatement(other.getIncomeStatement()); + creditNote(other.getCreditNote()); + item(other.getItem()); + purchaseOrder(other.getPurchaseOrder()); + trackingCategory(other.getTrackingCategory()); + journalEntry(other.getJournalEntry()); + taxRate(other.getTaxRate()); + invoice(other.getInvoice()); + payment(other.getPayment()); + expense(other.getExpense()); + vendorCredit(other.getVendorCredit()); + transaction(other.getTransaction()); + accountingPeriod(other.getAccountingPeriod()); + generalLedgerTransaction(other.getGeneralLedgerTransaction()); + bankFeedAccount(other.getBankFeedAccount()); + employee(other.getEmployee()); + paymentMethod(other.getPaymentMethod()); + paymentTerm(other.getPaymentTerm()); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "AccountingAttachment", nulls = Nulls.SKIP) + public Builder accountingAttachment(Optional> accountingAttachment) { + this.accountingAttachment = accountingAttachment; + return this; + } + + public Builder accountingAttachment(List accountingAttachment) { + this.accountingAttachment = Optional.ofNullable(accountingAttachment); + return this; + } + + @JsonSetter(value = "BalanceSheet", nulls = Nulls.SKIP) + public Builder balanceSheet(Optional> balanceSheet) { + this.balanceSheet = balanceSheet; + return this; + } + + public Builder balanceSheet(List balanceSheet) { + this.balanceSheet = Optional.ofNullable(balanceSheet); + return this; + } + + @JsonSetter(value = "CashFlowStatement", nulls = Nulls.SKIP) + public Builder cashFlowStatement(Optional> cashFlowStatement) { + this.cashFlowStatement = cashFlowStatement; + return this; + } + + public Builder cashFlowStatement(List cashFlowStatement) { + this.cashFlowStatement = Optional.ofNullable(cashFlowStatement); + return this; + } + + @JsonSetter(value = "CompanyInfo", nulls = Nulls.SKIP) + public Builder companyInfo(Optional> companyInfo) { + this.companyInfo = companyInfo; + return this; + } + + public Builder companyInfo(List companyInfo) { + this.companyInfo = Optional.ofNullable(companyInfo); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "IncomeStatement", nulls = Nulls.SKIP) + public Builder incomeStatement(Optional> incomeStatement) { + this.incomeStatement = incomeStatement; + return this; + } + + public Builder incomeStatement(List incomeStatement) { + this.incomeStatement = Optional.ofNullable(incomeStatement); + return this; + } + + @JsonSetter(value = "CreditNote", nulls = Nulls.SKIP) + public Builder creditNote(Optional> creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder creditNote(List creditNote) { + this.creditNote = Optional.ofNullable(creditNote); + return this; + } + + @JsonSetter(value = "Item", nulls = Nulls.SKIP) + public Builder item(Optional> item) { + this.item = item; + return this; + } + + public Builder item(List item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "PurchaseOrder", nulls = Nulls.SKIP) + public Builder purchaseOrder(Optional> purchaseOrder) { + this.purchaseOrder = purchaseOrder; + return this; + } + + public Builder purchaseOrder(List purchaseOrder) { + this.purchaseOrder = Optional.ofNullable(purchaseOrder); + return this; + } + + @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional> trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(List trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "JournalEntry", nulls = Nulls.SKIP) + public Builder journalEntry(Optional> journalEntry) { + this.journalEntry = journalEntry; + return this; + } + + public Builder journalEntry(List journalEntry) { + this.journalEntry = Optional.ofNullable(journalEntry); + return this; + } + + @JsonSetter(value = "TaxRate", nulls = Nulls.SKIP) + public Builder taxRate(Optional> taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(List taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "Invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional> invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(List invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + @JsonSetter(value = "Payment", nulls = Nulls.SKIP) + public Builder payment(Optional> payment) { + this.payment = payment; + return this; + } + + public Builder payment(List payment) { + this.payment = Optional.ofNullable(payment); + return this; + } + + @JsonSetter(value = "Expense", nulls = Nulls.SKIP) + public Builder expense(Optional> expense) { + this.expense = expense; + return this; + } + + public Builder expense(List expense) { + this.expense = Optional.ofNullable(expense); + return this; + } + + @JsonSetter(value = "VendorCredit", nulls = Nulls.SKIP) + public Builder vendorCredit(Optional> vendorCredit) { + this.vendorCredit = vendorCredit; + return this; + } + + public Builder vendorCredit(List vendorCredit) { + this.vendorCredit = Optional.ofNullable(vendorCredit); + return this; + } + + @JsonSetter(value = "Transaction", nulls = Nulls.SKIP) + public Builder transaction(Optional> transaction) { + this.transaction = transaction; + return this; + } + + public Builder transaction(List transaction) { + this.transaction = Optional.ofNullable(transaction); + return this; + } + + @JsonSetter(value = "AccountingPeriod", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional> accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(List accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "GeneralLedgerTransaction", nulls = Nulls.SKIP) + public Builder generalLedgerTransaction(Optional> generalLedgerTransaction) { + this.generalLedgerTransaction = generalLedgerTransaction; + return this; + } + + public Builder generalLedgerTransaction(List generalLedgerTransaction) { + this.generalLedgerTransaction = Optional.ofNullable(generalLedgerTransaction); + return this; + } + + @JsonSetter(value = "BankFeedAccount", nulls = Nulls.SKIP) + public Builder bankFeedAccount(Optional> bankFeedAccount) { + this.bankFeedAccount = bankFeedAccount; + return this; + } + + public Builder bankFeedAccount(List bankFeedAccount) { + this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); + return this; + } + + @JsonSetter(value = "Employee", nulls = Nulls.SKIP) + public Builder employee(Optional> employee) { + this.employee = employee; + return this; + } + + public Builder employee(List employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "PaymentMethod", nulls = Nulls.SKIP) + public Builder paymentMethod(Optional> paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + public Builder paymentMethod(List paymentMethod) { + this.paymentMethod = Optional.ofNullable(paymentMethod); + return this; + } + + @JsonSetter(value = "PaymentTerm", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional> paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(List paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse( + account, + accountingAttachment, + balanceSheet, + cashFlowStatement, + companyInfo, + contact, + incomeStatement, + creditNote, + item, + purchaseOrder, + trackingCategory, + journalEntry, + taxRate, + invoice, + payment, + expense, + vendorCredit, + transaction, + accountingPeriod, + generalLedgerTransaction, + bankFeedAccount, + employee, + paymentMethod, + paymentTerm, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FeedStatusEnum.java b/src/main/java/com/merge/api/accounting/types/FeedStatusEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/FeedStatusEnum.java rename to src/main/java/com/merge/api/accounting/types/FeedStatusEnum.java index 71d6d9e80..d63fdbf97 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/FeedStatusEnum.java +++ b/src/main/java/com/merge/api/accounting/types/FeedStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/FieldFormatEnum.java b/src/main/java/com/merge/api/accounting/types/FieldFormatEnum.java new file mode 100644 index 000000000..cb3960cf3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FieldFormatEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + FieldFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..e1cc66f6f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..d62f589f3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..d67c1db6b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..9274392d8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,699 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> account; + + private final Optional> accountingAttachment; + + private final Optional> balanceSheet; + + private final Optional> cashFlowStatement; + + private final Optional> companyInfo; + + private final Optional> contact; + + private final Optional> incomeStatement; + + private final Optional> creditNote; + + private final Optional> item; + + private final Optional> purchaseOrder; + + private final Optional> trackingCategory; + + private final Optional> journalEntry; + + private final Optional> taxRate; + + private final Optional> invoice; + + private final Optional> payment; + + private final Optional> expense; + + private final Optional> vendorCredit; + + private final Optional> transaction; + + private final Optional> accountingPeriod; + + private final Optional> generalLedgerTransaction; + + private final Optional> bankFeedAccount; + + private final Optional> employee; + + private final Optional> paymentMethod; + + private final Optional> paymentTerm; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> account, + Optional> accountingAttachment, + Optional> balanceSheet, + Optional> cashFlowStatement, + Optional> companyInfo, + Optional> contact, + Optional> incomeStatement, + Optional> creditNote, + Optional> item, + Optional> purchaseOrder, + Optional> trackingCategory, + Optional> journalEntry, + Optional> taxRate, + Optional> invoice, + Optional> payment, + Optional> expense, + Optional> vendorCredit, + Optional> transaction, + Optional> accountingPeriod, + Optional> generalLedgerTransaction, + Optional> bankFeedAccount, + Optional> employee, + Optional> paymentMethod, + Optional> paymentTerm, + Map additionalProperties) { + this.account = account; + this.accountingAttachment = accountingAttachment; + this.balanceSheet = balanceSheet; + this.cashFlowStatement = cashFlowStatement; + this.companyInfo = companyInfo; + this.contact = contact; + this.incomeStatement = incomeStatement; + this.creditNote = creditNote; + this.item = item; + this.purchaseOrder = purchaseOrder; + this.trackingCategory = trackingCategory; + this.journalEntry = journalEntry; + this.taxRate = taxRate; + this.invoice = invoice; + this.payment = payment; + this.expense = expense; + this.vendorCredit = vendorCredit; + this.transaction = transaction; + this.accountingPeriod = accountingPeriod; + this.generalLedgerTransaction = generalLedgerTransaction; + this.bankFeedAccount = bankFeedAccount; + this.employee = employee; + this.paymentMethod = paymentMethod; + this.paymentTerm = paymentTerm; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("AccountingAttachment") + public Optional> getAccountingAttachment() { + return accountingAttachment; + } + + @JsonProperty("BalanceSheet") + public Optional> getBalanceSheet() { + return balanceSheet; + } + + @JsonProperty("CashFlowStatement") + public Optional> getCashFlowStatement() { + return cashFlowStatement; + } + + @JsonProperty("CompanyInfo") + public Optional> getCompanyInfo() { + return companyInfo; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @JsonProperty("IncomeStatement") + public Optional> getIncomeStatement() { + return incomeStatement; + } + + @JsonProperty("CreditNote") + public Optional> getCreditNote() { + return creditNote; + } + + @JsonProperty("Item") + public Optional> getItem() { + return item; + } + + @JsonProperty("PurchaseOrder") + public Optional> getPurchaseOrder() { + return purchaseOrder; + } + + @JsonProperty("TrackingCategory") + public Optional> getTrackingCategory() { + return trackingCategory; + } + + @JsonProperty("JournalEntry") + public Optional> getJournalEntry() { + return journalEntry; + } + + @JsonProperty("TaxRate") + public Optional> getTaxRate() { + return taxRate; + } + + @JsonProperty("Invoice") + public Optional> getInvoice() { + return invoice; + } + + @JsonProperty("Payment") + public Optional> getPayment() { + return payment; + } + + @JsonProperty("Expense") + public Optional> getExpense() { + return expense; + } + + @JsonProperty("VendorCredit") + public Optional> getVendorCredit() { + return vendorCredit; + } + + @JsonProperty("Transaction") + public Optional> getTransaction() { + return transaction; + } + + @JsonProperty("AccountingPeriod") + public Optional> getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("GeneralLedgerTransaction") + public Optional> getGeneralLedgerTransaction() { + return generalLedgerTransaction; + } + + @JsonProperty("BankFeedAccount") + public Optional> getBankFeedAccount() { + return bankFeedAccount; + } + + @JsonProperty("Employee") + public Optional> getEmployee() { + return employee; + } + + @JsonProperty("PaymentMethod") + public Optional> getPaymentMethod() { + return paymentMethod; + } + + @JsonProperty("PaymentTerm") + public Optional> getPaymentTerm() { + return paymentTerm; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return account.equals(other.account) + && accountingAttachment.equals(other.accountingAttachment) + && balanceSheet.equals(other.balanceSheet) + && cashFlowStatement.equals(other.cashFlowStatement) + && companyInfo.equals(other.companyInfo) + && contact.equals(other.contact) + && incomeStatement.equals(other.incomeStatement) + && creditNote.equals(other.creditNote) + && item.equals(other.item) + && purchaseOrder.equals(other.purchaseOrder) + && trackingCategory.equals(other.trackingCategory) + && journalEntry.equals(other.journalEntry) + && taxRate.equals(other.taxRate) + && invoice.equals(other.invoice) + && payment.equals(other.payment) + && expense.equals(other.expense) + && vendorCredit.equals(other.vendorCredit) + && transaction.equals(other.transaction) + && accountingPeriod.equals(other.accountingPeriod) + && generalLedgerTransaction.equals(other.generalLedgerTransaction) + && bankFeedAccount.equals(other.bankFeedAccount) + && employee.equals(other.employee) + && paymentMethod.equals(other.paymentMethod) + && paymentTerm.equals(other.paymentTerm); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.account, + this.accountingAttachment, + this.balanceSheet, + this.cashFlowStatement, + this.companyInfo, + this.contact, + this.incomeStatement, + this.creditNote, + this.item, + this.purchaseOrder, + this.trackingCategory, + this.journalEntry, + this.taxRate, + this.invoice, + this.payment, + this.expense, + this.vendorCredit, + this.transaction, + this.accountingPeriod, + this.generalLedgerTransaction, + this.bankFeedAccount, + this.employee, + this.paymentMethod, + this.paymentTerm); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> account = Optional.empty(); + + private Optional> accountingAttachment = Optional.empty(); + + private Optional> balanceSheet = Optional.empty(); + + private Optional> cashFlowStatement = Optional.empty(); + + private Optional> companyInfo = Optional.empty(); + + private Optional> contact = Optional.empty(); + + private Optional> incomeStatement = Optional.empty(); + + private Optional> creditNote = Optional.empty(); + + private Optional> item = Optional.empty(); + + private Optional> purchaseOrder = Optional.empty(); + + private Optional> trackingCategory = Optional.empty(); + + private Optional> journalEntry = Optional.empty(); + + private Optional> taxRate = Optional.empty(); + + private Optional> invoice = Optional.empty(); + + private Optional> payment = Optional.empty(); + + private Optional> expense = Optional.empty(); + + private Optional> vendorCredit = Optional.empty(); + + private Optional> transaction = Optional.empty(); + + private Optional> accountingPeriod = Optional.empty(); + + private Optional> generalLedgerTransaction = Optional.empty(); + + private Optional> bankFeedAccount = Optional.empty(); + + private Optional> employee = Optional.empty(); + + private Optional> paymentMethod = Optional.empty(); + + private Optional> paymentTerm = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + account(other.getAccount()); + accountingAttachment(other.getAccountingAttachment()); + balanceSheet(other.getBalanceSheet()); + cashFlowStatement(other.getCashFlowStatement()); + companyInfo(other.getCompanyInfo()); + contact(other.getContact()); + incomeStatement(other.getIncomeStatement()); + creditNote(other.getCreditNote()); + item(other.getItem()); + purchaseOrder(other.getPurchaseOrder()); + trackingCategory(other.getTrackingCategory()); + journalEntry(other.getJournalEntry()); + taxRate(other.getTaxRate()); + invoice(other.getInvoice()); + payment(other.getPayment()); + expense(other.getExpense()); + vendorCredit(other.getVendorCredit()); + transaction(other.getTransaction()); + accountingPeriod(other.getAccountingPeriod()); + generalLedgerTransaction(other.getGeneralLedgerTransaction()); + bankFeedAccount(other.getBankFeedAccount()); + employee(other.getEmployee()); + paymentMethod(other.getPaymentMethod()); + paymentTerm(other.getPaymentTerm()); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "AccountingAttachment", nulls = Nulls.SKIP) + public Builder accountingAttachment(Optional> accountingAttachment) { + this.accountingAttachment = accountingAttachment; + return this; + } + + public Builder accountingAttachment(List accountingAttachment) { + this.accountingAttachment = Optional.ofNullable(accountingAttachment); + return this; + } + + @JsonSetter(value = "BalanceSheet", nulls = Nulls.SKIP) + public Builder balanceSheet(Optional> balanceSheet) { + this.balanceSheet = balanceSheet; + return this; + } + + public Builder balanceSheet(List balanceSheet) { + this.balanceSheet = Optional.ofNullable(balanceSheet); + return this; + } + + @JsonSetter(value = "CashFlowStatement", nulls = Nulls.SKIP) + public Builder cashFlowStatement(Optional> cashFlowStatement) { + this.cashFlowStatement = cashFlowStatement; + return this; + } + + public Builder cashFlowStatement(List cashFlowStatement) { + this.cashFlowStatement = Optional.ofNullable(cashFlowStatement); + return this; + } + + @JsonSetter(value = "CompanyInfo", nulls = Nulls.SKIP) + public Builder companyInfo(Optional> companyInfo) { + this.companyInfo = companyInfo; + return this; + } + + public Builder companyInfo(List companyInfo) { + this.companyInfo = Optional.ofNullable(companyInfo); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "IncomeStatement", nulls = Nulls.SKIP) + public Builder incomeStatement(Optional> incomeStatement) { + this.incomeStatement = incomeStatement; + return this; + } + + public Builder incomeStatement(List incomeStatement) { + this.incomeStatement = Optional.ofNullable(incomeStatement); + return this; + } + + @JsonSetter(value = "CreditNote", nulls = Nulls.SKIP) + public Builder creditNote(Optional> creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder creditNote(List creditNote) { + this.creditNote = Optional.ofNullable(creditNote); + return this; + } + + @JsonSetter(value = "Item", nulls = Nulls.SKIP) + public Builder item(Optional> item) { + this.item = item; + return this; + } + + public Builder item(List item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "PurchaseOrder", nulls = Nulls.SKIP) + public Builder purchaseOrder(Optional> purchaseOrder) { + this.purchaseOrder = purchaseOrder; + return this; + } + + public Builder purchaseOrder(List purchaseOrder) { + this.purchaseOrder = Optional.ofNullable(purchaseOrder); + return this; + } + + @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional> trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(List trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "JournalEntry", nulls = Nulls.SKIP) + public Builder journalEntry(Optional> journalEntry) { + this.journalEntry = journalEntry; + return this; + } + + public Builder journalEntry(List journalEntry) { + this.journalEntry = Optional.ofNullable(journalEntry); + return this; + } + + @JsonSetter(value = "TaxRate", nulls = Nulls.SKIP) + public Builder taxRate(Optional> taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(List taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "Invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional> invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(List invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + @JsonSetter(value = "Payment", nulls = Nulls.SKIP) + public Builder payment(Optional> payment) { + this.payment = payment; + return this; + } + + public Builder payment(List payment) { + this.payment = Optional.ofNullable(payment); + return this; + } + + @JsonSetter(value = "Expense", nulls = Nulls.SKIP) + public Builder expense(Optional> expense) { + this.expense = expense; + return this; + } + + public Builder expense(List expense) { + this.expense = Optional.ofNullable(expense); + return this; + } + + @JsonSetter(value = "VendorCredit", nulls = Nulls.SKIP) + public Builder vendorCredit(Optional> vendorCredit) { + this.vendorCredit = vendorCredit; + return this; + } + + public Builder vendorCredit(List vendorCredit) { + this.vendorCredit = Optional.ofNullable(vendorCredit); + return this; + } + + @JsonSetter(value = "Transaction", nulls = Nulls.SKIP) + public Builder transaction(Optional> transaction) { + this.transaction = transaction; + return this; + } + + public Builder transaction(List transaction) { + this.transaction = Optional.ofNullable(transaction); + return this; + } + + @JsonSetter(value = "AccountingPeriod", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional> accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(List accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "GeneralLedgerTransaction", nulls = Nulls.SKIP) + public Builder generalLedgerTransaction(Optional> generalLedgerTransaction) { + this.generalLedgerTransaction = generalLedgerTransaction; + return this; + } + + public Builder generalLedgerTransaction(List generalLedgerTransaction) { + this.generalLedgerTransaction = Optional.ofNullable(generalLedgerTransaction); + return this; + } + + @JsonSetter(value = "BankFeedAccount", nulls = Nulls.SKIP) + public Builder bankFeedAccount(Optional> bankFeedAccount) { + this.bankFeedAccount = bankFeedAccount; + return this; + } + + public Builder bankFeedAccount(List bankFeedAccount) { + this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); + return this; + } + + @JsonSetter(value = "Employee", nulls = Nulls.SKIP) + public Builder employee(Optional> employee) { + this.employee = employee; + return this; + } + + public Builder employee(List employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "PaymentMethod", nulls = Nulls.SKIP) + public Builder paymentMethod(Optional> paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + public Builder paymentMethod(List paymentMethod) { + this.paymentMethod = Optional.ofNullable(paymentMethod); + return this; + } + + @JsonSetter(value = "PaymentTerm", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional> paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(List paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse( + account, + accountingAttachment, + balanceSheet, + cashFlowStatement, + companyInfo, + contact, + incomeStatement, + creditNote, + item, + purchaseOrder, + trackingCategory, + journalEntry, + taxRate, + invoice, + payment, + expense, + vendorCredit, + transaction, + accountingPeriod, + generalLedgerTransaction, + bankFeedAccount, + employee, + paymentMethod, + paymentTerm, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..28e4fac80 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/accounting/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..7b3c460ad --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingInstanceResponse.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..fd1742ce3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/accounting/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..bdc3fb8a8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/accounting/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..22943f64e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/FieldTypeEnum.java b/src/main/java/com/merge/api/accounting/types/FieldTypeEnum.java new file mode 100644 index 000000000..db2e9b194 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FieldTypeEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + FieldTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransaction.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransaction.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransaction.java rename to src/main/java/com/merge/api/accounting/types/GeneralLedgerTransaction.java index 9bf7c2de1..3ef22868d 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransaction.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransaction.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class GeneralLedgerTransaction { private final Optional underlyingTransactionRemoteId; - private final Optional underlyingTransactionType; + private final Optional underlyingTransactionType; private final Optional accountingPeriod; @@ -64,7 +64,7 @@ private GeneralLedgerTransaction( Optional createdAt, Optional modifiedAt, Optional underlyingTransactionRemoteId, - Optional underlyingTransactionType, + Optional underlyingTransactionType, Optional accountingPeriod, Optional company, Optional remoteUpdatedAt, @@ -145,7 +145,7 @@ public Optional getUnderlyingTransactionRemoteId() { * */ @JsonProperty("underlying_transaction_type") - public Optional getUnderlyingTransactionType() { + public Optional getUnderlyingTransactionType() { return underlyingTransactionType; } @@ -293,8 +293,7 @@ public static final class Builder { private Optional underlyingTransactionRemoteId = Optional.empty(); - private Optional underlyingTransactionType = - Optional.empty(); + private Optional underlyingTransactionType = Optional.empty(); private Optional accountingPeriod = Optional.empty(); @@ -399,14 +398,12 @@ public Builder underlyingTransactionRemoteId(String underlyingTransactionRemoteI } @JsonSetter(value = "underlying_transaction_type", nulls = Nulls.SKIP) - public Builder underlyingTransactionType( - Optional underlyingTransactionType) { + public Builder underlyingTransactionType(Optional underlyingTransactionType) { this.underlyingTransactionType = underlyingTransactionType; return this; } - public Builder underlyingTransactionType( - GeneralLedgerTransactionUnderlyingTransactionType underlyingTransactionType) { + public Builder underlyingTransactionType(UnderlyingTransactionTypeEnum underlyingTransactionType) { this.underlyingTransactionType = Optional.ofNullable(underlyingTransactionType); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionAccountingPeriod.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionAccountingPeriod.java index 585b60170..49a64c613 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -80,7 +81,7 @@ static final class Deserializer extends StdDeserializer contact; - private final Optional baseCurrency; + private final Optional baseCurrency; - private final Optional transactionCurrency; + private final Optional transactionCurrency; private final Optional exchangeRate; private final Optional description; - private final Optional> trackingCategories; + private final Optional> trackingCategories; private final String debitAmount; @@ -75,11 +75,11 @@ private GeneralLedgerTransactionLine( Optional company, Optional employee, Optional contact, - Optional baseCurrency, - Optional transactionCurrency, + Optional baseCurrency, + Optional transactionCurrency, Optional exchangeRate, Optional description, - Optional> trackingCategories, + Optional> trackingCategories, String debitAmount, String creditAmount, Optional item, @@ -475,7 +475,7 @@ public Optional getContact() { * */ @JsonProperty("base_currency") - public Optional getBaseCurrency() { + public Optional getBaseCurrency() { return baseCurrency; } @@ -791,7 +791,7 @@ public Optional getBaseCurrency() { * */ @JsonProperty("transaction_currency") - public Optional getTransactionCurrency() { + public Optional getTransactionCurrency() { return transactionCurrency; } @@ -812,7 +812,7 @@ public Optional getDescription() { } @JsonProperty("tracking_categories") - public Optional> getTrackingCategories() { + public Optional> getTrackingCategories() { return trackingCategories; } @@ -975,13 +975,13 @@ public interface _FinalStage { _FinalStage contact(GeneralLedgerTransactionLineContact contact); - _FinalStage baseCurrency(Optional baseCurrency); + _FinalStage baseCurrency(Optional baseCurrency); - _FinalStage baseCurrency(GeneralLedgerTransactionLineBaseCurrency baseCurrency); + _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency); - _FinalStage transactionCurrency(Optional transactionCurrency); + _FinalStage transactionCurrency(Optional transactionCurrency); - _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCurrency transactionCurrency); + _FinalStage transactionCurrency(TransactionCurrencyEnum transactionCurrency); _FinalStage exchangeRate(Optional exchangeRate); @@ -991,9 +991,10 @@ public interface _FinalStage { _FinalStage description(String description); - _FinalStage trackingCategories(Optional> trackingCategories); + _FinalStage trackingCategories( + Optional> trackingCategories); - _FinalStage trackingCategories(List trackingCategories); + _FinalStage trackingCategories(List trackingCategories); _FinalStage item(Optional item); @@ -1029,15 +1030,16 @@ public static final class Builder private Optional item = Optional.empty(); - private Optional> trackingCategories = Optional.empty(); + private Optional> trackingCategories = + Optional.empty(); private Optional description = Optional.empty(); private Optional exchangeRate = Optional.empty(); - private Optional transactionCurrency = Optional.empty(); + private Optional transactionCurrency = Optional.empty(); - private Optional baseCurrency = Optional.empty(); + private Optional baseCurrency = Optional.empty(); private Optional contact = Optional.empty(); @@ -1157,14 +1159,16 @@ public _FinalStage item(Optional item) { } @java.lang.Override - public _FinalStage trackingCategories(List trackingCategories) { + public _FinalStage trackingCategories( + List trackingCategories) { this.trackingCategories = Optional.ofNullable(trackingCategories); return this; } @java.lang.Override @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) - public _FinalStage trackingCategories(Optional> trackingCategories) { + public _FinalStage trackingCategories( + Optional> trackingCategories) { this.trackingCategories = trackingCategories; return this; } @@ -1516,15 +1520,14 @@ public _FinalStage exchangeRate(Optional exchangeRate) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCurrency transactionCurrency) { + public _FinalStage transactionCurrency(TransactionCurrencyEnum transactionCurrency) { this.transactionCurrency = Optional.ofNullable(transactionCurrency); return this; } @java.lang.Override @JsonSetter(value = "transaction_currency", nulls = Nulls.SKIP) - public _FinalStage transactionCurrency( - Optional transactionCurrency) { + public _FinalStage transactionCurrency(Optional transactionCurrency) { this.transactionCurrency = transactionCurrency; return this; } @@ -1842,14 +1845,14 @@ public _FinalStage transactionCurrency( * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage baseCurrency(GeneralLedgerTransactionLineBaseCurrency baseCurrency) { + public _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency) { this.baseCurrency = Optional.ofNullable(baseCurrency); return this; } @java.lang.Override @JsonSetter(value = "base_currency", nulls = Nulls.SKIP) - public _FinalStage baseCurrency(Optional baseCurrency) { + public _FinalStage baseCurrency(Optional baseCurrency) { this.baseCurrency = baseCurrency; return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineAccount.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineAccount.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineAccount.java rename to src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineAccount.java index 58277e520..d4d6ecace 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineAccount.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLineTrackingCategoriesItem + && equalTo((GeneralLedgerTransactionLineTrackingCategoriesItem) other); + } + + private boolean equalTo(GeneralLedgerTransactionLineTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionLineTrackingCategoriesItem of(String value) { + return new GeneralLedgerTransactionLineTrackingCategoriesItem(value, 0); + } + + public static GeneralLedgerTransactionLineTrackingCategoriesItem of(TrackingCategory value) { + return new GeneralLedgerTransactionLineTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionLineTrackingCategoriesItem.class); + } + + @java.lang.Override + public GeneralLedgerTransactionLineTrackingCategoriesItem deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TrackingCategory.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java index 9a44eebbc..c9ec8b74e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional companyId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class GeneralLedgerTransactionsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -53,11 +54,11 @@ public final class GeneralLedgerTransactionsListRequest { private final Map additionalProperties; private GeneralLedgerTransactionsListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -68,11 +69,11 @@ private GeneralLedgerTransactionsListRequest( Optional postedDateBefore, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -85,6 +86,14 @@ private GeneralLedgerTransactionsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return general ledger transactions for this company. */ @@ -117,14 +126,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -210,11 +211,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(GeneralLedgerTransactionsListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -229,11 +230,11 @@ private boolean equalTo(GeneralLedgerTransactionsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -256,6 +257,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -264,8 +267,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -290,11 +291,11 @@ public static final class Builder { private Builder() {} public Builder from(GeneralLedgerTransactionsListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -307,6 +308,22 @@ public Builder from(GeneralLedgerTransactionsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(GeneralLedgerTransactionsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -351,17 +368,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(GeneralLedgerTransactionsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -463,11 +469,11 @@ public Builder remoteId(String remoteId) { public GeneralLedgerTransactionsListRequest build() { return new GeneralLedgerTransactionsListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequestExpandItem.java new file mode 100644 index 000000000..5d930f231 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GeneralLedgerTransactionsListRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + GENERAL_LEDGER_TRANSACTION_LINES("general_ledger_transaction_lines"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + GeneralLedgerTransactionsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsRetrieveRequest.java new file mode 100644 index 000000000..7d0416684 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsRetrieveRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GeneralLedgerTransactionsRetrieveRequest.Builder.class) +public final class GeneralLedgerTransactionsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private GeneralLedgerTransactionsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionsRetrieveRequest + && equalTo((GeneralLedgerTransactionsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GeneralLedgerTransactionsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GeneralLedgerTransactionsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(GeneralLedgerTransactionsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public GeneralLedgerTransactionsRetrieveRequest build() { + return new GeneralLedgerTransactionsRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..bfd381044 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsRetrieveRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GeneralLedgerTransactionsRetrieveRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + GENERAL_LEDGER_TRANSACTION_LINES("general_ledger_transaction_lines"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + GeneralLedgerTransactionsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/accounting/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..d8a316a57 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/IncomeStatement.java b/src/main/java/com/merge/api/accounting/types/IncomeStatement.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/IncomeStatement.java rename to src/main/java/com/merge/api/accounting/types/IncomeStatement.java index d9be0bf41..5d7e3f616 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/IncomeStatement.java +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatement.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class IncomeStatement { private final Optional name; - private final Optional currency; + private final Optional currency; private final Optional company; @@ -69,7 +69,7 @@ private IncomeStatement( Optional createdAt, Optional modifiedAt, Optional name, - Optional currency, + Optional currency, Optional company, Optional startPeriod, Optional endPeriod, @@ -455,7 +455,7 @@ public Optional getName() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -623,7 +623,7 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional company = Optional.empty(); @@ -735,12 +735,12 @@ public Builder name(String name) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(IncomeStatementCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/IncomeStatementCompany.java b/src/main/java/com/merge/api/accounting/types/IncomeStatementCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/IncomeStatementCompany.java rename to src/main/java/com/merge/api/accounting/types/IncomeStatementCompany.java index dfd4905bf..b7a76b291 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/IncomeStatementCompany.java +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public IncomeStatementCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public IncomeStatementCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/incomestatements/requests/IncomeStatementsListRequest.java b/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/incomestatements/requests/IncomeStatementsListRequest.java rename to src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java index a4cec14f1..e0395e0a1 100644 --- a/src/main/java/com/merge/api/resources/accounting/incomestatements/requests/IncomeStatementsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.incomestatements.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = IncomeStatementsListRequest.Builder.class) public final class IncomeStatementsListRequest { + private final Optional> expand; + private final Optional companyId; private final Optional createdAfter; @@ -29,8 +33,6 @@ public final class IncomeStatementsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -48,11 +50,11 @@ public final class IncomeStatementsListRequest { private final Map additionalProperties; private IncomeStatementsListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,11 +63,11 @@ private IncomeStatementsListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -76,6 +78,14 @@ private IncomeStatementsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return income statements for this company. */ @@ -108,14 +118,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -184,11 +186,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(IncomeStatementsListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -201,11 +203,11 @@ private boolean equalTo(IncomeStatementsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -226,6 +228,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -234,8 +238,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -256,11 +258,11 @@ public static final class Builder { private Builder() {} public Builder from(IncomeStatementsListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -271,6 +273,22 @@ public Builder from(IncomeStatementsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -315,17 +333,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -405,11 +412,11 @@ public Builder remoteId(String remoteId) { public IncomeStatementsListRequest build() { return new IncomeStatementsListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequest.java new file mode 100644 index 000000000..b67054e37 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequest.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IncomeStatementsRetrieveRequest.Builder.class) +public final class IncomeStatementsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private IncomeStatementsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IncomeStatementsRetrieveRequest && equalTo((IncomeStatementsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IncomeStatementsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IncomeStatementsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public IncomeStatementsRetrieveRequest build() { + return new IncomeStatementsRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/accounting/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..db1cc26b0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/accounting/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..4291b5bc6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Invoice.java b/src/main/java/com/merge/api/accounting/types/Invoice.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/Invoice.java rename to src/main/java/com/merge/api/accounting/types/Invoice.java index 20dde74cb..2bcee59f9 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/Invoice.java +++ b/src/main/java/com/merge/api/accounting/types/Invoice.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -31,7 +31,7 @@ public final class Invoice { private final Optional modifiedAt; - private final Optional type; + private final Optional type; private final Optional contact; @@ -49,15 +49,17 @@ public final class Invoice { private final Optional employee; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; + private final Optional paymentTerm; + private final Optional totalDiscount; private final Optional subTotal; - private final Optional status; + private final Optional status; private final Optional totalTaxAmount; @@ -100,7 +102,7 @@ private Invoice( Optional remoteId, Optional createdAt, Optional modifiedAt, - Optional type, + Optional type, Optional contact, Optional number, Optional issueDate, @@ -109,11 +111,12 @@ private Invoice( Optional memo, Optional company, Optional employee, - Optional currency, + Optional currency, Optional exchangeRate, + Optional paymentTerm, Optional totalDiscount, Optional subTotal, - Optional status, + Optional status, Optional totalTaxAmount, Optional totalAmount, Optional balance, @@ -147,6 +150,7 @@ private Invoice( this.employee = employee; this.currency = currency; this.exchangeRate = exchangeRate; + this.paymentTerm = paymentTerm; this.totalDiscount = totalDiscount; this.subTotal = subTotal; this.status = status; @@ -207,7 +211,7 @@ public Optional getModifiedAt() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -587,7 +591,7 @@ public Optional getEmployee() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -599,6 +603,14 @@ public Optional getExchangeRate() { return exchangeRate; } + /** + * @return The payment term that applies to this transaction. + */ + @JsonProperty("payment_term") + public Optional getPaymentTerm() { + return paymentTerm; + } + /** * @return The total discounts applied to the total cost. */ @@ -627,7 +639,7 @@ public Optional getSubTotal() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -776,6 +788,7 @@ private boolean equalTo(Invoice other) { && employee.equals(other.employee) && currency.equals(other.currency) && exchangeRate.equals(other.exchangeRate) + && paymentTerm.equals(other.paymentTerm) && totalDiscount.equals(other.totalDiscount) && subTotal.equals(other.subTotal) && status.equals(other.status) @@ -816,6 +829,7 @@ public int hashCode() { this.employee, this.currency, this.exchangeRate, + this.paymentTerm, this.totalDiscount, this.subTotal, this.status, @@ -857,7 +871,7 @@ public static final class Builder { private Optional modifiedAt = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional contact = Optional.empty(); @@ -875,15 +889,17 @@ public static final class Builder { private Optional employee = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); + private Optional paymentTerm = Optional.empty(); + private Optional totalDiscount = Optional.empty(); private Optional subTotal = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional totalTaxAmount = Optional.empty(); @@ -940,6 +956,7 @@ public Builder from(Invoice other) { employee(other.getEmployee()); currency(other.getCurrency()); exchangeRate(other.getExchangeRate()); + paymentTerm(other.getPaymentTerm()); totalDiscount(other.getTotalDiscount()); subTotal(other.getSubTotal()); status(other.getStatus()); @@ -1008,12 +1025,12 @@ public Builder modifiedAt(OffsetDateTime modifiedAt) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(InvoiceType type) { + public Builder type(InvoiceTypeEnum type) { this.type = Optional.ofNullable(type); return this; } @@ -1107,12 +1124,12 @@ public Builder employee(InvoiceEmployee employee) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(InvoiceCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -1128,6 +1145,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + @JsonSetter(value = "payment_term", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(InvoicePaymentTerm paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + @JsonSetter(value = "total_discount", nulls = Nulls.SKIP) public Builder totalDiscount(Optional totalDiscount) { this.totalDiscount = totalDiscount; @@ -1151,12 +1179,12 @@ public Builder subTotal(Double subTotal) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(InvoiceStatus status) { + public Builder status(InvoiceStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -1365,6 +1393,7 @@ public Invoice build() { employee, currency, exchangeRate, + paymentTerm, totalDiscount, subTotal, status, diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/InvoiceAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/InvoiceAccountingPeriod.java index 9ae01ab84..8da766438 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public InvoiceAccountingPeriod deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceAccountingPeriod deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceAppliedCreditNotesItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceAppliedCreditNotesItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceAppliedCreditNotesItem.java rename to src/main/java/com/merge/api/accounting/types/InvoiceAppliedCreditNotesItem.java index 5b9706a94..323a7daec 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceAppliedCreditNotesItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceAppliedCreditNotesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public InvoiceCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceContact.java b/src/main/java/com/merge/api/accounting/types/InvoiceContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceContact.java rename to src/main/java/com/merge/api/accounting/types/InvoiceContact.java index bfa96d977..646d04a05 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceContact.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public InvoiceContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceEmployee.java b/src/main/java/com/merge/api/accounting/types/InvoiceEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceEmployee.java rename to src/main/java/com/merge/api/accounting/types/InvoiceEmployee.java index cf97d6c69..fca7981b3 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public InvoiceEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoiceEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/InvoiceEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoiceEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/InvoiceEndpointRequest.java index d48bac47d..425868a5b 100644 --- a/src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoiceEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.invoices.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.InvoiceRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItem.java rename to src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java index 8a4571e27..659a3f5d1 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -41,7 +41,7 @@ public final class InvoiceLineItem { private final Optional employee; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -75,7 +75,7 @@ private InvoiceLineItem( Optional quantity, Optional totalAmount, Optional employee, - Optional currency, + Optional currency, Optional exchangeRate, Optional item, Optional account, @@ -491,7 +491,7 @@ public Optional getEmployee() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -648,7 +648,7 @@ public static final class Builder { private Optional employee = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -799,12 +799,12 @@ public Builder employee(InvoiceLineItemEmployee employee) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(InvoiceLineItemCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemAccount.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemAccount.java rename to src/main/java/com/merge/api/accounting/types/InvoiceLineItemAccount.java index 9ac9f30d3..0185616ca 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemAccount.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public InvoiceLineItemAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceLineItemAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemEmployee.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemEmployee.java rename to src/main/java/com/merge/api/accounting/types/InvoiceLineItemEmployee.java index 910fbc88b..371229f2a 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public InvoiceLineItemEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceLineItemEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemItem.java rename to src/main/java/com/merge/api/accounting/types/InvoiceLineItemItem.java index d4dcea829..04ed6e079 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public InvoiceLineItemItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceLineItemItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequest.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequest.java rename to src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java index 23a54607d..6701e050c 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -34,7 +34,7 @@ public final class InvoiceLineItemRequest { private final Optional employee; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -65,7 +65,7 @@ private InvoiceLineItemRequest( Optional quantity, Optional totalAmount, Optional employee, - Optional currency, + Optional currency, Optional exchangeRate, Optional item, Optional account, @@ -457,7 +457,7 @@ public Optional getEmployee() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -599,7 +599,7 @@ public static final class Builder { private Optional employee = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -715,12 +715,12 @@ public Builder employee(InvoiceLineItemRequestEmployee employee) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(InvoiceLineItemRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequestAccount.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequestAccount.java index 43804c753..1b0f95300 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentTerm) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicePaymentTerm && equalTo((InvoicePaymentTerm) other); + } + + private boolean equalTo(InvoicePaymentTerm other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static InvoicePaymentTerm of(String value) { + return new InvoicePaymentTerm(value, 0); + } + + public static InvoicePaymentTerm of(PaymentTerm value) { + return new InvoicePaymentTerm(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentTerm value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoicePaymentTerm.class); + } + + @java.lang.Override + public InvoicePaymentTerm deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTerm.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoicePaymentsItem.java b/src/main/java/com/merge/api/accounting/types/InvoicePaymentsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoicePaymentsItem.java rename to src/main/java/com/merge/api/accounting/types/InvoicePaymentsItem.java index 0edb30e83..f408141d0 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoicePaymentsItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicePaymentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public InvoicePaymentsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoicePaymentsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoicePurchaseOrdersItem.java b/src/main/java/com/merge/api/accounting/types/InvoicePurchaseOrdersItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoicePurchaseOrdersItem.java rename to src/main/java/com/merge/api/accounting/types/InvoicePurchaseOrdersItem.java index 55156a0c8..b209cf6ed 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoicePurchaseOrdersItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicePurchaseOrdersItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer type; + private final Optional type; private final Optional contact; @@ -39,11 +39,11 @@ public final class InvoiceRequest { private final Optional memo; - private final Optional status; + private final Optional status; private final Optional company; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -51,6 +51,8 @@ public final class InvoiceRequest { private final Optional subTotal; + private final Optional paymentTerm; + private final Optional totalTaxAmount; private final Optional inclusiveOfTax; @@ -76,7 +78,7 @@ public final class InvoiceRequest { private final Map additionalProperties; private InvoiceRequest( - Optional type, + Optional type, Optional contact, Optional number, Optional issueDate, @@ -84,12 +86,13 @@ private InvoiceRequest( Optional paidOnDate, Optional employee, Optional memo, - Optional status, + Optional status, Optional company, - Optional currency, + Optional currency, Optional exchangeRate, Optional totalDiscount, Optional subTotal, + Optional paymentTerm, Optional totalTaxAmount, Optional inclusiveOfTax, Optional totalAmount, @@ -116,6 +119,7 @@ private InvoiceRequest( this.exchangeRate = exchangeRate; this.totalDiscount = totalDiscount; this.subTotal = subTotal; + this.paymentTerm = paymentTerm; this.totalTaxAmount = totalTaxAmount; this.inclusiveOfTax = inclusiveOfTax; this.totalAmount = totalAmount; @@ -138,7 +142,7 @@ private InvoiceRequest( * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -210,7 +214,7 @@ public Optional getMemo() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -534,7 +538,7 @@ public Optional getCompany() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -562,6 +566,14 @@ public Optional getSubTotal() { return subTotal; } + /** + * @return The payment term that applies to this transaction. + */ + @JsonProperty("payment_term") + public Optional getPaymentTerm() { + return paymentTerm; + } + /** * @return The total amount being paid in taxes. */ @@ -658,6 +670,7 @@ private boolean equalTo(InvoiceRequest other) { && exchangeRate.equals(other.exchangeRate) && totalDiscount.equals(other.totalDiscount) && subTotal.equals(other.subTotal) + && paymentTerm.equals(other.paymentTerm) && totalTaxAmount.equals(other.totalTaxAmount) && inclusiveOfTax.equals(other.inclusiveOfTax) && totalAmount.equals(other.totalAmount) @@ -688,6 +701,7 @@ public int hashCode() { this.exchangeRate, this.totalDiscount, this.subTotal, + this.paymentTerm, this.totalTaxAmount, this.inclusiveOfTax, this.totalAmount, @@ -712,7 +726,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional contact = Optional.empty(); @@ -728,11 +742,11 @@ public static final class Builder { private Optional memo = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional company = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -740,6 +754,8 @@ public static final class Builder { private Optional subTotal = Optional.empty(); + private Optional paymentTerm = Optional.empty(); + private Optional totalTaxAmount = Optional.empty(); private Optional inclusiveOfTax = Optional.empty(); @@ -782,6 +798,7 @@ public Builder from(InvoiceRequest other) { exchangeRate(other.getExchangeRate()); totalDiscount(other.getTotalDiscount()); subTotal(other.getSubTotal()); + paymentTerm(other.getPaymentTerm()); totalTaxAmount(other.getTotalTaxAmount()); inclusiveOfTax(other.getInclusiveOfTax()); totalAmount(other.getTotalAmount()); @@ -797,12 +814,12 @@ public Builder from(InvoiceRequest other) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(InvoiceRequestType type) { + public Builder type(InvoiceTypeEnum type) { this.type = Optional.ofNullable(type); return this; } @@ -885,12 +902,12 @@ public Builder memo(String memo) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(InvoiceRequestStatus status) { + public Builder status(InvoiceStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -907,12 +924,12 @@ public Builder company(InvoiceRequestCompany company) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(InvoiceRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -950,6 +967,17 @@ public Builder subTotal(Double subTotal) { return this; } + @JsonSetter(value = "payment_term", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(InvoiceRequestPaymentTerm paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + @JsonSetter(value = "total_tax_amount", nulls = Nulls.SKIP) public Builder totalTaxAmount(Optional totalTaxAmount) { this.totalTaxAmount = totalTaxAmount; @@ -1088,6 +1116,7 @@ public InvoiceRequest build() { exchangeRate, totalDiscount, subTotal, + paymentTerm, totalTaxAmount, inclusiveOfTax, totalAmount, diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestCompany.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequestCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestCompany.java rename to src/main/java/com/merge/api/accounting/types/InvoiceRequestCompany.java index c2359870a..b19ed4d43 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestCompany.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequestCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public InvoiceRequestCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestContact.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequestContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestContact.java rename to src/main/java/com/merge/api/accounting/types/InvoiceRequestContact.java index 5dcca38bc..2ddd42f06 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestContact.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequestContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public InvoiceRequestContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestEmployee.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequestEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestEmployee.java rename to src/main/java/com/merge/api/accounting/types/InvoiceRequestEmployee.java index 47c557740..627dcbe86 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequestEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public InvoiceRequestEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public InvoiceRequestEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceRequestPaymentTerm.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequestPaymentTerm.java new file mode 100644 index 000000000..b4572b5ea --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequestPaymentTerm.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestPaymentTerm.Deserializer.class) +public final class InvoiceRequestPaymentTerm { + private final Object value; + + private final int type; + + private InvoiceRequestPaymentTerm(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentTerm) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestPaymentTerm && equalTo((InvoiceRequestPaymentTerm) other); + } + + private boolean equalTo(InvoiceRequestPaymentTerm other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestPaymentTerm of(String value) { + return new InvoiceRequestPaymentTerm(value, 0); + } + + public static InvoiceRequestPaymentTerm of(PaymentTerm value) { + return new InvoiceRequestPaymentTerm(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentTerm value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestPaymentTerm.class); + } + + @java.lang.Override + public InvoiceRequestPaymentTerm deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTerm.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestPaymentsItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequestPaymentsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestPaymentsItem.java rename to src/main/java/com/merge/api/accounting/types/InvoiceRequestPaymentsItem.java index ff2e92129..92c88b2cd 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestPaymentsItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequestPaymentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional companyId; private final Optional contactId; @@ -34,8 +35,6 @@ public final class InvoicesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -69,12 +68,12 @@ public final class InvoicesListRequest { private final Map additionalProperties; private InvoicesListRequest( + Optional> expand, Optional companyId, Optional contactId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -91,12 +90,12 @@ private InvoicesListRequest( Optional status, Optional type, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.contactId = contactId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -115,6 +114,14 @@ private InvoicesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return invoices for this company. */ @@ -155,14 +162,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -307,12 +306,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(InvoicesListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && contactId.equals(other.contactId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -333,12 +332,12 @@ private boolean equalTo(InvoicesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.contactId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -367,6 +366,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional contactId = Optional.empty(); @@ -377,8 +378,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -415,12 +414,12 @@ public static final class Builder { private Builder() {} public Builder from(InvoicesListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); contactId(other.getContactId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -439,6 +438,22 @@ public Builder from(InvoicesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(InvoicesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -494,17 +509,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(InvoicesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -672,12 +676,12 @@ public Builder type(InvoicesListRequestType type) { public InvoicesListRequest build() { return new InvoicesListRequest( + expand, companyId, contactId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestExpandItem.java new file mode 100644 index 000000000..8c31a2599 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestExpandItem.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InvoicesListRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_CREDIT_NOTES("applied_credit_notes"), + + APPLIED_PAYMENTS("applied_payments"), + + APPLIED_VENDOR_CREDITS("applied_vendor_credits"), + + COMPANY("company"), + + CONTACT("contact"), + + EMPLOYEE("employee"), + + LINE_ITEMS("line_items"), + + PAYMENT_TERM("payment_term"), + + PAYMENTS("payments"), + + PURCHASE_ORDERS("purchase_orders"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + InvoicesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestStatus.java b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestStatus.java similarity index 90% rename from src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestStatus.java rename to src/main/java/com/merge/api/accounting/types/InvoicesListRequestStatus.java index 7111c0f64..f094e8a87 100644 --- a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestStatus.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestStatus.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.invoices.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestType.java b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestType.java similarity index 88% rename from src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestType.java rename to src/main/java/com/merge/api/accounting/types/InvoicesListRequestType.java index 8603dc95c..40c2fb877 100644 --- a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestType.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.invoices.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoicesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoicesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java index daff114e1..685970c2c 100644 --- a/src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoicesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.invoices.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoicesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequest.java similarity index 77% rename from src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoicesRetrieveRequest.java rename to src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequest.java index eb21d1c80..a8cf26b6f 100644 --- a/src/main/java/com/merge/api/resources/accounting/invoices/requests/InvoicesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.invoices.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.invoices.types.InvoicesRetrieveRequestExpand; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,12 +22,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = InvoicesRetrieveRequest.Builder.class) public final class InvoicesRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeRemoteFields; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -34,15 +37,17 @@ public final class InvoicesRetrieveRequest { private final Map additionalProperties; private InvoicesRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, Optional includeRemoteFields, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -52,7 +57,7 @@ private InvoicesRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -72,6 +77,14 @@ public Optional getIncludeRemoteFields() { return includeRemoteFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -103,6 +116,7 @@ private boolean equalTo(InvoicesRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @@ -110,7 +124,12 @@ private boolean equalTo(InvoicesRetrieveRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + this.expand, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); } @java.lang.Override @@ -124,12 +143,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); private Optional includeRemoteFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -143,22 +164,28 @@ public Builder from(InvoicesRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(InvoicesRetrieveRequestExpand expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(InvoicesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -181,6 +208,17 @@ public Builder includeRemoteFields(Boolean includeRemoteFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -208,6 +246,7 @@ public InvoicesRetrieveRequest build() { expand, includeRemoteData, includeRemoteFields, + includeShellData, remoteFields, showEnumOrigins, additionalProperties); diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..794da45c5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestExpandItem.java @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InvoicesRetrieveRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_CREDIT_NOTES("applied_credit_notes"), + + APPLIED_PAYMENTS("applied_payments"), + + APPLIED_VENDOR_CREDITS("applied_vendor_credits"), + + COMPANY("company"), + + CONTACT("contact"), + + EMPLOYEE("employee"), + + LINE_ITEMS("line_items"), + + PAYMENT_TERM("payment_term"), + + PAYMENTS("payments"), + + PURCHASE_ORDERS("purchase_orders"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + InvoicesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/Issue.java b/src/main/java/com/merge/api/accounting/types/Issue.java new file mode 100644 index 000000000..b40ad40f5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/Issue.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage status(Optional status); + + _FinalStage status(IssueStatusEnum status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

+ *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/IssueStatusEnum.java b/src/main/java/com/merge/api/accounting/types/IssueStatusEnum.java new file mode 100644 index 000000000..3abd62e27 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssueStatusEnum { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssueStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java b/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java new file mode 100644 index 000000000..154ce0159 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/accounting/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..c27537fc4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssuesListRequestStatus { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssuesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Item.java b/src/main/java/com/merge/api/accounting/types/Item.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/Item.java rename to src/main/java/com/merge/api/accounting/types/Item.java index 6371309fe..975bbaf20 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/Item.java +++ b/src/main/java/com/merge/api/accounting/types/Item.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class Item { private final Optional name; - private final Optional status; + private final Optional status; private final Optional unitPrice; @@ -65,7 +65,7 @@ private Item( Optional createdAt, Optional modifiedAt, Optional name, - Optional status, + Optional status, Optional unitPrice, Optional purchasePrice, Optional purchaseAccount, @@ -143,7 +143,7 @@ public Optional getName() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -303,7 +303,7 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional unitPrice = Optional.empty(); @@ -409,12 +409,12 @@ public Builder name(String name) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(ItemStatus status) { + public Builder status(Status7D1Enum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemCompany.java b/src/main/java/com/merge/api/accounting/types/ItemCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ItemCompany.java rename to src/main/java/com/merge/api/accounting/types/ItemCompany.java index 96f67343e..635148952 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemCompany.java +++ b/src/main/java/com/merge/api/accounting/types/ItemCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ItemCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ItemCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/accounting/types/ItemFormatEnum.java b/src/main/java/com/merge/api/accounting/types/ItemFormatEnum.java new file mode 100644 index 000000000..8b917a55a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemFormatEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + ItemFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemPurchaseAccount.java b/src/main/java/com/merge/api/accounting/types/ItemPurchaseAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ItemPurchaseAccount.java rename to src/main/java/com/merge/api/accounting/types/ItemPurchaseAccount.java index 7ff419ea4..98964416b 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemPurchaseAccount.java +++ b/src/main/java/com/merge/api/accounting/types/ItemPurchaseAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ItemPurchaseAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ItemPurchaseAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemPurchaseTaxRate.java b/src/main/java/com/merge/api/accounting/types/ItemPurchaseTaxRate.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ItemPurchaseTaxRate.java rename to src/main/java/com/merge/api/accounting/types/ItemPurchaseTaxRate.java index 8d8130ac0..9033ea93f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemPurchaseTaxRate.java +++ b/src/main/java/com/merge/api/accounting/types/ItemPurchaseTaxRate.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ItemPurchaseTaxRate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ItemPurchaseTaxRate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemSalesAccount.java b/src/main/java/com/merge/api/accounting/types/ItemSalesAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ItemSalesAccount.java rename to src/main/java/com/merge/api/accounting/types/ItemSalesAccount.java index 0561c1eef..0e41fedfe 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemSalesAccount.java +++ b/src/main/java/com/merge/api/accounting/types/ItemSalesAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ItemSalesAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ItemSalesAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemSalesTaxRate.java b/src/main/java/com/merge/api/accounting/types/ItemSalesTaxRate.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/ItemSalesTaxRate.java rename to src/main/java/com/merge/api/accounting/types/ItemSalesTaxRate.java index 4a67beb71..d92235f46 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemSalesTaxRate.java +++ b/src/main/java/com/merge/api/accounting/types/ItemSalesTaxRate.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ItemSalesTaxRate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ItemSalesTaxRate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/accounting/types/ItemSchema.java b/src/main/java/com/merge/api/accounting/types/ItemSchema.java new file mode 100644 index 000000000..8471cb605 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemSchema.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemSchema.Builder.class) +public final class ItemSchema { + private final Optional itemType; + + private final Optional itemFormat; + + private final Optional> itemChoices; + + private final Map additionalProperties; + + private ItemSchema( + Optional itemType, + Optional itemFormat, + Optional> itemChoices, + Map additionalProperties) { + this.itemType = itemType; + this.itemFormat = itemFormat; + this.itemChoices = itemChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("item_type") + public Optional getItemType() { + return itemType; + } + + @JsonProperty("item_format") + public Optional getItemFormat() { + return itemFormat; + } + + @JsonProperty("item_choices") + public Optional> getItemChoices() { + return itemChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemSchema && equalTo((ItemSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemSchema other) { + return itemType.equals(other.itemType) + && itemFormat.equals(other.itemFormat) + && itemChoices.equals(other.itemChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional itemType = Optional.empty(); + + private Optional itemFormat = Optional.empty(); + + private Optional> itemChoices = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemSchema other) { + itemType(other.getItemType()); + itemFormat(other.getItemFormat()); + itemChoices(other.getItemChoices()); + return this; + } + + @JsonSetter(value = "item_type", nulls = Nulls.SKIP) + public Builder itemType(Optional itemType) { + this.itemType = itemType; + return this; + } + + public Builder itemType(ItemTypeEnum itemType) { + this.itemType = Optional.ofNullable(itemType); + return this; + } + + @JsonSetter(value = "item_format", nulls = Nulls.SKIP) + public Builder itemFormat(Optional itemFormat) { + this.itemFormat = itemFormat; + return this; + } + + public Builder itemFormat(ItemFormatEnum itemFormat) { + this.itemFormat = Optional.ofNullable(itemFormat); + return this; + } + + @JsonSetter(value = "item_choices", nulls = Nulls.SKIP) + public Builder itemChoices(Optional> itemChoices) { + this.itemChoices = itemChoices; + return this; + } + + public Builder itemChoices(List itemChoices) { + this.itemChoices = Optional.ofNullable(itemChoices); + return this; + } + + public ItemSchema build() { + return new ItemSchema(itemType, itemFormat, itemChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemTypeEnum.java b/src/main/java/com/merge/api/accounting/types/ItemTypeEnum.java new file mode 100644 index 000000000..ea27bb66c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemTypeEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + ItemTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/items/requests/ItemsListRequest.java b/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/items/requests/ItemsListRequest.java rename to src/main/java/com/merge/api/accounting/types/ItemsListRequest.java index 8116647af..655dcfc8e 100644 --- a/src/main/java/com/merge/api/resources/accounting/items/requests/ItemsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.items.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.items.types.ItemsListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ItemsListRequest.Builder.class) public final class ItemsListRequest { + private final Optional> expand; + private final Optional companyId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class ItemsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -53,11 +54,11 @@ public final class ItemsListRequest { private final Map additionalProperties; private ItemsListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -68,11 +69,11 @@ private ItemsListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -85,6 +86,14 @@ private ItemsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return items for this company. */ @@ -117,14 +126,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -209,11 +210,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(ItemsListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -228,11 +229,11 @@ private boolean equalTo(ItemsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -255,6 +256,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -263,8 +266,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -289,11 +290,11 @@ public static final class Builder { private Builder() {} public Builder from(ItemsListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -306,6 +307,22 @@ public Builder from(ItemsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ItemsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -350,17 +367,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ItemsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -462,11 +468,11 @@ public Builder showEnumOrigins(String showEnumOrigins) { public ItemsListRequest build() { return new ItemsListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/ItemsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ItemsListRequestExpandItem.java new file mode 100644 index 000000000..5bc688daa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsListRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemsListRequestExpandItem { + COMPANY("company"), + + PURCHASE_ACCOUNT("purchase_account"), + + PURCHASE_TAX_RATE("purchase_tax_rate"), + + SALES_ACCOUNT("sales_account"), + + SALES_TAX_RATE("sales_tax_rate"); + + private final String value; + + ItemsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequest.java new file mode 100644 index 000000000..43ac4857d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemsRetrieveRequest.Builder.class) +public final class ItemsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private ItemsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemsRetrieveRequest && equalTo((ItemsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ItemsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public ItemsRetrieveRequest build() { + return new ItemsRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..65914eed2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemsRetrieveRequestExpandItem { + COMPANY("company"), + + PURCHASE_ACCOUNT("purchase_account"), + + PURCHASE_TAX_RATE("purchase_tax_rate"), + + SALES_ACCOUNT("sales_account"), + + SALES_TAX_RATE("sales_tax_rate"); + + private final String value; + + ItemsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesLinesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java index 0a5e24567..a02c8bfff 100644 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesLinesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.journalentries.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesListRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesListRequest.java rename to src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java index c4302e359..9aa496330 100644 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.journalentries.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.journalentries.types.JournalEntriesListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JournalEntriesListRequest.Builder.class) public final class JournalEntriesListRequest { + private final Optional> expand; + private final Optional companyId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class JournalEntriesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -55,11 +56,11 @@ public final class JournalEntriesListRequest { private final Map additionalProperties; private JournalEntriesListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -71,11 +72,11 @@ private JournalEntriesListRequest( Optional transactionDateAfter, Optional transactionDateBefore, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -89,6 +90,14 @@ private JournalEntriesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return journal entries for this company. */ @@ -121,14 +130,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -221,11 +222,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(JournalEntriesListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -241,11 +242,11 @@ private boolean equalTo(JournalEntriesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -269,6 +270,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -277,8 +280,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -305,11 +306,11 @@ public static final class Builder { private Builder() {} public Builder from(JournalEntriesListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -323,6 +324,22 @@ public Builder from(JournalEntriesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(JournalEntriesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -367,17 +384,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(JournalEntriesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -490,11 +496,11 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { public JournalEntriesListRequest build() { return new JournalEntriesListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequestExpandItem.java new file mode 100644 index 000000000..6154cfefd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequestExpandItem.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JournalEntriesListRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_PAYMENTS("applied_payments"), + + COMPANY("company"), + + LINES("lines"), + + PAYMENTS("payments"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + JournalEntriesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java index 1f507ac36..92de713d0 100644 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.journalentries.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntriesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesRetrieveRequest.java new file mode 100644 index 000000000..e7edfb7fe --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JournalEntriesRetrieveRequest.Builder.class) +public final class JournalEntriesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private JournalEntriesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntriesRetrieveRequest && equalTo((JournalEntriesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JournalEntriesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(JournalEntriesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(JournalEntriesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public JournalEntriesRetrieveRequest build() { + return new JournalEntriesRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntriesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..70d051527 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesRetrieveRequestExpandItem.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JournalEntriesRetrieveRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_PAYMENTS("applied_payments"), + + COMPANY("company"), + + LINES("lines"), + + PAYMENTS("payments"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + JournalEntriesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntry.java b/src/main/java/com/merge/api/accounting/types/JournalEntry.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/types/JournalEntry.java rename to src/main/java/com/merge/api/accounting/types/JournalEntry.java index 9f95858e4..6b992d3a2 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntry.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntry.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -39,7 +39,7 @@ public final class JournalEntry { private final Optional memo; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -55,7 +55,7 @@ public final class JournalEntry { private final Optional remoteWasDeleted; - private final Optional postingStatus; + private final Optional postingStatus; private final Optional accountingPeriod; @@ -80,7 +80,7 @@ private JournalEntry( Optional>> payments, Optional>> appliedPayments, Optional memo, - Optional currency, + Optional currency, Optional exchangeRate, Optional company, Optional inclusiveOfTax, @@ -88,7 +88,7 @@ private JournalEntry( Optional journalNumber, Optional>> trackingCategories, Optional remoteWasDeleted, - Optional postingStatus, + Optional postingStatus, Optional accountingPeriod, Optional remoteCreatedAt, Optional remoteUpdatedAt, @@ -495,7 +495,7 @@ public Optional getMemo() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -557,7 +557,7 @@ public Optional getRemoteWasDeleted() { * */ @JsonProperty("posting_status") - public Optional getPostingStatus() { + public Optional getPostingStatus() { return postingStatus; } @@ -692,7 +692,7 @@ public static final class Builder { private Optional memo = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -708,7 +708,7 @@ public static final class Builder { private Optional remoteWasDeleted = Optional.empty(); - private Optional postingStatus = Optional.empty(); + private Optional postingStatus = Optional.empty(); private Optional accountingPeriod = Optional.empty(); @@ -843,12 +843,12 @@ public Builder memo(String memo) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(JournalEntryCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -932,12 +932,12 @@ public Builder remoteWasDeleted(Boolean remoteWasDeleted) { } @JsonSetter(value = "posting_status", nulls = Nulls.SKIP) - public Builder postingStatus(Optional postingStatus) { + public Builder postingStatus(Optional postingStatus) { this.postingStatus = postingStatus; return this; } - public Builder postingStatus(JournalEntryPostingStatus postingStatus) { + public Builder postingStatus(PostingStatusEnum postingStatus) { this.postingStatus = Optional.ofNullable(postingStatus); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/JournalEntryAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/JournalEntryAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/JournalEntryAccountingPeriod.java index 0b7de18bd..4980067f0 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JournalEntryCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JournalEntryCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntryEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntryEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntryEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/JournalEntryEndpointRequest.java index 5ae3bb00b..156217006 100644 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntryEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.journalentries.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.JournalEntryRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryPaymentsItem.java b/src/main/java/com/merge/api/accounting/types/JournalEntryPaymentsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/JournalEntryPaymentsItem.java rename to src/main/java/com/merge/api/accounting/types/JournalEntryPaymentsItem.java index 288b19f5e..c3eaeb32c 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryPaymentsItem.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryPaymentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer memo; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -43,7 +43,7 @@ public final class JournalEntryRequest { private final Optional journalNumber; - private final Optional postingStatus; + private final Optional postingStatus; private final Optional> integrationParams; @@ -57,14 +57,14 @@ private JournalEntryRequest( Optional transactionDate, Optional>> payments, Optional memo, - Optional currency, + Optional currency, Optional exchangeRate, Optional company, Optional>> trackingCategories, Optional inclusiveOfTax, Optional> lines, Optional journalNumber, - Optional postingStatus, + Optional postingStatus, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -422,7 +422,7 @@ public Optional getMemo() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -476,7 +476,7 @@ public Optional getJournalNumber() { * */ @JsonProperty("posting_status") - public Optional getPostingStatus() { + public Optional getPostingStatus() { return postingStatus; } @@ -559,7 +559,7 @@ public static final class Builder { private Optional memo = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -574,7 +574,7 @@ public static final class Builder { private Optional journalNumber = Optional.empty(); - private Optional postingStatus = Optional.empty(); + private Optional postingStatus = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -639,12 +639,12 @@ public Builder memo(String memo) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(JournalEntryRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -718,12 +718,12 @@ public Builder journalNumber(String journalNumber) { } @JsonSetter(value = "posting_status", nulls = Nulls.SKIP) - public Builder postingStatus(Optional postingStatus) { + public Builder postingStatus(Optional postingStatus) { this.postingStatus = postingStatus; return this; } - public Builder postingStatus(JournalEntryRequestPostingStatus postingStatus) { + public Builder postingStatus(PostingStatusEnum postingStatus) { this.postingStatus = Optional.ofNullable(postingStatus); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestCompany.java b/src/main/java/com/merge/api/accounting/types/JournalEntryRequestCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestCompany.java rename to src/main/java/com/merge/api/accounting/types/JournalEntryRequestCompany.java index fd82d2f7c..437b5b45e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestCompany.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryRequestCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer>> trackingCategories; - private final Optional currency; + private final Optional currency; private final Optional company; @@ -67,7 +67,7 @@ private JournalLine( Optional netAmount, Optional trackingCategory, Optional>> trackingCategories, - Optional currency, + Optional currency, Optional company, Optional employee, Optional contact, @@ -464,7 +464,7 @@ public Optional>> getTrackingCa * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -603,7 +603,7 @@ public static final class Builder { private Optional>> trackingCategories = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional company = Optional.empty(); @@ -737,12 +737,12 @@ public Builder trackingCategories(List currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(JournalLineCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalLineAccount.java b/src/main/java/com/merge/api/accounting/types/JournalLineAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/JournalLineAccount.java rename to src/main/java/com/merge/api/accounting/types/JournalLineAccount.java index 32d989466..f20640145 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalLineAccount.java +++ b/src/main/java/com/merge/api/accounting/types/JournalLineAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JournalLineAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JournalLineAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalLineRequest.java b/src/main/java/com/merge/api/accounting/types/JournalLineRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/JournalLineRequest.java rename to src/main/java/com/merge/api/accounting/types/JournalLineRequest.java index 40bb844a1..151745bc2 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalLineRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalLineRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,7 +32,7 @@ public final class JournalLineRequest { private final Optional>> trackingCategories; - private final Optional currency; + private final Optional currency; private final Optional company; @@ -60,7 +60,7 @@ private JournalLineRequest( Optional netAmount, Optional trackingCategory, Optional>> trackingCategories, - Optional currency, + Optional currency, Optional company, Optional employee, Optional contact, @@ -435,7 +435,7 @@ public Optional>> getTra * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -567,7 +567,7 @@ public static final class Builder { private Optional>> trackingCategories = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional company = Optional.empty(); @@ -668,12 +668,12 @@ public Builder trackingCategories(List currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(JournalLineRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalLineRequestAccount.java b/src/main/java/com/merge/api/accounting/types/JournalLineRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/JournalLineRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/JournalLineRequestAccount.java index d4feb2498..03df21f55 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalLineRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/JournalLineRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/accounting/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..9fdf28300 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/accounting/types/LinkedAccountStatus.java new file mode 100644 index 000000000..4de6718d8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/LinkedAccountStatus.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) +public final class LinkedAccountStatus { + private final String linkedAccountStatus; + + private final boolean canMakeRequest; + + private final Map additionalProperties; + + private LinkedAccountStatus( + String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { + this.linkedAccountStatus = linkedAccountStatus; + this.canMakeRequest = canMakeRequest; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_status") + public String getLinkedAccountStatus() { + return linkedAccountStatus; + } + + @JsonProperty("can_make_request") + public boolean getCanMakeRequest() { + return canMakeRequest; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountStatus other) { + return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountStatusStage builder() { + return new Builder(); + } + + public interface LinkedAccountStatusStage { + CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); + + Builder from(LinkedAccountStatus other); + } + + public interface CanMakeRequestStage { + _FinalStage canMakeRequest(boolean canMakeRequest); + } + + public interface _FinalStage { + LinkedAccountStatus build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { + private String linkedAccountStatus; + + private boolean canMakeRequest; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @java.lang.Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @java.lang.Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..3723ed6de --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java @@ -0,0 +1,457 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing + *
    + *
  • hris - hris
  • + *
  • ats - ats
  • + *
  • accounting - accounting
  • + *
  • ticketing - ticketing
  • + *
  • crm - crm
  • + *
  • mktg - mktg
  • + *
  • filestorage - filestorage
  • + *
+ */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..47adc372d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LinkedAccountsListRequestCategory { + ACCOUNTING("accounting"), + + ATS("ats"), + + CRM("crm"), + + FILESTORAGE("filestorage"), + + HRIS("hris"), + + MKTG("mktg"), + + TICKETING("ticketing"); + + private final String value; + + LinkedAccountsListRequestCategory(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/MetaResponse.java b/src/main/java/com/merge/api/accounting/types/MetaResponse.java new file mode 100644 index 000000000..4106103d6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/MetaResponse.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MetaResponse.Builder.class) +public final class MetaResponse { + private final Map requestSchema; + + private final Optional> remoteFieldClasses; + + private final Optional status; + + private final boolean hasConditionalParams; + + private final boolean hasRequiredLinkedAccountParams; + + private final Map additionalProperties; + + private MetaResponse( + Map requestSchema, + Optional> remoteFieldClasses, + Optional status, + boolean hasConditionalParams, + boolean hasRequiredLinkedAccountParams, + Map additionalProperties) { + this.requestSchema = requestSchema; + this.remoteFieldClasses = remoteFieldClasses; + this.status = status; + this.hasConditionalParams = hasConditionalParams; + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("request_schema") + public Map getRequestSchema() { + return requestSchema; + } + + @JsonProperty("remote_field_classes") + public Optional> getRemoteFieldClasses() { + return remoteFieldClasses; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("has_conditional_params") + public boolean getHasConditionalParams() { + return hasConditionalParams; + } + + @JsonProperty("has_required_linked_account_params") + public boolean getHasRequiredLinkedAccountParams() { + return hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MetaResponse && equalTo((MetaResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MetaResponse other) { + return requestSchema.equals(other.requestSchema) + && remoteFieldClasses.equals(other.remoteFieldClasses) + && status.equals(other.status) + && hasConditionalParams == other.hasConditionalParams + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasConditionalParamsStage builder() { + return new Builder(); + } + + public interface HasConditionalParamsStage { + HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); + + Builder from(MetaResponse other); + } + + public interface HasRequiredLinkedAccountParamsStage { + _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); + } + + public interface _FinalStage { + MetaResponse build(); + + _FinalStage requestSchema(Map requestSchema); + + _FinalStage putAllRequestSchema(Map requestSchema); + + _FinalStage requestSchema(String key, JsonNode value); + + _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); + + _FinalStage remoteFieldClasses(Map remoteFieldClasses); + + _FinalStage status(Optional status); + + _FinalStage status(LinkedAccountStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { + private boolean hasConditionalParams; + + private boolean hasRequiredLinkedAccountParams; + + private Optional status = Optional.empty(); + + private Optional> remoteFieldClasses = Optional.empty(); + + private Map requestSchema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @java.lang.Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @java.lang.Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @java.lang.Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @java.lang.Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/MethodEnum.java b/src/main/java/com/merge/api/accounting/types/MethodEnum.java new file mode 100644 index 000000000..48ec99825 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MethodEnum { + GET("GET"), + + OPTIONS("OPTIONS"), + + HEAD("HEAD"), + + POST("POST"), + + PUT("PUT"), + + PATCH("PATCH"), + + DELETE("DELETE"); + + private final String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/MethodTypeEnum.java b/src/main/java/com/merge/api/accounting/types/MethodTypeEnum.java new file mode 100644 index 000000000..1d4d5c797 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/MethodTypeEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MethodTypeEnum { + CREDIT_CARD("CREDIT_CARD"), + + DEBIT_CARD("DEBIT_CARD"), + + ACH("ACH"), + + CASH("CASH"), + + CHECK("CHECK"); + + private final String value; + + MethodTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ModelOperation.java b/src/main/java/com/merge/api/accounting/types/ModelOperation.java new file mode 100644 index 000000000..3dfa4606d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ModelOperation.java @@ -0,0 +1,226 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/accounting/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..1f9c31872 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/accounting/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..0acaf983a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..a02a7453e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(EncodingEnum encoding); + + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

The name of the form field

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

The data for the form field.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

The MIME type of the file, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

The file name of the form field, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

The encoding of the value of data. Defaults to RAW if not defined.

+ *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(EncodingEnum encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..f6e37cdd4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAccountList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountList.java new file mode 100644 index 000000000..8104c6a81 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountList.Builder.class) +public final class PaginatedAccountList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountList && equalTo((PaginatedAccountList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountList build() { + return new PaginatedAccountList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountingAttachmentList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingAttachmentList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountingAttachmentList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedAccountingAttachmentList.java index 232da42b9..63c4306a2 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountingAttachmentList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingAttachmentList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountingPeriodList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingPeriodList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountingPeriodList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedAccountingPeriodList.java index 844b047ad..83688cc50 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountingPeriodList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingPeriodList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..989ce938b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedBalanceSheetList.java b/src/main/java/com/merge/api/accounting/types/PaginatedBalanceSheetList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedBalanceSheetList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedBalanceSheetList.java index 302877405..8d5ee602e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedBalanceSheetList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedBalanceSheetList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedBankFeedAccountList.java b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedAccountList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedBankFeedAccountList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedBankFeedAccountList.java index 64b14f36e..9c953bd66 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedBankFeedAccountList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedAccountList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedBankFeedTransactionList.java b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedTransactionList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedBankFeedTransactionList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedBankFeedTransactionList.java index 906a64d86..53132d3ec 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedBankFeedTransactionList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedTransactionList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedCashFlowStatementList.java b/src/main/java/com/merge/api/accounting/types/PaginatedCashFlowStatementList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedCashFlowStatementList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedCashFlowStatementList.java index fe38803b1..7bc1fc307 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedCashFlowStatementList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedCashFlowStatementList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedCompanyInfoList.java b/src/main/java/com/merge/api/accounting/types/PaginatedCompanyInfoList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedCompanyInfoList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedCompanyInfoList.java index f54121a67..ecae22ab9 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedCompanyInfoList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedCompanyInfoList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedContactList.java b/src/main/java/com/merge/api/accounting/types/PaginatedContactList.java new file mode 100644 index 000000000..d4e311ed8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedContactList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedContactList.Builder.class) +public final class PaginatedContactList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedContactList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedContactList && equalTo((PaginatedContactList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedContactList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedContactList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedContactList build() { + return new PaginatedContactList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedCreditNoteList.java b/src/main/java/com/merge/api/accounting/types/PaginatedCreditNoteList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedCreditNoteList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedCreditNoteList.java index cf4884b88..483245729 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedCreditNoteList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedCreditNoteList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedEmployeeList.java b/src/main/java/com/merge/api/accounting/types/PaginatedEmployeeList.java new file mode 100644 index 000000000..5bda45a47 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedEmployeeList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEmployeeList.Builder.class) +public final class PaginatedEmployeeList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEmployeeList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEmployeeList && equalTo((PaginatedEmployeeList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEmployeeList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedEmployeeList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedEmployeeList build() { + return new PaginatedEmployeeList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedExpenseList.java b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedExpenseList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedExpenseList.java index b3c4f6aa6..1345682e0 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedExpenseList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedGeneralLedgerTransactionList.java b/src/main/java/com/merge/api/accounting/types/PaginatedGeneralLedgerTransactionList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedGeneralLedgerTransactionList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedGeneralLedgerTransactionList.java index e1ecb6352..c43c8976b 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedGeneralLedgerTransactionList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedGeneralLedgerTransactionList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedIncomeStatementList.java b/src/main/java/com/merge/api/accounting/types/PaginatedIncomeStatementList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedIncomeStatementList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedIncomeStatementList.java index 4d4d5570d..a9035ab04 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedIncomeStatementList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedIncomeStatementList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedInvoiceList.java b/src/main/java/com/merge/api/accounting/types/PaginatedInvoiceList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedInvoiceList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedInvoiceList.java index f7ae030af..834aaffbf 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedInvoiceList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedInvoiceList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedIssueList.java b/src/main/java/com/merge/api/accounting/types/PaginatedIssueList.java new file mode 100644 index 000000000..0c1942457 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedItemList.java b/src/main/java/com/merge/api/accounting/types/PaginatedItemList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedItemList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedItemList.java index f8b064cf3..2033687e8 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedItemList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedItemList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedJournalEntryList.java b/src/main/java/com/merge/api/accounting/types/PaginatedJournalEntryList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedJournalEntryList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedJournalEntryList.java index 57cb99dbf..501f90eea 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedJournalEntryList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedJournalEntryList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedPaymentList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedPaymentList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedPaymentList.java index 0a2928603..8c40e422b 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedPaymentList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentMethodList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentMethodList.java new file mode 100644 index 000000000..4739ebdde --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentMethodList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedPaymentMethodList.Builder.class) +public final class PaginatedPaymentMethodList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedPaymentMethodList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedPaymentMethodList && equalTo((PaginatedPaymentMethodList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedPaymentMethodList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedPaymentMethodList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedPaymentMethodList build() { + return new PaginatedPaymentMethodList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentTermList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentTermList.java new file mode 100644 index 000000000..f73c2d301 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentTermList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedPaymentTermList.Builder.class) +public final class PaginatedPaymentTermList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedPaymentTermList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedPaymentTermList && equalTo((PaginatedPaymentTermList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedPaymentTermList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedPaymentTermList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedPaymentTermList build() { + return new PaginatedPaymentTermList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedPurchaseOrderList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPurchaseOrderList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedPurchaseOrderList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedPurchaseOrderList.java index 6824b75e5..7c61f8260 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedPurchaseOrderList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPurchaseOrderList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/accounting/types/PaginatedRemoteFieldClassList.java new file mode 100644 index 000000000..dff9c4146 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedRemoteFieldClassList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedRemoteFieldClassList.Builder.class) +public final class PaginatedRemoteFieldClassList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedRemoteFieldClassList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedRemoteFieldClassList && equalTo((PaginatedRemoteFieldClassList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedRemoteFieldClassList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedRemoteFieldClassList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedRemoteFieldClassList build() { + return new PaginatedRemoteFieldClassList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/accounting/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..46152f3fd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedTaxRateList.java b/src/main/java/com/merge/api/accounting/types/PaginatedTaxRateList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedTaxRateList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedTaxRateList.java index aab33892b..f82935c7d 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedTaxRateList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedTaxRateList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedTrackingCategoryList.java b/src/main/java/com/merge/api/accounting/types/PaginatedTrackingCategoryList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedTrackingCategoryList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedTrackingCategoryList.java index 2af161033..ff1171442 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedTrackingCategoryList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedTrackingCategoryList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedTransactionList.java b/src/main/java/com/merge/api/accounting/types/PaginatedTransactionList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedTransactionList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedTransactionList.java index 161711986..cc8f83e62 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedTransactionList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedTransactionList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedVendorCreditList.java b/src/main/java/com/merge/api/accounting/types/PaginatedVendorCreditList.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/PaginatedVendorCreditList.java rename to src/main/java/com/merge/api/accounting/types/PaginatedVendorCreditList.java index f6f98b618..46d763068 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedVendorCreditList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedVendorCreditList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..0700d7468 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PatchedEditFieldMappingRequest.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) +public final class PatchedEditFieldMappingRequest { + private final Optional> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Map additionalProperties) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + return this; + } + + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/requests/PatchedInvoiceEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedInvoiceEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/invoices/requests/PatchedInvoiceEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/PatchedInvoiceEndpointRequest.java index 14bdfeec3..84811dfab 100644 --- a/src/main/java/com/merge/api/resources/accounting/invoices/requests/PatchedInvoiceEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedInvoiceEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.invoices.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.InvoiceRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/payments/requests/PatchedPaymentEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedPaymentEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/payments/requests/PatchedPaymentEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/PatchedPaymentEndpointRequest.java index 403d3fc4b..af78af8d4 100644 --- a/src/main/java/com/merge/api/resources/accounting/payments/requests/PatchedPaymentEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedPaymentEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.payments.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.PatchedPaymentRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequest.java rename to src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java index c0995751f..7e1660a83 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -29,7 +29,9 @@ public final class PatchedPaymentRequest { private final Optional account; - private final Optional currency; + private final Optional paymentMethod; + + private final Optional currency; private final Optional exchangeRate; @@ -37,7 +39,7 @@ public final class PatchedPaymentRequest { private final Optional totalAmount; - private final Optional type; + private final Optional type; private final Optional>> trackingCategories; @@ -57,11 +59,12 @@ private PatchedPaymentRequest( Optional transactionDate, Optional contact, Optional account, - Optional currency, + Optional paymentMethod, + Optional currency, Optional exchangeRate, Optional company, Optional totalAmount, - Optional type, + Optional type, Optional>> trackingCategories, Optional accountingPeriod, Optional> appliedToLines, @@ -72,6 +75,7 @@ private PatchedPaymentRequest( this.transactionDate = transactionDate; this.contact = contact; this.account = account; + this.paymentMethod = paymentMethod; this.currency = currency; this.exchangeRate = exchangeRate; this.company = company; @@ -110,6 +114,14 @@ public Optional getAccount() { return account; } + /** + * @return The method which this payment was made by. + */ + @JsonProperty("payment_method") + public Optional getPaymentMethod() { + return paymentMethod; + } + /** * @return The payment's currency. *
    @@ -422,7 +434,7 @@ public Optional getAccount() { *
*/ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -458,7 +470,7 @@ public Optional getTotalAmount() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -513,6 +525,7 @@ private boolean equalTo(PatchedPaymentRequest other) { return transactionDate.equals(other.transactionDate) && contact.equals(other.contact) && account.equals(other.account) + && paymentMethod.equals(other.paymentMethod) && currency.equals(other.currency) && exchangeRate.equals(other.exchangeRate) && company.equals(other.company) @@ -532,6 +545,7 @@ public int hashCode() { this.transactionDate, this.contact, this.account, + this.paymentMethod, this.currency, this.exchangeRate, this.company, @@ -562,7 +576,9 @@ public static final class Builder { private Optional account = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional paymentMethod = Optional.empty(); + + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -570,7 +586,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional>> trackingCategories = Optional.empty(); @@ -594,6 +610,7 @@ public Builder from(PatchedPaymentRequest other) { transactionDate(other.getTransactionDate()); contact(other.getContact()); account(other.getAccount()); + paymentMethod(other.getPaymentMethod()); currency(other.getCurrency()); exchangeRate(other.getExchangeRate()); company(other.getCompany()); @@ -641,13 +658,24 @@ public Builder account(PatchedPaymentRequestAccount account) { return this; } + @JsonSetter(value = "payment_method", nulls = Nulls.SKIP) + public Builder paymentMethod(Optional paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + public Builder paymentMethod(PatchedPaymentRequestPaymentMethod paymentMethod) { + this.paymentMethod = Optional.ofNullable(paymentMethod); + return this; + } + @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(PatchedPaymentRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -686,12 +714,12 @@ public Builder totalAmount(Double totalAmount) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(PatchedPaymentRequestType type) { + public Builder type(PaymentTypeEnum type) { this.type = Optional.ofNullable(type); return this; } @@ -769,6 +797,7 @@ public PatchedPaymentRequest build() { transactionDate, contact, account, + paymentMethod, currency, exchangeRate, company, diff --git a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestAccount.java b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccount.java index c9c8e6eba..215fc703f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentMethod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedPaymentRequestPaymentMethod + && equalTo((PatchedPaymentRequestPaymentMethod) other); + } + + private boolean equalTo(PatchedPaymentRequestPaymentMethod other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PatchedPaymentRequestPaymentMethod of(String value) { + return new PatchedPaymentRequestPaymentMethod(value, 0); + } + + public static PatchedPaymentRequestPaymentMethod of(PaymentMethod value) { + return new PatchedPaymentRequestPaymentMethod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentMethod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedPaymentRequestPaymentMethod.class); + } + + @java.lang.Override + public PatchedPaymentRequestPaymentMethod deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentMethod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java index af4214210..db9d163e9 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer account; - private final Optional currency; + private final Optional paymentMethod; + + private final Optional currency; private final Optional exchangeRate; @@ -45,7 +47,7 @@ public final class Payment { private final Optional totalAmount; - private final Optional type; + private final Optional type; private final Optional>> trackingCategories; @@ -73,11 +75,12 @@ private Payment( Optional transactionDate, Optional contact, Optional account, - Optional currency, + Optional paymentMethod, + Optional currency, Optional exchangeRate, Optional company, Optional totalAmount, - Optional type, + Optional type, Optional>> trackingCategories, Optional accountingPeriod, Optional> appliedToLines, @@ -94,6 +97,7 @@ private Payment( this.transactionDate = transactionDate; this.contact = contact; this.account = account; + this.paymentMethod = paymentMethod; this.currency = currency; this.exchangeRate = exchangeRate; this.company = company; @@ -163,6 +167,14 @@ public Optional getAccount() { return account; } + /** + * @return The method which this payment was made by. + */ + @JsonProperty("payment_method") + public Optional getPaymentMethod() { + return paymentMethod; + } + /** * @return The payment's currency. *
    @@ -475,7 +487,7 @@ public Optional getAccount() { *
*/ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -511,7 +523,7 @@ public Optional getTotalAmount() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -586,6 +598,7 @@ private boolean equalTo(Payment other) { && transactionDate.equals(other.transactionDate) && contact.equals(other.contact) && account.equals(other.account) + && paymentMethod.equals(other.paymentMethod) && currency.equals(other.currency) && exchangeRate.equals(other.exchangeRate) && company.equals(other.company) @@ -611,6 +624,7 @@ public int hashCode() { this.transactionDate, this.contact, this.account, + this.paymentMethod, this.currency, this.exchangeRate, this.company, @@ -651,7 +665,9 @@ public static final class Builder { private Optional account = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional paymentMethod = Optional.empty(); + + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -659,7 +675,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional>> trackingCategories = Optional.empty(); @@ -690,6 +706,7 @@ public Builder from(Payment other) { transactionDate(other.getTransactionDate()); contact(other.getContact()); account(other.getAccount()); + paymentMethod(other.getPaymentMethod()); currency(other.getCurrency()); exchangeRate(other.getExchangeRate()); company(other.getCompany()); @@ -783,13 +800,24 @@ public Builder account(PaymentAccount account) { return this; } + @JsonSetter(value = "payment_method", nulls = Nulls.SKIP) + public Builder paymentMethod(Optional paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + public Builder paymentMethod(PaymentPaymentMethod paymentMethod) { + this.paymentMethod = Optional.ofNullable(paymentMethod); + return this; + } + @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(PaymentCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -828,12 +856,12 @@ public Builder totalAmount(Double totalAmount) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(PaymentType type) { + public Builder type(PaymentTypeEnum type) { this.type = Optional.ofNullable(type); return this; } @@ -935,6 +963,7 @@ public Payment build() { transactionDate, contact, account, + paymentMethod, currency, exchangeRate, company, diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentAccount.java b/src/main/java/com/merge/api/accounting/types/PaymentAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentAccount.java rename to src/main/java/com/merge/api/accounting/types/PaymentAccount.java index 71fe91145..9b06eb01a 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentAccount.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PaymentAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PaymentAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/PaymentAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/PaymentAccountingPeriod.java index d9a4efc76..da11c2ef6 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public PaymentAccountingPeriod deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PaymentAccountingPeriod deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentAppliedToLinesItem.java b/src/main/java/com/merge/api/accounting/types/PaymentAppliedToLinesItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentAppliedToLinesItem.java rename to src/main/java/com/merge/api/accounting/types/PaymentAppliedToLinesItem.java index 1103bfe3c..0628582cd 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentAppliedToLinesItem.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentAppliedToLinesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PaymentCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PaymentCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentContact.java b/src/main/java/com/merge/api/accounting/types/PaymentContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentContact.java rename to src/main/java/com/merge/api/accounting/types/PaymentContact.java index 54eb87519..eedadc430 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentContact.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PaymentContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PaymentContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/PaymentEndpointRequest.java index 58e8dff53..2018d5a40 100644 --- a/src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.payments.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.PaymentRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentLineItem.java b/src/main/java/com/merge/api/accounting/types/PaymentLineItem.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentLineItem.java rename to src/main/java/com/merge/api/accounting/types/PaymentLineItem.java index 0b7fafa1e..a6b684101 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentLineItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentLineItemRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentLineItemRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentLineItemRequest.java rename to src/main/java/com/merge/api/accounting/types/PaymentLineItemRequest.java index 1a97f75ac..619fa7183 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentLineItemRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaymentMethod.java b/src/main/java/com/merge/api/accounting/types/PaymentMethod.java new file mode 100644 index 000000000..ec1098824 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentMethod.java @@ -0,0 +1,457 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentMethod.Builder.class) +public final class PaymentMethod { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final MethodTypeEnum methodType; + + private final String name; + + private final Optional isActive; + + private final Optional remoteUpdatedAt; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private PaymentMethod( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + MethodTypeEnum methodType, + String name, + Optional isActive, + Optional remoteUpdatedAt, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.methodType = methodType; + this.name = name; + this.isActive = isActive; + this.remoteUpdatedAt = remoteUpdatedAt; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The type of the payment method. + *
    + *
  • CREDIT_CARD - CREDIT_CARD
  • + *
  • DEBIT_CARD - DEBIT_CARD
  • + *
  • ACH - ACH
  • + *
  • CASH - CASH
  • + *
  • CHECK - CHECK
  • + *
+ */ + @JsonProperty("method_type") + public MethodTypeEnum getMethodType() { + return methodType; + } + + /** + * @return The payment method’s name + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return True if the payment method is active, False if not. + */ + @JsonProperty("is_active") + public Optional getIsActive() { + return isActive; + } + + /** + * @return When the third party's payment method was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentMethod && equalTo((PaymentMethod) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentMethod other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && methodType.equals(other.methodType) + && name.equals(other.name) + && isActive.equals(other.isActive) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.methodType, + this.name, + this.isActive, + this.remoteUpdatedAt, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodTypeStage builder() { + return new Builder(); + } + + public interface MethodTypeStage { + NameStage methodType(@NotNull MethodTypeEnum methodType); + + Builder from(PaymentMethod other); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + } + + public interface _FinalStage { + PaymentMethod build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage remoteId(Optional remoteId); + + _FinalStage remoteId(String remoteId); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + _FinalStage modifiedAt(Optional modifiedAt); + + _FinalStage modifiedAt(OffsetDateTime modifiedAt); + + _FinalStage isActive(Optional isActive); + + _FinalStage isActive(Boolean isActive); + + _FinalStage remoteUpdatedAt(Optional remoteUpdatedAt); + + _FinalStage remoteUpdatedAt(OffsetDateTime remoteUpdatedAt); + + _FinalStage fieldMappings(Optional> fieldMappings); + + _FinalStage fieldMappings(Map fieldMappings); + + _FinalStage remoteData(Optional> remoteData); + + _FinalStage remoteData(List remoteData); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodTypeStage, NameStage, _FinalStage { + private MethodTypeEnum methodType; + + private String name; + + private Optional> remoteData = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional isActive = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PaymentMethod other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + methodType(other.getMethodType()); + name(other.getName()); + isActive(other.getIsActive()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + /** + *

The type of the payment method.

+ *
    + *
  • CREDIT_CARD - CREDIT_CARD
  • + *
  • DEBIT_CARD - DEBIT_CARD
  • + *
  • ACH - ACH
  • + *
  • CASH - CASH
  • + *
  • CHECK - CHECK
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("method_type") + public NameStage methodType(@NotNull MethodTypeEnum methodType) { + this.methodType = methodType; + return this; + } + + /** + *

The payment method’s name

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public _FinalStage remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public _FinalStage remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + @java.lang.Override + public _FinalStage fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public _FinalStage fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + /** + *

When the third party's payment method was updated.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public _FinalStage remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + /** + *

True if the payment method is active, False if not.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isActive(Boolean isActive) { + this.isActive = Optional.ofNullable(isActive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_active", nulls = Nulls.SKIP) + public _FinalStage isActive(Optional isActive) { + this.isActive = isActive; + return this; + } + + /** + *

The datetime that this object was modified by Merge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public _FinalStage modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + *

The datetime that this object was created by Merge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The third-party API ID of the matching object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public _FinalStage remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public PaymentMethod build() { + return new PaymentMethod( + id, + remoteId, + createdAt, + modifiedAt, + methodType, + name, + isActive, + remoteUpdatedAt, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentMethodsListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentMethodsListRequest.java new file mode 100644 index 000000000..3fb1028f6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentMethodsListRequest.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentMethodsListRequest.Builder.class) +public final class PaymentMethodsListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private PaymentMethodsListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentMethodsListRequest && equalTo((PaymentMethodsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentMethodsListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentMethodsListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public PaymentMethodsListRequest build() { + return new PaymentMethodsListRequest( + cursor, includeDeletedData, includeRemoteData, includeShellData, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentMethodsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentMethodsRetrieveRequest.java new file mode 100644 index 000000000..3ccaa3b44 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentMethodsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentMethodsRetrieveRequest.Builder.class) +public final class PaymentMethodsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private PaymentMethodsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentMethodsRetrieveRequest && equalTo((PaymentMethodsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentMethodsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentMethodsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public PaymentMethodsRetrieveRequest build() { + return new PaymentMethodsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentPaymentMethod.java b/src/main/java/com/merge/api/accounting/types/PaymentPaymentMethod.java new file mode 100644 index 000000000..268d9275e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentPaymentMethod.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentPaymentMethod.Deserializer.class) +public final class PaymentPaymentMethod { + private final Object value; + + private final int type; + + private PaymentPaymentMethod(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentMethod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentPaymentMethod && equalTo((PaymentPaymentMethod) other); + } + + private boolean equalTo(PaymentPaymentMethod other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PaymentPaymentMethod of(String value) { + return new PaymentPaymentMethod(value, 0); + } + + public static PaymentPaymentMethod of(PaymentMethod value) { + return new PaymentPaymentMethod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentMethod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentPaymentMethod.class); + } + + @java.lang.Override + public PaymentPaymentMethod deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentMethod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentRequest.java rename to src/main/java/com/merge/api/accounting/types/PaymentRequest.java index 2862d6ffe..33dfb5907 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -29,7 +29,9 @@ public final class PaymentRequest { private final Optional account; - private final Optional currency; + private final Optional paymentMethod; + + private final Optional currency; private final Optional exchangeRate; @@ -37,7 +39,7 @@ public final class PaymentRequest { private final Optional totalAmount; - private final Optional type; + private final Optional type; private final Optional>> trackingCategories; @@ -57,11 +59,12 @@ private PaymentRequest( Optional transactionDate, Optional contact, Optional account, - Optional currency, + Optional paymentMethod, + Optional currency, Optional exchangeRate, Optional company, Optional totalAmount, - Optional type, + Optional type, Optional>> trackingCategories, Optional accountingPeriod, Optional> appliedToLines, @@ -72,6 +75,7 @@ private PaymentRequest( this.transactionDate = transactionDate; this.contact = contact; this.account = account; + this.paymentMethod = paymentMethod; this.currency = currency; this.exchangeRate = exchangeRate; this.company = company; @@ -110,6 +114,14 @@ public Optional getAccount() { return account; } + /** + * @return The method which this payment was made by. + */ + @JsonProperty("payment_method") + public Optional getPaymentMethod() { + return paymentMethod; + } + /** * @return The payment's currency. *
    @@ -422,7 +434,7 @@ public Optional getAccount() { *
*/ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -458,7 +470,7 @@ public Optional getTotalAmount() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -513,6 +525,7 @@ private boolean equalTo(PaymentRequest other) { return transactionDate.equals(other.transactionDate) && contact.equals(other.contact) && account.equals(other.account) + && paymentMethod.equals(other.paymentMethod) && currency.equals(other.currency) && exchangeRate.equals(other.exchangeRate) && company.equals(other.company) @@ -532,6 +545,7 @@ public int hashCode() { this.transactionDate, this.contact, this.account, + this.paymentMethod, this.currency, this.exchangeRate, this.company, @@ -562,7 +576,9 @@ public static final class Builder { private Optional account = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional paymentMethod = Optional.empty(); + + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -570,7 +586,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional>> trackingCategories = Optional.empty(); @@ -593,6 +609,7 @@ public Builder from(PaymentRequest other) { transactionDate(other.getTransactionDate()); contact(other.getContact()); account(other.getAccount()); + paymentMethod(other.getPaymentMethod()); currency(other.getCurrency()); exchangeRate(other.getExchangeRate()); company(other.getCompany()); @@ -640,13 +657,24 @@ public Builder account(PaymentRequestAccount account) { return this; } + @JsonSetter(value = "payment_method", nulls = Nulls.SKIP) + public Builder paymentMethod(Optional paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + public Builder paymentMethod(PaymentRequestPaymentMethod paymentMethod) { + this.paymentMethod = Optional.ofNullable(paymentMethod); + return this; + } + @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(PaymentRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -685,12 +713,12 @@ public Builder totalAmount(Double totalAmount) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(PaymentRequestType type) { + public Builder type(PaymentTypeEnum type) { this.type = Optional.ofNullable(type); return this; } @@ -767,6 +795,7 @@ public PaymentRequest build() { transactionDate, contact, account, + paymentMethod, currency, exchangeRate, company, diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestAccount.java b/src/main/java/com/merge/api/accounting/types/PaymentRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/PaymentRequestAccount.java index 1a1f4c89e..8299cbc9f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PaymentRequestAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PaymentRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/PaymentRequestAccountingPeriod.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentRequestAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/PaymentRequestAccountingPeriod.java index 92a150b2d..3ef7823b6 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequestAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PaymentRequestCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PaymentRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestContact.java b/src/main/java/com/merge/api/accounting/types/PaymentRequestContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentRequestContact.java rename to src/main/java/com/merge/api/accounting/types/PaymentRequestContact.java index b388d885a..231553965 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestContact.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequestContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PaymentRequestContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PaymentRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/accounting/types/PaymentRequestPaymentMethod.java b/src/main/java/com/merge/api/accounting/types/PaymentRequestPaymentMethod.java new file mode 100644 index 000000000..50a44b742 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequestPaymentMethod.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentRequestPaymentMethod.Deserializer.class) +public final class PaymentRequestPaymentMethod { + private final Object value; + + private final int type; + + private PaymentRequestPaymentMethod(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentMethod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentRequestPaymentMethod && equalTo((PaymentRequestPaymentMethod) other); + } + + private boolean equalTo(PaymentRequestPaymentMethod other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PaymentRequestPaymentMethod of(String value) { + return new PaymentRequestPaymentMethod(value, 0); + } + + public static PaymentRequestPaymentMethod of(PaymentMethod value) { + return new PaymentRequestPaymentMethod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentMethod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentRequestPaymentMethod.class); + } + + @java.lang.Override + public PaymentRequestPaymentMethod deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentMethod.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/PaymentRequestTrackingCategoriesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentRequestTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/PaymentRequestTrackingCategoriesItem.java index 85d547f48..a2b2185ec 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequestTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final String name; + + private final Optional isActive; + + private final Optional company; + + private final Optional daysUntilDue; + + private final Optional discountDays; + + private final Optional remoteLastModifiedAt; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private PaymentTerm( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + String name, + Optional isActive, + Optional company, + Optional daysUntilDue, + Optional discountDays, + Optional remoteLastModifiedAt, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.isActive = isActive; + this.company = company; + this.daysUntilDue = daysUntilDue; + this.discountDays = discountDays; + this.remoteLastModifiedAt = remoteLastModifiedAt; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The name of the payment term. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return True if the payment term is active, False if not. + */ + @JsonProperty("is_active") + public Optional getIsActive() { + return isActive; + } + + /** + * @return The subsidiary that the payment term belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The number of days after the invoice date that payment is due. + */ + @JsonProperty("days_until_due") + public Optional getDaysUntilDue() { + return daysUntilDue; + } + + /** + * @return The number of days the invoice must be paid before discounts expire. + */ + @JsonProperty("discount_days") + public Optional getDiscountDays() { + return discountDays; + } + + /** + * @return When the third party's payment term was modified. + */ + @JsonProperty("remote_last_modified_at") + public Optional getRemoteLastModifiedAt() { + return remoteLastModifiedAt; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentTerm && equalTo((PaymentTerm) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentTerm other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && isActive.equals(other.isActive) + && company.equals(other.company) + && daysUntilDue.equals(other.daysUntilDue) + && discountDays.equals(other.discountDays) + && remoteLastModifiedAt.equals(other.remoteLastModifiedAt) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.isActive, + this.company, + this.daysUntilDue, + this.discountDays, + this.remoteLastModifiedAt, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(PaymentTerm other); + } + + public interface _FinalStage { + PaymentTerm build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage remoteId(Optional remoteId); + + _FinalStage remoteId(String remoteId); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + + _FinalStage modifiedAt(Optional modifiedAt); + + _FinalStage modifiedAt(OffsetDateTime modifiedAt); + + _FinalStage isActive(Optional isActive); + + _FinalStage isActive(Boolean isActive); + + _FinalStage company(Optional company); + + _FinalStage company(PaymentTermCompany company); + + _FinalStage daysUntilDue(Optional daysUntilDue); + + _FinalStage daysUntilDue(Integer daysUntilDue); + + _FinalStage discountDays(Optional discountDays); + + _FinalStage discountDays(Integer discountDays); + + _FinalStage remoteLastModifiedAt(Optional remoteLastModifiedAt); + + _FinalStage remoteLastModifiedAt(OffsetDateTime remoteLastModifiedAt); + + _FinalStage fieldMappings(Optional> fieldMappings); + + _FinalStage fieldMappings(Map fieldMappings); + + _FinalStage remoteData(Optional> remoteData); + + _FinalStage remoteData(List remoteData); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> remoteData = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional remoteLastModifiedAt = Optional.empty(); + + private Optional discountDays = Optional.empty(); + + private Optional daysUntilDue = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional isActive = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PaymentTerm other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + isActive(other.getIsActive()); + company(other.getCompany()); + daysUntilDue(other.getDaysUntilDue()); + discountDays(other.getDiscountDays()); + remoteLastModifiedAt(other.getRemoteLastModifiedAt()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + /** + *

The name of the payment term.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public _FinalStage remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public _FinalStage remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + @java.lang.Override + public _FinalStage fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public _FinalStage fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + /** + *

When the third party's payment term was modified.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteLastModifiedAt(OffsetDateTime remoteLastModifiedAt) { + this.remoteLastModifiedAt = Optional.ofNullable(remoteLastModifiedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_last_modified_at", nulls = Nulls.SKIP) + public _FinalStage remoteLastModifiedAt(Optional remoteLastModifiedAt) { + this.remoteLastModifiedAt = remoteLastModifiedAt; + return this; + } + + /** + *

The number of days the invoice must be paid before discounts expire.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage discountDays(Integer discountDays) { + this.discountDays = Optional.ofNullable(discountDays); + return this; + } + + @java.lang.Override + @JsonSetter(value = "discount_days", nulls = Nulls.SKIP) + public _FinalStage discountDays(Optional discountDays) { + this.discountDays = discountDays; + return this; + } + + /** + *

The number of days after the invoice date that payment is due.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage daysUntilDue(Integer daysUntilDue) { + this.daysUntilDue = Optional.ofNullable(daysUntilDue); + return this; + } + + @java.lang.Override + @JsonSetter(value = "days_until_due", nulls = Nulls.SKIP) + public _FinalStage daysUntilDue(Optional daysUntilDue) { + this.daysUntilDue = daysUntilDue; + return this; + } + + /** + *

The subsidiary that the payment term belongs to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage company(PaymentTermCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public _FinalStage company(Optional company) { + this.company = company; + return this; + } + + /** + *

True if the payment term is active, False if not.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isActive(Boolean isActive) { + this.isActive = Optional.ofNullable(isActive); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_active", nulls = Nulls.SKIP) + public _FinalStage isActive(Optional isActive) { + this.isActive = isActive; + return this; + } + + /** + *

The datetime that this object was modified by Merge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public _FinalStage modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + *

The datetime that this object was created by Merge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The third-party API ID of the matching object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public _FinalStage remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public PaymentTerm build() { + return new PaymentTerm( + id, + remoteId, + createdAt, + modifiedAt, + name, + isActive, + company, + daysUntilDue, + discountDays, + remoteLastModifiedAt, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTermCompany.java b/src/main/java/com/merge/api/accounting/types/PaymentTermCompany.java new file mode 100644 index 000000000..a01949625 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PaymentTermCompany.Deserializer.class) +public final class PaymentTermCompany { + private final Object value; + + private final int type; + + private PaymentTermCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentTermCompany && equalTo((PaymentTermCompany) other); + } + + private boolean equalTo(PaymentTermCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PaymentTermCompany of(String value) { + return new PaymentTermCompany(value, 0); + } + + public static PaymentTermCompany of(CompanyInfo value) { + return new PaymentTermCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PaymentTermCompany.class); + } + + @java.lang.Override + public PaymentTermCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java new file mode 100644 index 000000000..a52d85b99 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentTermsListRequest.Builder.class) +public final class PaymentTermsListRequest { + private final Optional> expand; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private PaymentTermsListRequest( + Optional> expand, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional pageSize, + Map additionalProperties) { + this.expand = expand; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentTermsListRequest && equalTo((PaymentTermsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentTermsListRequest other) { + return expand.equals(other.expand) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentTermsListRequest other) { + expand(other.getExpand()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public PaymentTermsListRequest build() { + return new PaymentTermsListRequest( + expand, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequest.java new file mode 100644 index 000000000..b2a1d006c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentTermsRetrieveRequest.Builder.class) +public final class PaymentTermsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private PaymentTermsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentTermsRetrieveRequest && equalTo((PaymentTermsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentTermsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentTermsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public PaymentTermsRetrieveRequest build() { + return new PaymentTermsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/PaymentTrackingCategoriesItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PaymentTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/PaymentTrackingCategoriesItem.java index 11740c949..072ae1579 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional accountId; private final Optional companyId; @@ -34,8 +37,6 @@ public final class PaymentsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,13 +60,13 @@ public final class PaymentsListRequest { private final Map additionalProperties; private PaymentsListRequest( + Optional> expand, Optional accountId, Optional companyId, Optional contactId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -77,13 +78,13 @@ private PaymentsListRequest( Optional transactionDateAfter, Optional transactionDateBefore, Map additionalProperties) { + this.expand = expand; this.accountId = accountId; this.companyId = companyId; this.contactId = contactId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -97,6 +98,14 @@ private PaymentsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return payments for this account. */ @@ -145,14 +154,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -245,13 +246,13 @@ public Map getAdditionalProperties() { } private boolean equalTo(PaymentsListRequest other) { - return accountId.equals(other.accountId) + return expand.equals(other.expand) + && accountId.equals(other.accountId) && companyId.equals(other.companyId) && contactId.equals(other.contactId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -267,13 +268,13 @@ private boolean equalTo(PaymentsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.accountId, this.companyId, this.contactId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -297,6 +298,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional accountId = Optional.empty(); private Optional companyId = Optional.empty(); @@ -309,8 +312,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -337,13 +338,13 @@ public static final class Builder { private Builder() {} public Builder from(PaymentsListRequest other) { + expand(other.getExpand()); accountId(other.getAccountId()); companyId(other.getCompanyId()); contactId(other.getContactId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -357,6 +358,22 @@ public Builder from(PaymentsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(PaymentsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) public Builder accountId(Optional accountId) { this.accountId = accountId; @@ -423,17 +440,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(PaymentsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -546,13 +552,13 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { public PaymentsListRequest build() { return new PaymentsListRequest( + expand, accountId, companyId, contactId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/accounting/types/PaymentsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/PaymentsListRequestExpandItem.java new file mode 100644 index 000000000..7ce23dedf --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentsListRequestExpandItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PaymentsListRequestExpandItem { + ACCOUNT("account"), + + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_TO_LINES("applied_to_lines"), + + COMPANY("company"), + + CONTACT("contact"), + + PAYMENT_METHOD("payment_method"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + PaymentsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentsRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java index 3e459d42e..d1663b7c1 100644 --- a/src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.payments.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/PaymentsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentsRetrieveRequest.java new file mode 100644 index 000000000..cfa550d90 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentsRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentsRetrieveRequest.Builder.class) +public final class PaymentsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private PaymentsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentsRetrieveRequest && equalTo((PaymentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaymentsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(PaymentsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public PaymentsRetrieveRequest build() { + return new PaymentsRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/PaymentsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..e398d4997 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentsRetrieveRequestExpandItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PaymentsRetrieveRequestExpandItem { + ACCOUNT("account"), + + ACCOUNTING_PERIOD("accounting_period"), + + APPLIED_TO_LINES("applied_to_lines"), + + COMPANY("company"), + + CONTACT("contact"), + + PAYMENT_METHOD("payment_method"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + PaymentsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PhoneNumbersRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PhoneNumbersRetrieveRequest.java new file mode 100644 index 000000000..4750abbda --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PhoneNumbersRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneNumbersRetrieveRequest.Builder.class) +public final class PhoneNumbersRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private PhoneNumbersRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneNumbersRetrieveRequest && equalTo((PhoneNumbersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneNumbersRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneNumbersRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public PhoneNumbersRetrieveRequest build() { + return new PhoneNumbersRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PostingStatusEnum.java b/src/main/java/com/merge/api/accounting/types/PostingStatusEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/PostingStatusEnum.java rename to src/main/java/com/merge/api/accounting/types/PostingStatusEnum.java index 52a7273bc..26d904fc4 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PostingStatusEnum.java +++ b/src/main/java/com/merge/api/accounting/types/PostingStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrder.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrder.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrder.java index bbdf7c3f3..c4b03ecf1 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrder.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -31,7 +31,7 @@ public final class PurchaseOrder { private final Optional modifiedAt; - private final Optional status; + private final Optional status; private final Optional issueDate; @@ -51,10 +51,12 @@ public final class PurchaseOrder { private final Optional totalAmount; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; + private final Optional paymentTerm; + private final Optional> lineItems; private final Optional inclusiveOfTax; @@ -82,7 +84,7 @@ private PurchaseOrder( Optional remoteId, Optional createdAt, Optional modifiedAt, - Optional status, + Optional status, Optional issueDate, Optional purchaseOrderNumber, Optional deliveryDate, @@ -92,8 +94,9 @@ private PurchaseOrder( Optional memo, Optional company, Optional totalAmount, - Optional currency, + Optional currency, Optional exchangeRate, + Optional paymentTerm, Optional> lineItems, Optional inclusiveOfTax, Optional>> trackingCategories, @@ -121,6 +124,7 @@ private PurchaseOrder( this.totalAmount = totalAmount; this.currency = currency; this.exchangeRate = exchangeRate; + this.paymentTerm = paymentTerm; this.lineItems = lineItems; this.inclusiveOfTax = inclusiveOfTax; this.trackingCategories = trackingCategories; @@ -174,7 +178,7 @@ public Optional getModifiedAt() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -562,7 +566,7 @@ public Optional getTotalAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -574,6 +578,14 @@ public Optional getExchangeRate() { return exchangeRate; } + /** + * @return The payment term that applies to this transaction. + */ + @JsonProperty("payment_term") + public Optional getPaymentTerm() { + return paymentTerm; + } + @JsonProperty("line_items") public Optional> getLineItems() { return lineItems; @@ -667,6 +679,7 @@ private boolean equalTo(PurchaseOrder other) { && totalAmount.equals(other.totalAmount) && currency.equals(other.currency) && exchangeRate.equals(other.exchangeRate) + && paymentTerm.equals(other.paymentTerm) && lineItems.equals(other.lineItems) && inclusiveOfTax.equals(other.inclusiveOfTax) && trackingCategories.equals(other.trackingCategories) @@ -698,6 +711,7 @@ public int hashCode() { this.totalAmount, this.currency, this.exchangeRate, + this.paymentTerm, this.lineItems, this.inclusiveOfTax, this.trackingCategories, @@ -729,7 +743,7 @@ public static final class Builder { private Optional modifiedAt = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional issueDate = Optional.empty(); @@ -749,10 +763,12 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); + private Optional paymentTerm = Optional.empty(); + private Optional> lineItems = Optional.empty(); private Optional inclusiveOfTax = Optional.empty(); @@ -795,6 +811,7 @@ public Builder from(PurchaseOrder other) { totalAmount(other.getTotalAmount()); currency(other.getCurrency()); exchangeRate(other.getExchangeRate()); + paymentTerm(other.getPaymentTerm()); lineItems(other.getLineItems()); inclusiveOfTax(other.getInclusiveOfTax()); trackingCategories(other.getTrackingCategories()); @@ -853,12 +870,12 @@ public Builder modifiedAt(OffsetDateTime modifiedAt) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(PurchaseOrderStatus status) { + public Builder status(PurchaseOrderStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -963,12 +980,12 @@ public Builder totalAmount(Double totalAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(PurchaseOrderCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -984,6 +1001,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + @JsonSetter(value = "payment_term", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(PurchaseOrderPaymentTerm paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; @@ -1113,6 +1141,7 @@ public PurchaseOrder build() { totalAmount, currency, exchangeRate, + paymentTerm, lineItems, inclusiveOfTax, trackingCategories, diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrderAccountingPeriod.java index 1ec1aa022..90e38b5c2 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PurchaseOrderCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PurchaseOrderCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderDeliveryAddress.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderDeliveryAddress.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderDeliveryAddress.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrderDeliveryAddress.java index 1cc2006fe..b64e7cae6 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderDeliveryAddress.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderDeliveryAddress.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer totalLineAmount; - private final Optional currency; + private final Optional currency; private final Optional taxRate; @@ -76,7 +76,7 @@ private PurchaseOrderLineItem( Optional>> trackingCategories, Optional taxAmount, Optional totalLineAmount, - Optional currency, + Optional currency, Optional taxRate, Optional exchangeRate, Optional company, @@ -515,7 +515,7 @@ public Optional getTotalLineAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -650,7 +650,7 @@ public static final class Builder { private Optional totalLineAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional taxRate = Optional.empty(); @@ -834,12 +834,12 @@ public Builder totalLineAmount(String totalLineAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(PurchaseOrderLineItemCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemItem.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemItem.java index 0b8566609..9bad56b53 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemItem.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer totalLineAmount; - private final Optional currency; + private final Optional currency; private final Optional taxRate; @@ -69,7 +69,7 @@ private PurchaseOrderLineItemRequest( Optional>> trackingCategories, Optional taxAmount, Optional totalLineAmount, - Optional currency, + Optional currency, Optional taxRate, Optional exchangeRate, Optional company, @@ -486,7 +486,7 @@ public Optional getTotalLineAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -613,7 +613,7 @@ public static final class Builder { private Optional totalLineAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional taxRate = Optional.empty(); @@ -764,12 +764,12 @@ public Builder totalLineAmount(String totalLineAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(PurchaseOrderLineItemRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemRequestItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemRequestItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemRequestItem.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemRequestItem.java index 099222308..d128a0043 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemRequestItem.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemRequestItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentTerm) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderPaymentTerm && equalTo((PurchaseOrderPaymentTerm) other); + } + + private boolean equalTo(PurchaseOrderPaymentTerm other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderPaymentTerm of(String value) { + return new PurchaseOrderPaymentTerm(value, 0); + } + + public static PurchaseOrderPaymentTerm of(PaymentTerm value) { + return new PurchaseOrderPaymentTerm(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentTerm value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderPaymentTerm.class); + } + + @java.lang.Override + public PurchaseOrderPaymentTerm deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTerm.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequest.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java index db2131866..81d8f992e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -23,7 +23,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PurchaseOrderRequest.Builder.class) public final class PurchaseOrderRequest { - private final Optional status; + private final Optional status; private final Optional issueDate; @@ -41,7 +41,9 @@ public final class PurchaseOrderRequest { private final Optional totalAmount; - private final Optional currency; + private final Optional paymentTerm; + + private final Optional currency; private final Optional inclusiveOfTax; @@ -60,7 +62,7 @@ public final class PurchaseOrderRequest { private final Map additionalProperties; private PurchaseOrderRequest( - Optional status, + Optional status, Optional issueDate, Optional deliveryDate, Optional deliveryAddress, @@ -69,7 +71,8 @@ private PurchaseOrderRequest( Optional memo, Optional company, Optional totalAmount, - Optional currency, + Optional paymentTerm, + Optional currency, Optional inclusiveOfTax, Optional exchangeRate, Optional>> trackingCategories, @@ -87,6 +90,7 @@ private PurchaseOrderRequest( this.memo = memo; this.company = company; this.totalAmount = totalAmount; + this.paymentTerm = paymentTerm; this.currency = currency; this.inclusiveOfTax = inclusiveOfTax; this.exchangeRate = exchangeRate; @@ -109,7 +113,7 @@ private PurchaseOrderRequest( * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -177,6 +181,14 @@ public Optional getTotalAmount() { return totalAmount; } + /** + * @return The payment term that applies to this transaction. + */ + @JsonProperty("payment_term") + public Optional getPaymentTerm() { + return paymentTerm; + } + /** * @return The purchase order's currency. *
    @@ -489,7 +501,7 @@ public Optional getTotalAmount() { *
*/ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -555,6 +567,7 @@ private boolean equalTo(PurchaseOrderRequest other) { && memo.equals(other.memo) && company.equals(other.company) && totalAmount.equals(other.totalAmount) + && paymentTerm.equals(other.paymentTerm) && currency.equals(other.currency) && inclusiveOfTax.equals(other.inclusiveOfTax) && exchangeRate.equals(other.exchangeRate) @@ -577,6 +590,7 @@ public int hashCode() { this.memo, this.company, this.totalAmount, + this.paymentTerm, this.currency, this.inclusiveOfTax, this.exchangeRate, @@ -598,7 +612,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional issueDate = Optional.empty(); @@ -616,7 +630,9 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional paymentTerm = Optional.empty(); + + private Optional currency = Optional.empty(); private Optional inclusiveOfTax = Optional.empty(); @@ -648,6 +664,7 @@ public Builder from(PurchaseOrderRequest other) { memo(other.getMemo()); company(other.getCompany()); totalAmount(other.getTotalAmount()); + paymentTerm(other.getPaymentTerm()); currency(other.getCurrency()); inclusiveOfTax(other.getInclusiveOfTax()); exchangeRate(other.getExchangeRate()); @@ -660,12 +677,12 @@ public Builder from(PurchaseOrderRequest other) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(PurchaseOrderRequestStatus status) { + public Builder status(PurchaseOrderStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -758,13 +775,24 @@ public Builder totalAmount(Double totalAmount) { return this; } + @JsonSetter(value = "payment_term", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(PurchaseOrderRequestPaymentTerm paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(PurchaseOrderRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -859,6 +887,7 @@ public PurchaseOrderRequest build() { memo, company, totalAmount, + paymentTerm, currency, inclusiveOfTax, exchangeRate, diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestCompany.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestCompany.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestCompany.java index 46a6bfa66..287b7e4f5 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestCompany.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentTerm) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderRequestPaymentTerm && equalTo((PurchaseOrderRequestPaymentTerm) other); + } + + private boolean equalTo(PurchaseOrderRequestPaymentTerm other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderRequestPaymentTerm of(String value) { + return new PurchaseOrderRequestPaymentTerm(value, 0); + } + + public static PurchaseOrderRequestPaymentTerm of(PaymentTerm value) { + return new PurchaseOrderRequestPaymentTerm(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentTerm value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderRequestPaymentTerm.class); + } + + @java.lang.Override + public PurchaseOrderRequestPaymentTerm deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTerm.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java index bf130b60e..c2fa6e444 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PurchaseOrderVendor deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PurchaseOrderVendor deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java index dd73ab68d..0af110314 100644 --- a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.purchaseorders.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersListRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersListRequest.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java index 9d12d1884..cdfb1e703 100644 --- a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.purchaseorders.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.purchaseorders.types.PurchaseOrdersListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PurchaseOrdersListRequest.Builder.class) public final class PurchaseOrdersListRequest { + private final Optional> expand; + private final Optional companyId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class PurchaseOrdersListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,11 +60,11 @@ public final class PurchaseOrdersListRequest { private final Map additionalProperties; private PurchaseOrdersListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -77,11 +78,11 @@ private PurchaseOrdersListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -97,6 +98,14 @@ private PurchaseOrdersListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return purchase orders for this company. */ @@ -129,14 +138,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -245,11 +246,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(PurchaseOrdersListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -267,11 +268,11 @@ private boolean equalTo(PurchaseOrdersListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -297,6 +298,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -305,8 +308,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -337,11 +338,11 @@ public static final class Builder { private Builder() {} public Builder from(PurchaseOrdersListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -357,6 +358,22 @@ public Builder from(PurchaseOrdersListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(PurchaseOrdersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -401,17 +418,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(PurchaseOrdersListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -546,11 +552,11 @@ public Builder showEnumOrigins(String showEnumOrigins) { public PurchaseOrdersListRequest build() { return new PurchaseOrdersListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestExpandItem.java new file mode 100644 index 000000000..5685062d1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestExpandItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PurchaseOrdersListRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + DELIVERY_ADDRESS("delivery_address"), + + LINE_ITEMS("line_items"), + + PAYMENT_TERM("payment_term"), + + TRACKING_CATEGORIES("tracking_categories"), + + VENDOR("vendor"); + + private final String value; + + PurchaseOrdersListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java index e5dae09b9..edd220dfb 100644 --- a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.purchaseorders.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequest.java similarity index 77% rename from src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRetrieveRequest.java rename to src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequest.java index 30e23e69c..8735e1cfc 100644 --- a/src/main/java/com/merge/api/resources/accounting/purchaseorders/requests/PurchaseOrdersRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.purchaseorders.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.purchaseorders.types.PurchaseOrdersRetrieveRequestExpand; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,12 +22,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PurchaseOrdersRetrieveRequest.Builder.class) public final class PurchaseOrdersRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeRemoteFields; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -34,15 +37,17 @@ public final class PurchaseOrdersRetrieveRequest { private final Map additionalProperties; private PurchaseOrdersRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, Optional includeRemoteFields, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -52,7 +57,7 @@ private PurchaseOrdersRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -72,6 +77,14 @@ public Optional getIncludeRemoteFields() { return includeRemoteFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -103,6 +116,7 @@ private boolean equalTo(PurchaseOrdersRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @@ -110,7 +124,12 @@ private boolean equalTo(PurchaseOrdersRetrieveRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + this.expand, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); } @java.lang.Override @@ -124,12 +143,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); private Optional includeRemoteFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -143,22 +164,28 @@ public Builder from(PurchaseOrdersRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(PurchaseOrdersRetrieveRequestExpand expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(PurchaseOrdersRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -181,6 +208,17 @@ public Builder includeRemoteFields(Boolean includeRemoteFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -208,6 +246,7 @@ public PurchaseOrdersRetrieveRequest build() { expand, includeRemoteData, includeRemoteFields, + includeShellData, remoteFields, showEnumOrigins, additionalProperties); diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestExpandItem.java new file mode 100644 index 000000000..5fcdf856d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestExpandItem.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum PurchaseOrdersRetrieveRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + DELIVERY_ADDRESS("delivery_address"), + + LINE_ITEMS("line_items"), + + PAYMENT_TERM("payment_term"), + + TRACKING_CATEGORIES("tracking_categories"), + + VENDOR("vendor"); + + private final String value; + + PurchaseOrdersRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteData.java b/src/main/java/com/merge/api/accounting/types/RemoteData.java new file mode 100644 index 000000000..80c8aaca1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteData.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

The third-party API path that is being called.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/accounting/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..f88389823 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteEndpointInfo.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteField.java b/src/main/java/com/merge/api/accounting/types/RemoteField.java new file mode 100644 index 000000000..33c69744c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteField.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteField.Builder.class) +public final class RemoteField { + private final RemoteFieldRemoteFieldClass remoteFieldClass; + + private final Optional value; + + private final Map additionalProperties; + + private RemoteField( + RemoteFieldRemoteFieldClass remoteFieldClass, + Optional value, + Map additionalProperties) { + this.remoteFieldClass = remoteFieldClass; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_field_class") + public RemoteFieldRemoteFieldClass getRemoteFieldClass() { + return remoteFieldClass; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteField && equalTo((RemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteField other) { + return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteFieldClassStage builder() { + return new Builder(); + } + + public interface RemoteFieldClassStage { + _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass); + + Builder from(RemoteField other); + } + + public interface _FinalStage { + RemoteField build(); + + _FinalStage value(Optional value); + + _FinalStage value(JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteFieldClassStage, _FinalStage { + private RemoteFieldRemoteFieldClass remoteFieldClass; + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteField other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @java.lang.Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public RemoteField build() { + return new RemoteField(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldApi.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldApi.java new file mode 100644 index 000000000..984beffe6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldApi.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..5b7827957 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..9743e6ba2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldApiResponse.java @@ -0,0 +1,699 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> account; + + private final Optional> accountingAttachment; + + private final Optional> balanceSheet; + + private final Optional> cashFlowStatement; + + private final Optional> companyInfo; + + private final Optional> contact; + + private final Optional> incomeStatement; + + private final Optional> creditNote; + + private final Optional> item; + + private final Optional> purchaseOrder; + + private final Optional> trackingCategory; + + private final Optional> journalEntry; + + private final Optional> taxRate; + + private final Optional> invoice; + + private final Optional> payment; + + private final Optional> expense; + + private final Optional> vendorCredit; + + private final Optional> transaction; + + private final Optional> accountingPeriod; + + private final Optional> generalLedgerTransaction; + + private final Optional> bankFeedAccount; + + private final Optional> employee; + + private final Optional> paymentMethod; + + private final Optional> paymentTerm; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> account, + Optional> accountingAttachment, + Optional> balanceSheet, + Optional> cashFlowStatement, + Optional> companyInfo, + Optional> contact, + Optional> incomeStatement, + Optional> creditNote, + Optional> item, + Optional> purchaseOrder, + Optional> trackingCategory, + Optional> journalEntry, + Optional> taxRate, + Optional> invoice, + Optional> payment, + Optional> expense, + Optional> vendorCredit, + Optional> transaction, + Optional> accountingPeriod, + Optional> generalLedgerTransaction, + Optional> bankFeedAccount, + Optional> employee, + Optional> paymentMethod, + Optional> paymentTerm, + Map additionalProperties) { + this.account = account; + this.accountingAttachment = accountingAttachment; + this.balanceSheet = balanceSheet; + this.cashFlowStatement = cashFlowStatement; + this.companyInfo = companyInfo; + this.contact = contact; + this.incomeStatement = incomeStatement; + this.creditNote = creditNote; + this.item = item; + this.purchaseOrder = purchaseOrder; + this.trackingCategory = trackingCategory; + this.journalEntry = journalEntry; + this.taxRate = taxRate; + this.invoice = invoice; + this.payment = payment; + this.expense = expense; + this.vendorCredit = vendorCredit; + this.transaction = transaction; + this.accountingPeriod = accountingPeriod; + this.generalLedgerTransaction = generalLedgerTransaction; + this.bankFeedAccount = bankFeedAccount; + this.employee = employee; + this.paymentMethod = paymentMethod; + this.paymentTerm = paymentTerm; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("AccountingAttachment") + public Optional> getAccountingAttachment() { + return accountingAttachment; + } + + @JsonProperty("BalanceSheet") + public Optional> getBalanceSheet() { + return balanceSheet; + } + + @JsonProperty("CashFlowStatement") + public Optional> getCashFlowStatement() { + return cashFlowStatement; + } + + @JsonProperty("CompanyInfo") + public Optional> getCompanyInfo() { + return companyInfo; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @JsonProperty("IncomeStatement") + public Optional> getIncomeStatement() { + return incomeStatement; + } + + @JsonProperty("CreditNote") + public Optional> getCreditNote() { + return creditNote; + } + + @JsonProperty("Item") + public Optional> getItem() { + return item; + } + + @JsonProperty("PurchaseOrder") + public Optional> getPurchaseOrder() { + return purchaseOrder; + } + + @JsonProperty("TrackingCategory") + public Optional> getTrackingCategory() { + return trackingCategory; + } + + @JsonProperty("JournalEntry") + public Optional> getJournalEntry() { + return journalEntry; + } + + @JsonProperty("TaxRate") + public Optional> getTaxRate() { + return taxRate; + } + + @JsonProperty("Invoice") + public Optional> getInvoice() { + return invoice; + } + + @JsonProperty("Payment") + public Optional> getPayment() { + return payment; + } + + @JsonProperty("Expense") + public Optional> getExpense() { + return expense; + } + + @JsonProperty("VendorCredit") + public Optional> getVendorCredit() { + return vendorCredit; + } + + @JsonProperty("Transaction") + public Optional> getTransaction() { + return transaction; + } + + @JsonProperty("AccountingPeriod") + public Optional> getAccountingPeriod() { + return accountingPeriod; + } + + @JsonProperty("GeneralLedgerTransaction") + public Optional> getGeneralLedgerTransaction() { + return generalLedgerTransaction; + } + + @JsonProperty("BankFeedAccount") + public Optional> getBankFeedAccount() { + return bankFeedAccount; + } + + @JsonProperty("Employee") + public Optional> getEmployee() { + return employee; + } + + @JsonProperty("PaymentMethod") + public Optional> getPaymentMethod() { + return paymentMethod; + } + + @JsonProperty("PaymentTerm") + public Optional> getPaymentTerm() { + return paymentTerm; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return account.equals(other.account) + && accountingAttachment.equals(other.accountingAttachment) + && balanceSheet.equals(other.balanceSheet) + && cashFlowStatement.equals(other.cashFlowStatement) + && companyInfo.equals(other.companyInfo) + && contact.equals(other.contact) + && incomeStatement.equals(other.incomeStatement) + && creditNote.equals(other.creditNote) + && item.equals(other.item) + && purchaseOrder.equals(other.purchaseOrder) + && trackingCategory.equals(other.trackingCategory) + && journalEntry.equals(other.journalEntry) + && taxRate.equals(other.taxRate) + && invoice.equals(other.invoice) + && payment.equals(other.payment) + && expense.equals(other.expense) + && vendorCredit.equals(other.vendorCredit) + && transaction.equals(other.transaction) + && accountingPeriod.equals(other.accountingPeriod) + && generalLedgerTransaction.equals(other.generalLedgerTransaction) + && bankFeedAccount.equals(other.bankFeedAccount) + && employee.equals(other.employee) + && paymentMethod.equals(other.paymentMethod) + && paymentTerm.equals(other.paymentTerm); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.account, + this.accountingAttachment, + this.balanceSheet, + this.cashFlowStatement, + this.companyInfo, + this.contact, + this.incomeStatement, + this.creditNote, + this.item, + this.purchaseOrder, + this.trackingCategory, + this.journalEntry, + this.taxRate, + this.invoice, + this.payment, + this.expense, + this.vendorCredit, + this.transaction, + this.accountingPeriod, + this.generalLedgerTransaction, + this.bankFeedAccount, + this.employee, + this.paymentMethod, + this.paymentTerm); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> account = Optional.empty(); + + private Optional> accountingAttachment = Optional.empty(); + + private Optional> balanceSheet = Optional.empty(); + + private Optional> cashFlowStatement = Optional.empty(); + + private Optional> companyInfo = Optional.empty(); + + private Optional> contact = Optional.empty(); + + private Optional> incomeStatement = Optional.empty(); + + private Optional> creditNote = Optional.empty(); + + private Optional> item = Optional.empty(); + + private Optional> purchaseOrder = Optional.empty(); + + private Optional> trackingCategory = Optional.empty(); + + private Optional> journalEntry = Optional.empty(); + + private Optional> taxRate = Optional.empty(); + + private Optional> invoice = Optional.empty(); + + private Optional> payment = Optional.empty(); + + private Optional> expense = Optional.empty(); + + private Optional> vendorCredit = Optional.empty(); + + private Optional> transaction = Optional.empty(); + + private Optional> accountingPeriod = Optional.empty(); + + private Optional> generalLedgerTransaction = Optional.empty(); + + private Optional> bankFeedAccount = Optional.empty(); + + private Optional> employee = Optional.empty(); + + private Optional> paymentMethod = Optional.empty(); + + private Optional> paymentTerm = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + account(other.getAccount()); + accountingAttachment(other.getAccountingAttachment()); + balanceSheet(other.getBalanceSheet()); + cashFlowStatement(other.getCashFlowStatement()); + companyInfo(other.getCompanyInfo()); + contact(other.getContact()); + incomeStatement(other.getIncomeStatement()); + creditNote(other.getCreditNote()); + item(other.getItem()); + purchaseOrder(other.getPurchaseOrder()); + trackingCategory(other.getTrackingCategory()); + journalEntry(other.getJournalEntry()); + taxRate(other.getTaxRate()); + invoice(other.getInvoice()); + payment(other.getPayment()); + expense(other.getExpense()); + vendorCredit(other.getVendorCredit()); + transaction(other.getTransaction()); + accountingPeriod(other.getAccountingPeriod()); + generalLedgerTransaction(other.getGeneralLedgerTransaction()); + bankFeedAccount(other.getBankFeedAccount()); + employee(other.getEmployee()); + paymentMethod(other.getPaymentMethod()); + paymentTerm(other.getPaymentTerm()); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "AccountingAttachment", nulls = Nulls.SKIP) + public Builder accountingAttachment(Optional> accountingAttachment) { + this.accountingAttachment = accountingAttachment; + return this; + } + + public Builder accountingAttachment(List accountingAttachment) { + this.accountingAttachment = Optional.ofNullable(accountingAttachment); + return this; + } + + @JsonSetter(value = "BalanceSheet", nulls = Nulls.SKIP) + public Builder balanceSheet(Optional> balanceSheet) { + this.balanceSheet = balanceSheet; + return this; + } + + public Builder balanceSheet(List balanceSheet) { + this.balanceSheet = Optional.ofNullable(balanceSheet); + return this; + } + + @JsonSetter(value = "CashFlowStatement", nulls = Nulls.SKIP) + public Builder cashFlowStatement(Optional> cashFlowStatement) { + this.cashFlowStatement = cashFlowStatement; + return this; + } + + public Builder cashFlowStatement(List cashFlowStatement) { + this.cashFlowStatement = Optional.ofNullable(cashFlowStatement); + return this; + } + + @JsonSetter(value = "CompanyInfo", nulls = Nulls.SKIP) + public Builder companyInfo(Optional> companyInfo) { + this.companyInfo = companyInfo; + return this; + } + + public Builder companyInfo(List companyInfo) { + this.companyInfo = Optional.ofNullable(companyInfo); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "IncomeStatement", nulls = Nulls.SKIP) + public Builder incomeStatement(Optional> incomeStatement) { + this.incomeStatement = incomeStatement; + return this; + } + + public Builder incomeStatement(List incomeStatement) { + this.incomeStatement = Optional.ofNullable(incomeStatement); + return this; + } + + @JsonSetter(value = "CreditNote", nulls = Nulls.SKIP) + public Builder creditNote(Optional> creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder creditNote(List creditNote) { + this.creditNote = Optional.ofNullable(creditNote); + return this; + } + + @JsonSetter(value = "Item", nulls = Nulls.SKIP) + public Builder item(Optional> item) { + this.item = item; + return this; + } + + public Builder item(List item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "PurchaseOrder", nulls = Nulls.SKIP) + public Builder purchaseOrder(Optional> purchaseOrder) { + this.purchaseOrder = purchaseOrder; + return this; + } + + public Builder purchaseOrder(List purchaseOrder) { + this.purchaseOrder = Optional.ofNullable(purchaseOrder); + return this; + } + + @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) + public Builder trackingCategory(Optional> trackingCategory) { + this.trackingCategory = trackingCategory; + return this; + } + + public Builder trackingCategory(List trackingCategory) { + this.trackingCategory = Optional.ofNullable(trackingCategory); + return this; + } + + @JsonSetter(value = "JournalEntry", nulls = Nulls.SKIP) + public Builder journalEntry(Optional> journalEntry) { + this.journalEntry = journalEntry; + return this; + } + + public Builder journalEntry(List journalEntry) { + this.journalEntry = Optional.ofNullable(journalEntry); + return this; + } + + @JsonSetter(value = "TaxRate", nulls = Nulls.SKIP) + public Builder taxRate(Optional> taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(List taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "Invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional> invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(List invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + @JsonSetter(value = "Payment", nulls = Nulls.SKIP) + public Builder payment(Optional> payment) { + this.payment = payment; + return this; + } + + public Builder payment(List payment) { + this.payment = Optional.ofNullable(payment); + return this; + } + + @JsonSetter(value = "Expense", nulls = Nulls.SKIP) + public Builder expense(Optional> expense) { + this.expense = expense; + return this; + } + + public Builder expense(List expense) { + this.expense = Optional.ofNullable(expense); + return this; + } + + @JsonSetter(value = "VendorCredit", nulls = Nulls.SKIP) + public Builder vendorCredit(Optional> vendorCredit) { + this.vendorCredit = vendorCredit; + return this; + } + + public Builder vendorCredit(List vendorCredit) { + this.vendorCredit = Optional.ofNullable(vendorCredit); + return this; + } + + @JsonSetter(value = "Transaction", nulls = Nulls.SKIP) + public Builder transaction(Optional> transaction) { + this.transaction = transaction; + return this; + } + + public Builder transaction(List transaction) { + this.transaction = Optional.ofNullable(transaction); + return this; + } + + @JsonSetter(value = "AccountingPeriod", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional> accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(List accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + @JsonSetter(value = "GeneralLedgerTransaction", nulls = Nulls.SKIP) + public Builder generalLedgerTransaction(Optional> generalLedgerTransaction) { + this.generalLedgerTransaction = generalLedgerTransaction; + return this; + } + + public Builder generalLedgerTransaction(List generalLedgerTransaction) { + this.generalLedgerTransaction = Optional.ofNullable(generalLedgerTransaction); + return this; + } + + @JsonSetter(value = "BankFeedAccount", nulls = Nulls.SKIP) + public Builder bankFeedAccount(Optional> bankFeedAccount) { + this.bankFeedAccount = bankFeedAccount; + return this; + } + + public Builder bankFeedAccount(List bankFeedAccount) { + this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); + return this; + } + + @JsonSetter(value = "Employee", nulls = Nulls.SKIP) + public Builder employee(Optional> employee) { + this.employee = employee; + return this; + } + + public Builder employee(List employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "PaymentMethod", nulls = Nulls.SKIP) + public Builder paymentMethod(Optional> paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + public Builder paymentMethod(List paymentMethod) { + this.paymentMethod = Optional.ofNullable(paymentMethod); + return this; + } + + @JsonSetter(value = "PaymentTerm", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional> paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(List paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse( + account, + accountingAttachment, + balanceSheet, + cashFlowStatement, + companyInfo, + contact, + incomeStatement, + creditNote, + item, + purchaseOrder, + trackingCategory, + journalEntry, + taxRate, + invoice, + payment, + expense, + vendorCredit, + transaction, + accountingPeriod, + generalLedgerTransaction, + bankFeedAccount, + employee, + paymentMethod, + paymentTerm, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldClass.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldClass.java new file mode 100644 index 000000000..ed21f7a96 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldClass.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldClass.Builder.class) +public final class RemoteFieldClass { + private final Optional id; + + private final Optional displayName; + + private final Optional remoteKeyName; + + private final Optional description; + + private final Optional isCustom; + + private final Optional isRequired; + + private final Optional fieldType; + + private final Optional fieldFormat; + + private final Optional> fieldChoices; + + private final Optional itemSchema; + + private final Map additionalProperties; + + private RemoteFieldClass( + Optional id, + Optional displayName, + Optional remoteKeyName, + Optional description, + Optional isCustom, + Optional isRequired, + Optional fieldType, + Optional fieldFormat, + Optional> fieldChoices, + Optional itemSchema, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.remoteKeyName = remoteKeyName; + this.description = description; + this.isCustom = isCustom; + this.isRequired = isRequired; + this.fieldType = fieldType; + this.fieldFormat = fieldFormat; + this.fieldChoices = fieldChoices; + this.itemSchema = itemSchema; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("field_type") + public Optional getFieldType() { + return fieldType; + } + + @JsonProperty("field_format") + public Optional getFieldFormat() { + return fieldFormat; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @JsonProperty("item_schema") + public Optional getItemSchema() { + return itemSchema; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClass && equalTo((RemoteFieldClass) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClass other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && remoteKeyName.equals(other.remoteKeyName) + && description.equals(other.description) + && isCustom.equals(other.isCustom) + && isRequired.equals(other.isRequired) + && fieldType.equals(other.fieldType) + && fieldFormat.equals(other.fieldFormat) + && fieldChoices.equals(other.fieldChoices) + && itemSchema.equals(other.itemSchema); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.displayName, + this.remoteKeyName, + this.description, + this.isCustom, + this.isRequired, + this.fieldType, + this.fieldFormat, + this.fieldChoices, + this.itemSchema); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional fieldType = Optional.empty(); + + private Optional fieldFormat = Optional.empty(); + + private Optional> fieldChoices = Optional.empty(); + + private Optional itemSchema = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldClass other) { + id(other.getId()); + displayName(other.getDisplayName()); + remoteKeyName(other.getRemoteKeyName()); + description(other.getDescription()); + isCustom(other.getIsCustom()); + isRequired(other.getIsRequired()); + fieldType(other.getFieldType()); + fieldFormat(other.getFieldFormat()); + fieldChoices(other.getFieldChoices()); + itemSchema(other.getItemSchema()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public Builder remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + public Builder remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public Builder isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + public Builder isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @JsonSetter(value = "field_type", nulls = Nulls.SKIP) + public Builder fieldType(Optional fieldType) { + this.fieldType = fieldType; + return this; + } + + public Builder fieldType(FieldTypeEnum fieldType) { + this.fieldType = Optional.ofNullable(fieldType); + return this; + } + + @JsonSetter(value = "field_format", nulls = Nulls.SKIP) + public Builder fieldFormat(Optional fieldFormat) { + this.fieldFormat = fieldFormat; + return this; + } + + public Builder fieldFormat(FieldFormatEnum fieldFormat) { + this.fieldFormat = Optional.ofNullable(fieldFormat); + return this; + } + + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public Builder fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + public Builder fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) + public Builder itemSchema(Optional itemSchema) { + this.itemSchema = itemSchema; + return this; + } + + public Builder itemSchema(ItemSchema itemSchema) { + this.itemSchema = Optional.ofNullable(itemSchema); + return this; + } + + public RemoteFieldClass build() { + return new RemoteFieldClass( + id, + displayName, + remoteKeyName, + description, + isCustom, + isRequired, + fieldType, + fieldFormat, + fieldChoices, + itemSchema, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldRemoteFieldClass.java new file mode 100644 index 000000000..14c4696fa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldRemoteFieldClass.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldRemoteFieldClass.Deserializer.class) +public final class RemoteFieldRemoteFieldClass { + private final Object value; + + private final int type; + + private RemoteFieldRemoteFieldClass(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((RemoteFieldClass) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRemoteFieldClass && equalTo((RemoteFieldRemoteFieldClass) other); + } + + private boolean equalTo(RemoteFieldRemoteFieldClass other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldRemoteFieldClass of(String value) { + return new RemoteFieldRemoteFieldClass(value, 0); + } + + public static RemoteFieldRemoteFieldClass of(RemoteFieldClass value) { + return new RemoteFieldRemoteFieldClass(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteFieldClass value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldRemoteFieldClass.class); + } + + @java.lang.Override + public RemoteFieldRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java new file mode 100644 index 000000000..c4f4f85d8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldRequest.Builder.class) +public final class RemoteFieldRequest { + private final RemoteFieldRequestRemoteFieldClass remoteFieldClass; + + private final Optional value; + + private final Map additionalProperties; + + private RemoteFieldRequest( + RemoteFieldRequestRemoteFieldClass remoteFieldClass, + Optional value, + Map additionalProperties) { + this.remoteFieldClass = remoteFieldClass; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_field_class") + public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { + return remoteFieldClass; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRequest && equalTo((RemoteFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldRequest other) { + return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteFieldClassStage builder() { + return new Builder(); + } + + public interface RemoteFieldClassStage { + _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass); + + Builder from(RemoteFieldRequest other); + } + + public interface _FinalStage { + RemoteFieldRequest build(); + + _FinalStage value(Optional value); + + _FinalStage value(JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteFieldClassStage, _FinalStage { + private RemoteFieldRequestRemoteFieldClass remoteFieldClass; + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldRequest other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @java.lang.Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public RemoteFieldRequest build() { + return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldRequestRemoteFieldClass.java new file mode 100644 index 000000000..7cb799dc0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldRequestRemoteFieldClass.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldRequestRemoteFieldClass.Deserializer.class) +public final class RemoteFieldRequestRemoteFieldClass { + private final Object value; + + private final int type; + + private RemoteFieldRequestRemoteFieldClass(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((RemoteFieldClass) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRequestRemoteFieldClass + && equalTo((RemoteFieldRequestRemoteFieldClass) other); + } + + private boolean equalTo(RemoteFieldRequestRemoteFieldClass other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldRequestRemoteFieldClass of(String value) { + return new RemoteFieldRequestRemoteFieldClass(value, 0); + } + + public static RemoteFieldRequestRemoteFieldClass of(RemoteFieldClass value) { + return new RemoteFieldRequestRemoteFieldClass(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteFieldClass value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldRequestRemoteFieldClass.class); + } + + @java.lang.Override + public RemoteFieldRequestRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..d5ccbfdee --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteKey.java b/src/main/java/com/merge/api/accounting/types/RemoteKey.java new file mode 100644 index 000000000..86b9587bc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/accounting/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..2e9c0d510 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteResponse.java b/src/main/java/com/merge/api/accounting/types/RemoteResponse.java new file mode 100644 index 000000000..566d94c3e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(ResponseTypeEnum responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ReportItem.java b/src/main/java/com/merge/api/accounting/types/ReportItem.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/ReportItem.java rename to src/main/java/com/merge/api/accounting/types/ReportItem.java index 8dd7dc03a..8d9373165 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/ReportItem.java +++ b/src/main/java/com/merge/api/accounting/types/ReportItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/accounting/types/RequestFormatEnum.java b/src/main/java/com/merge/api/accounting/types/RequestFormatEnum.java new file mode 100644 index 000000000..ebe4b5f3b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RequestFormatEnum { + JSON("JSON"), + + XML("XML"), + + MULTIPART("MULTIPART"); + + private final String value; + + RequestFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/accounting/types/ResponseTypeEnum.java new file mode 100644 index 000000000..48ead3b49 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ResponseTypeEnum { + JSON("JSON"), + + BASE_64_GZIP("BASE64_GZIP"); + + private final String value; + + ResponseTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RoleEnum.java b/src/main/java/com/merge/api/accounting/types/RoleEnum.java new file mode 100644 index 000000000..cc54acbd1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RoleEnum { + ADMIN("ADMIN"), + + DEVELOPER("DEVELOPER"), + + MEMBER("MEMBER"), + + API("API"), + + SYSTEM("SYSTEM"), + + MERGE_TEAM("MERGE_TEAM"); + + private final String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/accounting/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..44a9d4ec4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SelectiveSyncConfigurationsUsageEnum { + IN_NEXT_SYNC("IN_NEXT_SYNC"), + + IN_LAST_SYNC("IN_LAST_SYNC"); + + private final String value; + + SelectiveSyncConfigurationsUsageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Status7D1Enum.java b/src/main/java/com/merge/api/accounting/types/Status7D1Enum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/Status7D1Enum.java rename to src/main/java/com/merge/api/accounting/types/Status7D1Enum.java index 7a849226c..c2625fc50 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/Status7D1Enum.java +++ b/src/main/java/com/merge/api/accounting/types/Status7D1Enum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/types/Status895Enum.java b/src/main/java/com/merge/api/accounting/types/Status895Enum.java similarity index 89% rename from src/main/java/com/merge/api/resources/accounting/types/Status895Enum.java rename to src/main/java/com/merge/api/accounting/types/Status895Enum.java index 797672865..a36aa2e32 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/Status895Enum.java +++ b/src/main/java/com/merge/api/accounting/types/Status895Enum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/StatusFd5Enum.java b/src/main/java/com/merge/api/accounting/types/StatusFd5Enum.java new file mode 100644 index 000000000..9c0e8f2cd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/StatusFd5Enum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum StatusFd5Enum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + StatusFd5Enum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SyncStatus.java b/src/main/java/com/merge/api/accounting/types/SyncStatus.java new file mode 100644 index 000000000..c5ab47c7d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final StatusFd5Enum status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + StatusFd5Enum status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public StatusFd5Enum getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull StatusFd5Enum status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private StatusFd5Enum status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull StatusFd5Enum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/accounting/types/SyncStatusListRequest.java new file mode 100644 index 000000000..1975f081a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SyncStatusListRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/TaxComponent.java b/src/main/java/com/merge/api/accounting/types/TaxComponent.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/TaxComponent.java rename to src/main/java/com/merge/api/accounting/types/TaxComponent.java index 72c5b4be6..6ebec07fc 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TaxComponent.java +++ b/src/main/java/com/merge/api/accounting/types/TaxComponent.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,7 +35,7 @@ public final class TaxComponent { private final Optional isCompound; - private final Optional componentType; + private final Optional componentType; private final Optional remoteWasDeleted; @@ -49,7 +49,7 @@ private TaxComponent( Optional name, Optional rate, Optional isCompound, - Optional componentType, + Optional componentType, Optional remoteWasDeleted, Map additionalProperties) { this.id = id; @@ -125,7 +125,7 @@ public Optional getIsCompound() { * */ @JsonProperty("component_type") - public Optional getComponentType() { + public Optional getComponentType() { return componentType; } @@ -199,7 +199,7 @@ public static final class Builder { private Optional isCompound = Optional.empty(); - private Optional componentType = Optional.empty(); + private Optional componentType = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -299,12 +299,12 @@ public Builder isCompound(Boolean isCompound) { } @JsonSetter(value = "component_type", nulls = Nulls.SKIP) - public Builder componentType(Optional componentType) { + public Builder componentType(Optional componentType) { this.componentType = componentType; return this; } - public Builder componentType(TaxComponentComponentType componentType) { + public Builder componentType(ComponentTypeEnum componentType) { this.componentType = Optional.ofNullable(componentType); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/TaxRate.java b/src/main/java/com/merge/api/accounting/types/TaxRate.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/types/TaxRate.java rename to src/main/java/com/merge/api/accounting/types/TaxRate.java index 67362252a..e36a65bfc 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TaxRate.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRate.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -39,7 +39,7 @@ public final class TaxRate { private final Optional description; - private final Optional status; + private final Optional status; private final Optional country; @@ -66,7 +66,7 @@ private TaxRate( Optional code, Optional name, Optional description, - Optional status, + Optional status, Optional country, Optional totalTaxRate, Optional effectiveTaxRate, @@ -163,7 +163,7 @@ public Optional getDescription() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -295,7 +295,7 @@ public static final class Builder { private Optional description = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional country = Optional.empty(); @@ -425,12 +425,12 @@ public Builder description(String description) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TaxRateStatus status) { + public Builder status(Status7D1Enum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/TaxRateCompany.java b/src/main/java/com/merge/api/accounting/types/TaxRateCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/TaxRateCompany.java rename to src/main/java/com/merge/api/accounting/types/TaxRateCompany.java index 3df649887..7ccc15b68 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TaxRateCompany.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRateCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TaxRateCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TaxRateCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/TaxRateTaxComponentsItem.java b/src/main/java/com/merge/api/accounting/types/TaxRateTaxComponentsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/TaxRateTaxComponentsItem.java rename to src/main/java/com/merge/api/accounting/types/TaxRateTaxComponentsItem.java index d4c4a31cb..e8542ae0f 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TaxRateTaxComponentsItem.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRateTaxComponentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional companyId; private final Optional createdAfter; @@ -29,8 +33,6 @@ public final class TaxRatesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -41,6 +43,8 @@ public final class TaxRatesListRequest { private final Optional modifiedBefore; + private final Optional name; + private final Optional pageSize; private final Optional remoteId; @@ -48,34 +52,44 @@ public final class TaxRatesListRequest { private final Map additionalProperties; private TaxRatesListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, Optional modifiedAfter, Optional modifiedBefore, + Optional name, Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; this.modifiedAfter = modifiedAfter; this.modifiedBefore = modifiedBefore; + this.name = name; this.pageSize = pageSize; this.remoteId = remoteId; this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return tax rates for this company. */ @@ -108,14 +122,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -156,6 +162,14 @@ public Optional getModifiedBefore() { return modifiedBefore; } + /** + * @return If provided, will only return TaxRates with this name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + /** * @return Number of results to return per page. */ @@ -184,16 +198,17 @@ public Map getAdditionalProperties() { } private boolean equalTo(TaxRatesListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) && modifiedAfter.equals(other.modifiedAfter) && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) && pageSize.equals(other.pageSize) && remoteId.equals(other.remoteId); } @@ -201,16 +216,17 @@ private boolean equalTo(TaxRatesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, this.modifiedAfter, this.modifiedBefore, + this.name, this.pageSize, this.remoteId); } @@ -226,6 +242,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -234,8 +252,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -246,6 +262,8 @@ public static final class Builder { private Optional modifiedBefore = Optional.empty(); + private Optional name = Optional.empty(); + private Optional pageSize = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -256,21 +274,38 @@ public static final class Builder { private Builder() {} public Builder from(TaxRatesListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); modifiedAfter(other.getModifiedAfter()); modifiedBefore(other.getModifiedBefore()); + name(other.getName()); pageSize(other.getPageSize()); remoteId(other.getRemoteId()); return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -315,17 +350,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -381,6 +405,17 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { return this; } + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { this.pageSize = pageSize; @@ -405,16 +440,17 @@ public Builder remoteId(String remoteId) { public TaxRatesListRequest build() { return new TaxRatesListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, modifiedAfter, modifiedBefore, + name, pageSize, remoteId, additionalProperties); diff --git a/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequest.java new file mode 100644 index 000000000..bc83a4034 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TaxRatesRetrieveRequest.Builder.class) +public final class TaxRatesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private TaxRatesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaxRatesRetrieveRequest && equalTo((TaxRatesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaxRatesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TaxRatesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public TaxRatesRetrieveRequest build() { + return new TaxRatesRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/trackingcategories/requests/TrackingCategoriesListRequest.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java similarity index 83% rename from src/main/java/com/merge/api/resources/accounting/trackingcategories/requests/TrackingCategoriesListRequest.java rename to src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java index 310b4dd81..c4dd18b32 100644 --- a/src/main/java/com/merge/api/resources/accounting/trackingcategories/requests/TrackingCategoriesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.trackingcategories.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,6 +23,10 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TrackingCategoriesListRequest.Builder.class) public final class TrackingCategoriesListRequest { + private final Optional> expand; + + private final Optional categoryType; + private final Optional companyId; private final Optional createdAfter; @@ -29,8 +35,6 @@ public final class TrackingCategoriesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -41,6 +45,8 @@ public final class TrackingCategoriesListRequest { private final Optional modifiedBefore; + private final Optional name; + private final Optional pageSize; private final Optional remoteFields; @@ -49,41 +55,65 @@ public final class TrackingCategoriesListRequest { private final Optional showEnumOrigins; + private final Optional status; + private final Map additionalProperties; private TrackingCategoriesListRequest( + Optional> expand, + Optional categoryType, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, Optional modifiedAfter, Optional modifiedBefore, + Optional name, Optional pageSize, Optional remoteFields, Optional remoteId, Optional showEnumOrigins, + Optional status, Map additionalProperties) { + this.expand = expand; + this.categoryType = categoryType; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; this.modifiedAfter = modifiedAfter; this.modifiedBefore = modifiedBefore; + this.name = name; this.pageSize = pageSize; this.remoteFields = remoteFields; this.remoteId = remoteId; this.showEnumOrigins = showEnumOrigins; + this.status = status; this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return tracking categories with this type. + */ + @JsonProperty("category_type") + public Optional getCategoryType() { + return categoryType; + } + /** * @return If provided, will only return tracking categories for this company. */ @@ -116,14 +146,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -164,6 +186,14 @@ public Optional getModifiedBefore() { return modifiedBefore; } + /** + * @return If provided, will only return TrackingCategories with this name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + /** * @return Number of results to return per page. */ @@ -196,6 +226,14 @@ public Optional getShowEnumOrigins() { return showEnumOrigins; } + /** + * @return If provided, will only return tracking categories with this status. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -208,39 +246,45 @@ public Map getAdditionalProperties() { } private boolean equalTo(TrackingCategoriesListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && categoryType.equals(other.categoryType) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) && modifiedAfter.equals(other.modifiedAfter) && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) && pageSize.equals(other.pageSize) && remoteFields.equals(other.remoteFields) && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins); + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status); } @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, + this.categoryType, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, this.modifiedAfter, this.modifiedBefore, + this.name, this.pageSize, this.remoteFields, this.remoteId, - this.showEnumOrigins); + this.showEnumOrigins, + this.status); } @java.lang.Override @@ -254,6 +298,10 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional categoryType = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -262,8 +310,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -274,6 +320,8 @@ public static final class Builder { private Optional modifiedBefore = Optional.empty(); + private Optional name = Optional.empty(); + private Optional pageSize = Optional.empty(); private Optional remoteFields = Optional.empty(); @@ -282,26 +330,58 @@ public static final class Builder { private Optional showEnumOrigins = Optional.empty(); + private Optional status = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(TrackingCategoriesListRequest other) { + expand(other.getExpand()); + categoryType(other.getCategoryType()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); modifiedAfter(other.getModifiedAfter()); modifiedBefore(other.getModifiedBefore()); + name(other.getName()); pageSize(other.getPageSize()); remoteFields(other.getRemoteFields()); remoteId(other.getRemoteId()); showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "category_type", nulls = Nulls.SKIP) + public Builder categoryType(Optional categoryType) { + this.categoryType = categoryType; + return this; + } + + public Builder categoryType(String categoryType) { + this.categoryType = Optional.ofNullable(categoryType); return this; } @@ -349,17 +429,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -415,6 +484,17 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { return this; } + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { this.pageSize = pageSize; @@ -459,22 +539,36 @@ public Builder showEnumOrigins(String showEnumOrigins) { return this; } + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + public TrackingCategoriesListRequest build() { return new TrackingCategoriesListRequest( + expand, + categoryType, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, modifiedAfter, modifiedBefore, + name, pageSize, remoteFields, remoteId, showEnumOrigins, + status, additionalProperties); } } diff --git a/src/main/java/com/merge/api/resources/accounting/trackingcategories/requests/TrackingCategoriesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequest.java similarity index 76% rename from src/main/java/com/merge/api/resources/accounting/trackingcategories/requests/TrackingCategoriesRetrieveRequest.java rename to src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequest.java index 6f6f9a372..f720a03c3 100644 --- a/src/main/java/com/merge/api/resources/accounting/trackingcategories/requests/TrackingCategoriesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.trackingcategories.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -20,10 +22,12 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TrackingCategoriesRetrieveRequest.Builder.class) public final class TrackingCategoriesRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -31,13 +35,15 @@ public final class TrackingCategoriesRetrieveRequest { private final Map additionalProperties; private TrackingCategoriesRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -47,7 +53,7 @@ private TrackingCategoriesRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -59,6 +65,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -89,13 +103,15 @@ public Map getAdditionalProperties() { private boolean equalTo(TrackingCategoriesRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -109,10 +125,12 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -125,22 +143,28 @@ private Builder() {} public Builder from(TrackingCategoriesRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(String expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -152,6 +176,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -176,7 +211,7 @@ public Builder showEnumOrigins(String showEnumOrigins) { public TrackingCategoriesRetrieveRequest build() { return new TrackingCategoriesRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategory.java b/src/main/java/com/merge/api/accounting/types/TrackingCategory.java similarity index 93% rename from src/main/java/com/merge/api/resources/accounting/types/TrackingCategory.java rename to src/main/java/com/merge/api/accounting/types/TrackingCategory.java index c0583385a..b54d7995e 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategory.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategory.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -32,9 +32,9 @@ public final class TrackingCategory { private final Optional name; - private final Optional status; + private final Optional status; - private final Optional categoryType; + private final Optional categoryType; private final Optional parentCategory; @@ -52,8 +52,8 @@ private TrackingCategory( Optional createdAt, Optional modifiedAt, Optional name, - Optional status, - Optional categoryType, + Optional status, + Optional categoryType, Optional parentCategory, Optional company, Optional remoteWasDeleted, @@ -118,7 +118,7 @@ public Optional getName() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -130,7 +130,7 @@ public Optional getStatus() { * */ @JsonProperty("category_type") - public Optional getCategoryType() { + public Optional getCategoryType() { return categoryType; } @@ -222,9 +222,9 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); - private Optional categoryType = Optional.empty(); + private Optional categoryType = Optional.empty(); private Optional parentCategory = Optional.empty(); @@ -310,23 +310,23 @@ public Builder name(String name) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TrackingCategoryStatus status) { + public Builder status(Status7D1Enum status) { this.status = Optional.ofNullable(status); return this; } @JsonSetter(value = "category_type", nulls = Nulls.SKIP) - public Builder categoryType(Optional categoryType) { + public Builder categoryType(Optional categoryType) { this.categoryType = categoryType; return this; } - public Builder categoryType(TrackingCategoryCategoryType categoryType) { + public Builder categoryType(CategoryTypeEnum categoryType) { this.categoryType = Optional.ofNullable(categoryType); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryCompany.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoryCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryCompany.java rename to src/main/java/com/merge/api/accounting/types/TrackingCategoryCompany.java index 6a37335b4..51aa86ea2 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryCompany.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoryCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TrackingCategoryCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TrackingCategoryCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/Transaction.java b/src/main/java/com/merge/api/accounting/types/Transaction.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/Transaction.java rename to src/main/java/com/merge/api/accounting/types/Transaction.java index ac5ca3814..b126a05a3 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/Transaction.java +++ b/src/main/java/com/merge/api/accounting/types/Transaction.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -45,7 +45,7 @@ public final class Transaction { private final Optional totalAmount; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -77,7 +77,7 @@ private Transaction( Optional contact, Optional inclusiveOfTax, Optional totalAmount, - Optional currency, + Optional currency, Optional exchangeRate, Optional company, Optional>> trackingCategories, @@ -507,7 +507,7 @@ public Optional getTotalAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -655,7 +655,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -824,12 +824,12 @@ public Builder totalAmount(String totalAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(TransactionCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionAccount.java b/src/main/java/com/merge/api/accounting/types/TransactionAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/TransactionAccount.java rename to src/main/java/com/merge/api/accounting/types/TransactionAccount.java index 574689359..391e4dcce 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionAccount.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TransactionAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TransactionAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/TransactionAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/TransactionAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/TransactionAccountingPeriod.java index 0e45ce92e..09f2eaa5c 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TransactionContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TransactionContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionCurrencyEnum.java b/src/main/java/com/merge/api/accounting/types/TransactionCurrencyEnum.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/TransactionCurrencyEnum.java rename to src/main/java/com/merge/api/accounting/types/TransactionCurrencyEnum.java index 853541e3d..61aeffc31 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionCurrencyEnum.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionCurrencyEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionLineItem.java b/src/main/java/com/merge/api/accounting/types/TransactionLineItem.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/TransactionLineItem.java rename to src/main/java/com/merge/api/accounting/types/TransactionLineItem.java index 4ca05a09f..0120f2f54 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionLineItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -48,7 +48,7 @@ public final class TransactionLineItem { private final Optional taxRate; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -72,7 +72,7 @@ private TransactionLineItem( Optional>> trackingCategories, Optional totalLineAmount, Optional taxRate, - Optional currency, + Optional currency, Optional exchangeRate, Optional company, Optional remoteWasDeleted, @@ -507,7 +507,7 @@ public Optional getTaxRate() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -625,7 +625,7 @@ public static final class Builder { private Optional taxRate = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -803,12 +803,12 @@ public Builder taxRate(String taxRate) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(TransactionLineItemCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionLineItemItem.java b/src/main/java/com/merge/api/accounting/types/TransactionLineItemItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/TransactionLineItemItem.java rename to src/main/java/com/merge/api/accounting/types/TransactionLineItemItem.java index 89c29ffd3..f3d69e7a0 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionLineItemItem.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionLineItemItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TransactionLineItemItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TransactionLineItemItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/TransactionTrackingCategoriesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/TransactionTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/TransactionTrackingCategoriesItem.java index 51acb87f2..d3aabac94 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionTrackingCategoriesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional companyId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class TransactionsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -53,11 +54,11 @@ public final class TransactionsListRequest { private final Map additionalProperties; private TransactionsListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -68,11 +69,11 @@ private TransactionsListRequest( Optional transactionDateAfter, Optional transactionDateBefore, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -85,6 +86,14 @@ private TransactionsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return accounting transactions for this company. */ @@ -117,14 +126,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -209,11 +210,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(TransactionsListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -228,11 +229,11 @@ private boolean equalTo(TransactionsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -255,6 +256,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -263,8 +266,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -289,11 +290,11 @@ public static final class Builder { private Builder() {} public Builder from(TransactionsListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -306,6 +307,22 @@ public Builder from(TransactionsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(TransactionsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -350,17 +367,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(TransactionsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -462,11 +468,11 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { public TransactionsListRequest build() { return new TransactionsListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/TransactionsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TransactionsListRequestExpandItem.java new file mode 100644 index 000000000..352d734e1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TransactionsListRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TransactionsListRequestExpandItem { + ACCOUNT("account"), + + ACCOUNTING_PERIOD("accounting_period"), + + CONTACT("contact"), + + LINE_ITEMS("line_items"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + TransactionsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequest.java new file mode 100644 index 000000000..573656154 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TransactionsRetrieveRequest.Builder.class) +public final class TransactionsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private TransactionsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionsRetrieveRequest && equalTo((TransactionsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TransactionsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TransactionsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(TransactionsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public TransactionsRetrieveRequest build() { + return new TransactionsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..0f0a9a430 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TransactionsRetrieveRequestExpandItem { + ACCOUNT("account"), + + ACCOUNTING_PERIOD("accounting_period"), + + CONTACT("contact"), + + LINE_ITEMS("line_items"), + + TRACKING_CATEGORIES("tracking_categories"); + + private final String value; + + TransactionsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/UnderlyingTransactionTypeEnum.java b/src/main/java/com/merge/api/accounting/types/UnderlyingTransactionTypeEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/accounting/types/UnderlyingTransactionTypeEnum.java rename to src/main/java/com/merge/api/accounting/types/UnderlyingTransactionTypeEnum.java index 137cc5044..992ff11ce 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/UnderlyingTransactionTypeEnum.java +++ b/src/main/java/com/merge/api/accounting/types/UnderlyingTransactionTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/accounting/types/ValidationProblemSource.java b/src/main/java/com/merge/api/accounting/types/ValidationProblemSource.java new file mode 100644 index 000000000..81406683c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ValidationProblemSource.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ValidationProblemSource.Builder.class) +public final class ValidationProblemSource { + private final String pointer; + + private final Map additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCredit.java b/src/main/java/com/merge/api/accounting/types/VendorCredit.java similarity index 98% rename from src/main/java/com/merge/api/resources/accounting/types/VendorCredit.java rename to src/main/java/com/merge/api/accounting/types/VendorCredit.java index e774ca551..a7311fbad 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCredit.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCredit.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -39,7 +39,7 @@ public final class VendorCredit { private final Optional totalAmount; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -72,7 +72,7 @@ private VendorCredit( Optional transactionDate, Optional vendor, Optional totalAmount, - Optional currency, + Optional currency, Optional exchangeRate, Optional inclusiveOfTax, Optional company, @@ -479,7 +479,7 @@ public Optional getTotalAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -635,7 +635,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -774,12 +774,12 @@ public Builder totalAmount(Double totalAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(VendorCreditCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/VendorCreditAccountingPeriod.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/VendorCreditAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditAccountingPeriod.java index 43099b29e..388715d73 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,8 +80,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public VendorCreditCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public VendorCreditCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditEndpointRequest.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditEndpointRequest.java index b77863f9d..9241a1587 100644 --- a/src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditEndpointRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.vendorcredits.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.VendorCreditRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLine.java b/src/main/java/com/merge/api/accounting/types/VendorCreditLine.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/VendorCreditLine.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditLine.java index 827155513..6302f41d9 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLine.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditLine.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineAccount.java b/src/main/java/com/merge/api/accounting/types/VendorCreditLineAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineAccount.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditLineAccount.java index 4f043e195..8b2316190 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineAccount.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditLineAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public VendorCreditLineAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public VendorCreditLineAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineRequest.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditLineRequest.java index ad39cca1d..99969da9a 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineRequestAccount.java b/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequestAccount.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditLineRequestAccount.java index 2cd0d1391..8afa36c0a 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditLineRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer totalAmount; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -56,7 +56,7 @@ private VendorCreditRequest( Optional transactionDate, Optional vendor, Optional totalAmount, - Optional currency, + Optional currency, Optional exchangeRate, Optional inclusiveOfTax, Optional company, @@ -426,7 +426,7 @@ public Optional getTotalAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -549,7 +549,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -635,12 +635,12 @@ public Builder totalAmount(Double totalAmount) { } @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(VendorCreditRequestCurrency currency) { + public Builder currency(TransactionCurrencyEnum currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditRequestAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/VendorCreditRequestAccountingPeriod.java similarity index 96% rename from src/main/java/com/merge/api/resources/accounting/types/VendorCreditRequestAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditRequestAccountingPeriod.java index 17d40f347..a953dbe57 100644 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditRequestAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditRequestAccountingPeriod.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.types; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public VendorCreditVendor deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public VendorCreditVendor deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditsListRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditsListRequest.java rename to src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java index 418e12fac..911a3eeee 100644 --- a/src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.accounting.vendorcredits.requests; +package com.merge.api.accounting.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.vendorcredits.types.VendorCreditsListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = VendorCreditsListRequest.Builder.class) public final class VendorCreditsListRequest { + private final Optional> expand; + private final Optional companyId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class VendorCreditsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -53,11 +54,11 @@ public final class VendorCreditsListRequest { private final Map additionalProperties; private VendorCreditsListRequest( + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -68,11 +69,11 @@ private VendorCreditsListRequest( Optional transactionDateAfter, Optional transactionDateBefore, Map additionalProperties) { + this.expand = expand; this.companyId = companyId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -85,6 +86,14 @@ private VendorCreditsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return vendor credits for this company. */ @@ -117,14 +126,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -209,11 +210,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(VendorCreditsListRequest other) { - return companyId.equals(other.companyId) + return expand.equals(other.expand) + && companyId.equals(other.companyId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -228,11 +229,11 @@ private boolean equalTo(VendorCreditsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.companyId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -255,6 +256,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -263,8 +266,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -289,11 +290,11 @@ public static final class Builder { private Builder() {} public Builder from(VendorCreditsListRequest other) { + expand(other.getExpand()); companyId(other.getCompanyId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -306,6 +307,22 @@ public Builder from(VendorCreditsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(VendorCreditsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) public Builder companyId(Optional companyId) { this.companyId = companyId; @@ -350,17 +367,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(VendorCreditsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -462,11 +468,11 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { public VendorCreditsListRequest build() { return new VendorCreditsListRequest( + expand, companyId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequestExpandItem.java new file mode 100644 index 000000000..cfd679beb --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum VendorCreditsListRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + LINES("lines"), + + TRACKING_CATEGORIES("tracking_categories"), + + VENDOR("vendor"); + + private final String value; + + VendorCreditsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditsRetrieveRequest.java new file mode 100644 index 000000000..ddbe30140 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = VendorCreditsRetrieveRequest.Builder.class) +public final class VendorCreditsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private VendorCreditsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditsRetrieveRequest && equalTo((VendorCreditsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(VendorCreditsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(VendorCreditsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(VendorCreditsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public VendorCreditsRetrieveRequest build() { + return new VendorCreditsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/VendorCreditsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..6ec42e383 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditsRetrieveRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum VendorCreditsRetrieveRequestExpandItem { + ACCOUNTING_PERIOD("accounting_period"), + + COMPANY("company"), + + LINES("lines"), + + TRACKING_CATEGORIES("tracking_categories"), + + VENDOR("vendor"); + + private final String value; + + VendorCreditsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/accounting/types/WarningValidationProblem.java b/src/main/java/com/merge/api/accounting/types/WarningValidationProblem.java new file mode 100644 index 000000000..12be0ced9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/WarningValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/WebhookReceiver.java b/src/main/java/com/merge/api/accounting/types/WebhookReceiver.java new file mode 100644 index 000000000..e4bc7a9c0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/accounting/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..e73ad6cfa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/AccountDetailsClient.java b/src/main/java/com/merge/api/ats/AccountDetailsClient.java new file mode 100644 index 000000000..3cc2111d8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetails; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/AccountTokenClient.java b/src/main/java/com/merge/api/ats/AccountTokenClient.java new file mode 100644 index 000000000..6a4214805 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AccountTokenClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/ActivitiesClient.java b/src/main/java/com/merge/api/ats/ActivitiesClient.java new file mode 100644 index 000000000..6f83be845 --- /dev/null +++ b/src/main/java/com/merge/api/ats/ActivitiesClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.ActivitiesListRequest; +import com.merge.api.ats.types.ActivitiesRetrieveRequest; +import com.merge.api.ats.types.Activity; +import com.merge.api.ats.types.ActivityEndpointRequest; +import com.merge.api.ats.types.ActivityResponse; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ActivitiesClient { + protected final ClientOptions clientOptions; + + private final RawActivitiesClient rawClient; + + public ActivitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawActivitiesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawActivitiesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Activity objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Activity objects. + */ + public SyncPagingIterable list(ActivitiesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Activity objects. + */ + public SyncPagingIterable list(ActivitiesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Activity object with the given values. + */ + public ActivityResponse create(ActivityEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Activity object with the given values. + */ + public ActivityResponse create(ActivityEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Activity object with the given id. + */ + public Activity retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Activity object with the given id. + */ + public Activity retrieve(String id, ActivitiesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Activity object with the given id. + */ + public Activity retrieve(String id, ActivitiesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Activity POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Activity POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/ApplicationsClient.java b/src/main/java/com/merge/api/ats/ApplicationsClient.java new file mode 100644 index 000000000..acce68ba6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/ApplicationsClient.java @@ -0,0 +1,137 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Application; +import com.merge.api.ats.types.ApplicationEndpointRequest; +import com.merge.api.ats.types.ApplicationResponse; +import com.merge.api.ats.types.ApplicationsListRequest; +import com.merge.api.ats.types.ApplicationsMetaPostRetrieveRequest; +import com.merge.api.ats.types.ApplicationsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.UpdateApplicationStageRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ApplicationsClient { + protected final ClientOptions clientOptions; + + private final RawApplicationsClient rawClient; + + public ApplicationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawApplicationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawApplicationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Application objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Application objects. + */ + public SyncPagingIterable list(ApplicationsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Application objects. + */ + public SyncPagingIterable list(ApplicationsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public ApplicationResponse create(ApplicationEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public ApplicationResponse create(ApplicationEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Application object with the given id. + */ + public Application retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Application object with the given id. + */ + public Application retrieve(String id, ApplicationsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Application object with the given id. + */ + public Application retrieve(String id, ApplicationsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates the current_stage field of an Application object + */ + public ApplicationResponse changeStageCreate(String id) { + return this.rawClient.changeStageCreate(id).body(); + } + + /** + * Updates the current_stage field of an Application object + */ + public ApplicationResponse changeStageCreate(String id, UpdateApplicationStageRequest request) { + return this.rawClient.changeStageCreate(id, request).body(); + } + + /** + * Updates the current_stage field of an Application object + */ + public ApplicationResponse changeStageCreate( + String id, UpdateApplicationStageRequest request, RequestOptions requestOptions) { + return this.rawClient.changeStageCreate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Application POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Application POSTs. + */ + public MetaResponse metaPostRetrieve(ApplicationsMetaPostRetrieveRequest request) { + return this.rawClient.metaPostRetrieve(request).body(); + } + + /** + * Returns metadata for Application POSTs. + */ + public MetaResponse metaPostRetrieve(ApplicationsMetaPostRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/ats/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..fd1e3d888 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetails; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/ats/AsyncAccountTokenClient.java new file mode 100644 index 000000000..24a6e3af5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncAccountTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncActivitiesClient.java b/src/main/java/com/merge/api/ats/AsyncActivitiesClient.java new file mode 100644 index 000000000..9d49379bd --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncActivitiesClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.ActivitiesListRequest; +import com.merge.api.ats.types.ActivitiesRetrieveRequest; +import com.merge.api.ats.types.Activity; +import com.merge.api.ats.types.ActivityEndpointRequest; +import com.merge.api.ats.types.ActivityResponse; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncActivitiesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawActivitiesClient rawClient; + + public AsyncActivitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawActivitiesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawActivitiesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Activity objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Activity objects. + */ + public CompletableFuture> list(ActivitiesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Activity objects. + */ + public CompletableFuture> list( + ActivitiesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Activity object with the given values. + */ + public CompletableFuture create(ActivityEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Activity object with the given values. + */ + public CompletableFuture create(ActivityEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Activity object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Activity object with the given id. + */ + public CompletableFuture retrieve(String id, ActivitiesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Activity object with the given id. + */ + public CompletableFuture retrieve( + String id, ActivitiesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Activity POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Activity POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncApplicationsClient.java b/src/main/java/com/merge/api/ats/AsyncApplicationsClient.java new file mode 100644 index 000000000..369f392c1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncApplicationsClient.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Application; +import com.merge.api.ats.types.ApplicationEndpointRequest; +import com.merge.api.ats.types.ApplicationResponse; +import com.merge.api.ats.types.ApplicationsListRequest; +import com.merge.api.ats.types.ApplicationsMetaPostRetrieveRequest; +import com.merge.api.ats.types.ApplicationsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.UpdateApplicationStageRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncApplicationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawApplicationsClient rawClient; + + public AsyncApplicationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawApplicationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawApplicationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Application objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Application objects. + */ + public CompletableFuture> list(ApplicationsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Application objects. + */ + public CompletableFuture> list( + ApplicationsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public CompletableFuture create(ApplicationEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public CompletableFuture create( + ApplicationEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Application object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Application object with the given id. + */ + public CompletableFuture retrieve(String id, ApplicationsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Application object with the given id. + */ + public CompletableFuture retrieve( + String id, ApplicationsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates the current_stage field of an Application object + */ + public CompletableFuture changeStageCreate(String id) { + return this.rawClient.changeStageCreate(id).thenApply(response -> response.body()); + } + + /** + * Updates the current_stage field of an Application object + */ + public CompletableFuture changeStageCreate(String id, UpdateApplicationStageRequest request) { + return this.rawClient.changeStageCreate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates the current_stage field of an Application object + */ + public CompletableFuture changeStageCreate( + String id, UpdateApplicationStageRequest request, RequestOptions requestOptions) { + return this.rawClient.changeStageCreate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Application POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Application POSTs. + */ + public CompletableFuture metaPostRetrieve(ApplicationsMetaPostRetrieveRequest request) { + return this.rawClient.metaPostRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Application POSTs. + */ + public CompletableFuture metaPostRetrieve( + ApplicationsMetaPostRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/ats/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..f43c40863 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AsyncPassthroughReciept; +import com.merge.api.ats.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.ats.types.DataPassthroughRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncAtsClient.java b/src/main/java/com/merge/api/ats/AsyncAtsClient.java new file mode 100644 index 000000000..73cc6adee --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncAtsClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncAtsClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier activitiesClient; + + protected final Supplier applicationsClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier attachmentsClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier candidatesClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier departmentsClient; + + protected final Supplier eeocsClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier interviewsClient; + + protected final Supplier issuesClient; + + protected final Supplier jobInterviewStagesClient; + + protected final Supplier jobPostingsClient; + + protected final Supplier jobsClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier offersClient; + + protected final Supplier officesClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier rejectReasonsClient; + + protected final Supplier scorecardsClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier tagsClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public AsyncAtsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.activitiesClient = Suppliers.memoize(() -> new AsyncActivitiesClient(clientOptions)); + this.applicationsClient = Suppliers.memoize(() -> new AsyncApplicationsClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AsyncAttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.candidatesClient = Suppliers.memoize(() -> new AsyncCandidatesClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.departmentsClient = Suppliers.memoize(() -> new AsyncDepartmentsClient(clientOptions)); + this.eeocsClient = Suppliers.memoize(() -> new AsyncEeocsClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.interviewsClient = Suppliers.memoize(() -> new AsyncInterviewsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.jobInterviewStagesClient = Suppliers.memoize(() -> new AsyncJobInterviewStagesClient(clientOptions)); + this.jobPostingsClient = Suppliers.memoize(() -> new AsyncJobPostingsClient(clientOptions)); + this.jobsClient = Suppliers.memoize(() -> new AsyncJobsClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.offersClient = Suppliers.memoize(() -> new AsyncOffersClient(clientOptions)); + this.officesClient = Suppliers.memoize(() -> new AsyncOfficesClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.rejectReasonsClient = Suppliers.memoize(() -> new AsyncRejectReasonsClient(clientOptions)); + this.scorecardsClient = Suppliers.memoize(() -> new AsyncScorecardsClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.tagsClient = Suppliers.memoize(() -> new AsyncTagsClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncActivitiesClient activities() { + return this.activitiesClient.get(); + } + + public AsyncApplicationsClient applications() { + return this.applicationsClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncCandidatesClient candidates() { + return this.candidatesClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncDepartmentsClient departments() { + return this.departmentsClient.get(); + } + + public AsyncEeocsClient eeocs() { + return this.eeocsClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncInterviewsClient interviews() { + return this.interviewsClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncJobInterviewStagesClient jobInterviewStages() { + return this.jobInterviewStagesClient.get(); + } + + public AsyncJobPostingsClient jobPostings() { + return this.jobPostingsClient.get(); + } + + public AsyncJobsClient jobs() { + return this.jobsClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncOffersClient offers() { + return this.offersClient.get(); + } + + public AsyncOfficesClient offices() { + return this.officesClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncRejectReasonsClient rejectReasons() { + return this.rejectReasonsClient.get(); + } + + public AsyncScorecardsClient scorecards() { + return this.scorecardsClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncTagsClient tags() { + return this.tagsClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncAttachmentsClient.java b/src/main/java/com/merge/api/ats/AsyncAttachmentsClient.java new file mode 100644 index 000000000..56d2a72ce --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncAttachmentsClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Attachment; +import com.merge.api.ats.types.AttachmentEndpointRequest; +import com.merge.api.ats.types.AttachmentResponse; +import com.merge.api.ats.types.AttachmentsListRequest; +import com.merge.api.ats.types.AttachmentsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncAttachmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAttachmentsClient rawClient; + + public AsyncAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list(AttachmentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture create(AttachmentEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture create( + AttachmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Attachment POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Attachment POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/ats/AsyncAuditTrailClient.java new file mode 100644 index 000000000..735a22fcd --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AuditLogEvent; +import com.merge.api.ats.types.AuditTrailListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/ats/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..0f4fe9486 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AvailableActions; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncCandidatesClient.java b/src/main/java/com/merge/api/ats/AsyncCandidatesClient.java new file mode 100644 index 000000000..f76462148 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncCandidatesClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Candidate; +import com.merge.api.ats.types.CandidateEndpointRequest; +import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesRetrieveRequest; +import com.merge.api.ats.types.IgnoreCommonModelRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PatchedCandidateEndpointRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncCandidatesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCandidatesClient rawClient; + + public AsyncCandidatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCandidatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCandidatesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Candidate objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Candidate objects. + */ + public CompletableFuture> list(CandidatesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Candidate objects. + */ + public CompletableFuture> list( + CandidatesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Candidate object with the given values. + */ + public CompletableFuture create(CandidateEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Candidate object with the given values. + */ + public CompletableFuture create( + CandidateEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Candidate object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Candidate object with the given id. + */ + public CompletableFuture retrieve(String id, CandidatesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Candidate object with the given id. + */ + public CompletableFuture retrieve( + String id, CandidatesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates a Candidate object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedCandidateEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a Candidate object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedCandidateEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Candidate POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Candidate POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/ats/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..ba0f53458 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncDepartmentsClient.java b/src/main/java/com/merge/api/ats/AsyncDepartmentsClient.java new file mode 100644 index 000000000..fcf03d3f7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncDepartmentsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Department; +import com.merge.api.ats.types.DepartmentsListRequest; +import com.merge.api.ats.types.DepartmentsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncDepartmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDepartmentsClient rawClient; + + public AsyncDepartmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDepartmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDepartmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Department objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Department objects. + */ + public CompletableFuture> list(DepartmentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Department objects. + */ + public CompletableFuture> list( + DepartmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Department object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Department object with the given id. + */ + public CompletableFuture retrieve(String id, DepartmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Department object with the given id. + */ + public CompletableFuture retrieve( + String id, DepartmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncEeocsClient.java b/src/main/java/com/merge/api/ats/AsyncEeocsClient.java new file mode 100644 index 000000000..eb9b0c254 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncEeocsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Eeoc; +import com.merge.api.ats.types.EeocsListRequest; +import com.merge.api.ats.types.EeocsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncEeocsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEeocsClient rawClient; + + public AsyncEeocsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEeocsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEeocsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EEOC objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of EEOC objects. + */ + public CompletableFuture> list(EeocsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of EEOC objects. + */ + public CompletableFuture> list(EeocsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an EEOC object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an EEOC object with the given id. + */ + public CompletableFuture retrieve(String id, EeocsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an EEOC object with the given id. + */ + public CompletableFuture retrieve(String id, EeocsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/ats/AsyncFieldMappingClient.java new file mode 100644 index 000000000..069ad5597 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncFieldMappingClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.CreateFieldMappingRequest; +import com.merge.api.ats.types.ExternalTargetFieldApiResponse; +import com.merge.api.ats.types.FieldMappingApiInstanceResponse; +import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsRetrieveRequest; +import com.merge.api.ats.types.PatchedEditFieldMappingRequest; +import com.merge.api.ats.types.RemoteFieldApiResponse; +import com.merge.api.ats.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncForceResyncClient.java b/src/main/java/com/merge/api/ats/AsyncForceResyncClient.java new file mode 100644 index 000000000..f3e6e4928 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/ats/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..92c64848d --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.GenerateRemoteKeyRequest; +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncInterviewsClient.java b/src/main/java/com/merge/api/ats/AsyncInterviewsClient.java new file mode 100644 index 000000000..9fb4aea68 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncInterviewsClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.InterviewsListRequest; +import com.merge.api.ats.types.InterviewsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.ScheduledInterview; +import com.merge.api.ats.types.ScheduledInterviewEndpointRequest; +import com.merge.api.ats.types.ScheduledInterviewResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncInterviewsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawInterviewsClient rawClient; + + public AsyncInterviewsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawInterviewsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawInterviewsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public CompletableFuture> list(InterviewsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public CompletableFuture> list( + InterviewsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public CompletableFuture create(ScheduledInterviewEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public CompletableFuture create( + ScheduledInterviewEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public CompletableFuture retrieve(String id, InterviewsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public CompletableFuture retrieve( + String id, InterviewsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncIssuesClient.java b/src/main/java/com/merge/api/ats/AsyncIssuesClient.java new file mode 100644 index 000000000..aca9ca991 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Issue; +import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncJobInterviewStagesClient.java b/src/main/java/com/merge/api/ats/AsyncJobInterviewStagesClient.java new file mode 100644 index 000000000..cbed22fbc --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncJobInterviewStagesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobInterviewStage; +import com.merge.api.ats.types.JobInterviewStagesListRequest; +import com.merge.api.ats.types.JobInterviewStagesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncJobInterviewStagesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawJobInterviewStagesClient rawClient; + + public AsyncJobInterviewStagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawJobInterviewStagesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawJobInterviewStagesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public CompletableFuture> list(JobInterviewStagesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public CompletableFuture> list( + JobInterviewStagesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public CompletableFuture retrieve(String id, JobInterviewStagesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public CompletableFuture retrieve( + String id, JobInterviewStagesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncJobPostingsClient.java b/src/main/java/com/merge/api/ats/AsyncJobPostingsClient.java new file mode 100644 index 000000000..638bd6935 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncJobPostingsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobPosting; +import com.merge.api.ats.types.JobPostingsListRequest; +import com.merge.api.ats.types.JobPostingsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncJobPostingsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawJobPostingsClient rawClient; + + public AsyncJobPostingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawJobPostingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawJobPostingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of JobPosting objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of JobPosting objects. + */ + public CompletableFuture> list(JobPostingsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of JobPosting objects. + */ + public CompletableFuture> list( + JobPostingsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a JobPosting object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a JobPosting object with the given id. + */ + public CompletableFuture retrieve(String id, JobPostingsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a JobPosting object with the given id. + */ + public CompletableFuture retrieve( + String id, JobPostingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncJobsClient.java b/src/main/java/com/merge/api/ats/AsyncJobsClient.java new file mode 100644 index 000000000..d3554d28f --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncJobsClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Job; +import com.merge.api.ats.types.JobsListRequest; +import com.merge.api.ats.types.JobsRetrieveRequest; +import com.merge.api.ats.types.JobsScreeningQuestionsListRequest; +import com.merge.api.ats.types.ScreeningQuestion; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncJobsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawJobsClient rawClient; + + public AsyncJobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawJobsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawJobsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Job objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Job objects. + */ + public CompletableFuture> list(JobsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Job objects. + */ + public CompletableFuture> list(JobsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Job object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Job object with the given id. + */ + public CompletableFuture retrieve(String id, JobsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Job object with the given id. + */ + public CompletableFuture retrieve(String id, JobsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public CompletableFuture> screeningQuestionsList(String jobId) { + return this.rawClient.screeningQuestionsList(jobId).thenApply(response -> response.body()); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public CompletableFuture> screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request) { + return this.rawClient.screeningQuestionsList(jobId, request).thenApply(response -> response.body()); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public CompletableFuture> screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request, RequestOptions requestOptions) { + return this.rawClient + .screeningQuestionsList(jobId, request, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/ats/AsyncLinkTokenClient.java new file mode 100644 index 000000000..6b8f75234 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.EndUserDetailsRequest; +import com.merge.api.ats.types.LinkToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/ats/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..981373eaa --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetailsAndActions; +import com.merge.api.ats.types.LinkedAccountsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncOffersClient.java b/src/main/java/com/merge/api/ats/AsyncOffersClient.java new file mode 100644 index 000000000..5e9db7d1a --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncOffersClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Offer; +import com.merge.api.ats.types.OffersListRequest; +import com.merge.api.ats.types.OffersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncOffersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOffersClient rawClient; + + public AsyncOffersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOffersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOffersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Offer objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Offer objects. + */ + public CompletableFuture> list(OffersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Offer objects. + */ + public CompletableFuture> list(OffersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Offer object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Offer object with the given id. + */ + public CompletableFuture retrieve(String id, OffersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Offer object with the given id. + */ + public CompletableFuture retrieve(String id, OffersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncOfficesClient.java b/src/main/java/com/merge/api/ats/AsyncOfficesClient.java new file mode 100644 index 000000000..0b96d0251 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncOfficesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Office; +import com.merge.api.ats.types.OfficesListRequest; +import com.merge.api.ats.types.OfficesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncOfficesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOfficesClient rawClient; + + public AsyncOfficesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOfficesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOfficesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Office objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Office objects. + */ + public CompletableFuture> list(OfficesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Office objects. + */ + public CompletableFuture> list( + OfficesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Office object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Office object with the given id. + */ + public CompletableFuture retrieve(String id, OfficesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Office object with the given id. + */ + public CompletableFuture retrieve( + String id, OfficesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncPassthroughClient.java b/src/main/java/com/merge/api/ats/AsyncPassthroughClient.java new file mode 100644 index 000000000..721ebfc33 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.DataPassthroughRequest; +import com.merge.api.ats.types.RemoteResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/ats/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..0e705a95e --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawAccountDetailsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetails; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/ats/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..510e32952 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawAccountTokenClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java b/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java new file mode 100644 index 000000000..a6878f9d2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java @@ -0,0 +1,423 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.ActivitiesListRequest; +import com.merge.api.ats.types.ActivitiesRetrieveRequest; +import com.merge.api.ats.types.Activity; +import com.merge.api.ats.types.ActivityEndpointRequest; +import com.merge.api.ats.types.ActivityResponse; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedActivityList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawActivitiesClient { + protected final ClientOptions clientOptions; + + public AsyncRawActivitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Activity objects. + */ + public CompletableFuture>> list() { + return list(ActivitiesListRequest.builder().build()); + } + + /** + * Returns a list of Activity objects. + */ + public CompletableFuture>> list(ActivitiesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Activity objects. + */ + public CompletableFuture>> list( + ActivitiesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getUserId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_id", request.getUserId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedActivityList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedActivityList.class); + Optional startingAfter = parsedResponse.getNext(); + ActivitiesListRequest nextRequest = ActivitiesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Activity object with the given values. + */ + public CompletableFuture> create(ActivityEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Activity object with the given values. + */ + public CompletableFuture> create( + ActivityEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ActivityResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Activity object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ActivitiesRetrieveRequest.builder().build()); + } + + /** + * Returns an Activity object with the given id. + */ + public CompletableFuture> retrieve(String id, ActivitiesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Activity object with the given id. + */ + public CompletableFuture> retrieve( + String id, ActivitiesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Activity.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Activity POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Activity POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java b/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java new file mode 100644 index 000000000..8826aaedb --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java @@ -0,0 +1,534 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Application; +import com.merge.api.ats.types.ApplicationEndpointRequest; +import com.merge.api.ats.types.ApplicationResponse; +import com.merge.api.ats.types.ApplicationsListRequest; +import com.merge.api.ats.types.ApplicationsMetaPostRetrieveRequest; +import com.merge.api.ats.types.ApplicationsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedApplicationList; +import com.merge.api.ats.types.UpdateApplicationStageRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawApplicationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawApplicationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Application objects. + */ + public CompletableFuture>> list() { + return list(ApplicationsListRequest.builder().build()); + } + + /** + * Returns a list of Application objects. + */ + public CompletableFuture>> list( + ApplicationsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Application objects. + */ + public CompletableFuture>> list( + ApplicationsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications"); + if (request.getCandidateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "candidate_id", request.getCandidateId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCreditedToId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "credited_to_id", request.getCreditedToId().get(), false); + } + if (request.getCurrentStageId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "current_stage_id", request.getCurrentStageId().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_id", request.getJobId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRejectReasonId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "reject_reason_id", request.getRejectReasonId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getSource().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "source", request.getSource().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedApplicationList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedApplicationList.class); + Optional startingAfter = parsedResponse.getNext(); + ApplicationsListRequest nextRequest = ApplicationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public CompletableFuture> create(ApplicationEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public CompletableFuture> create( + ApplicationEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Application object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ApplicationsRetrieveRequest.builder().build()); + } + + /** + * Returns an Application object with the given id. + */ + public CompletableFuture> retrieve( + String id, ApplicationsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Application object with the given id. + */ + public CompletableFuture> retrieve( + String id, ApplicationsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Application.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates the current_stage field of an Application object + */ + public CompletableFuture> changeStageCreate(String id) { + return changeStageCreate(id, UpdateApplicationStageRequest.builder().build()); + } + + /** + * Updates the current_stage field of an Application object + */ + public CompletableFuture> changeStageCreate( + String id, UpdateApplicationStageRequest request) { + return changeStageCreate(id, request, null); + } + + /** + * Updates the current_stage field of an Application object + */ + public CompletableFuture> changeStageCreate( + String id, UpdateApplicationStageRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications") + .addPathSegment(id) + .addPathSegments("change-stage"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + if (request.getJobInterviewStage().isPresent()) { + properties.put("job_interview_stage", request.getJobInterviewStage()); + } + if (request.getRemoteUserId().isPresent()) { + properties.put("remote_user_id", request.getRemoteUserId()); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Application POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(ApplicationsMetaPostRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Application POSTs. + */ + public CompletableFuture> metaPostRetrieve( + ApplicationsMetaPostRetrieveRequest request) { + return metaPostRetrieve(request, null); + } + + /** + * Returns metadata for Application POSTs. + */ + public CompletableFuture> metaPostRetrieve( + ApplicationsMetaPostRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications/meta/post"); + if (request.getApplicationRemoteTemplateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "application_remote_template_id", + request.getApplicationRemoteTemplateId().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..a5e67682b --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.AsyncPassthroughReciept; +import com.merge.api.ats.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.ats.types.DataPassthroughRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughReciept.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java b/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java new file mode 100644 index 000000000..9c73e0016 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java @@ -0,0 +1,419 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Attachment; +import com.merge.api.ats.types.AttachmentEndpointRequest; +import com.merge.api.ats.types.AttachmentResponse; +import com.merge.api.ats.types.AttachmentsListRequest; +import com.merge.api.ats.types.AttachmentsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedAttachmentList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAttachmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments"); + if (request.getCandidateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "candidate_id", request.getCandidateId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAttachmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture> create(AttachmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture> create( + AttachmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AttachmentResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve(String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Attachment POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Attachment POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..6201748f1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AuditLogEvent; +import com.merge.api.ats.types.AuditTrailListRequest; +import com.merge.api.ats.types.PaginatedAuditLogEventList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/ats/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..ec863edc6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawAvailableActionsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AvailableActions; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java b/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java new file mode 100644 index 000000000..e1cd441d8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java @@ -0,0 +1,616 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.Candidate; +import com.merge.api.ats.types.CandidateEndpointRequest; +import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesRetrieveRequest; +import com.merge.api.ats.types.IgnoreCommonModelRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedCandidateList; +import com.merge.api.ats.types.PatchedCandidateEndpointRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCandidatesClient { + protected final ClientOptions clientOptions; + + public AsyncRawCandidatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Candidate objects. + */ + public CompletableFuture>> list() { + return list(CandidatesListRequest.builder().build()); + } + + /** + * Returns a list of Candidate objects. + */ + public CompletableFuture>> list(CandidatesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Candidate objects. + */ + public CompletableFuture>> list( + CandidatesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddresses().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_addresses", request.getEmailAddresses().get(), false); + } + if (request.getFirstName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "first_name", request.getFirstName().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getLastName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "last_name", request.getLastName().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTags().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "tags", request.getTags().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCandidateList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCandidateList.class); + Optional startingAfter = parsedResponse.getNext(); + CandidatesListRequest nextRequest = CandidatesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Candidate object with the given values. + */ + public CompletableFuture> create(CandidateEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Candidate object with the given values. + */ + public CompletableFuture> create( + CandidateEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Candidate object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CandidatesRetrieveRequest.builder().build()); + } + + /** + * Returns a Candidate object with the given id. + */ + public CompletableFuture> retrieve(String id, CandidatesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Candidate object with the given id. + */ + public CompletableFuture> retrieve( + String id, CandidatesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Candidate.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a Candidate object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCandidateEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Candidate object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCandidateEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Candidate POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Candidate POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/ats/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..53c9959c5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawDeleteAccountClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java b/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java new file mode 100644 index 000000000..6d3b2d853 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java @@ -0,0 +1,252 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Department; +import com.merge.api.ats.types.DepartmentsListRequest; +import com.merge.api.ats.types.DepartmentsRetrieveRequest; +import com.merge.api.ats.types.PaginatedDepartmentList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDepartmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawDepartmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Department objects. + */ + public CompletableFuture>> list() { + return list(DepartmentsListRequest.builder().build()); + } + + /** + * Returns a list of Department objects. + */ + public CompletableFuture>> list( + DepartmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Department objects. + */ + public CompletableFuture>> list( + DepartmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/departments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedDepartmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedDepartmentList.class); + Optional startingAfter = parsedResponse.getNext(); + DepartmentsListRequest nextRequest = DepartmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Department object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, DepartmentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Department object with the given id. + */ + public CompletableFuture> retrieve(String id, DepartmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Department object with the given id. + */ + public CompletableFuture> retrieve( + String id, DepartmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/departments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Department.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java b/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java new file mode 100644 index 000000000..b0bdf3f73 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java @@ -0,0 +1,284 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Eeoc; +import com.merge.api.ats.types.EeocsListRequest; +import com.merge.api.ats.types.EeocsRetrieveRequest; +import com.merge.api.ats.types.PaginatedEeocList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEeocsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEeocsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EEOC objects. + */ + public CompletableFuture>> list() { + return list(EeocsListRequest.builder().build()); + } + + /** + * Returns a list of EEOC objects. + */ + public CompletableFuture>> list(EeocsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EEOC objects. + */ + public CompletableFuture>> list( + EeocsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/eeocs"); + if (request.getCandidateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "candidate_id", request.getCandidateId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEeocList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEeocList.class); + Optional startingAfter = parsedResponse.getNext(); + EeocsListRequest nextRequest = EeocsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an EEOC object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EeocsRetrieveRequest.builder().build()); + } + + /** + * Returns an EEOC object with the given id. + */ + public CompletableFuture> retrieve(String id, EeocsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EEOC object with the given id. + */ + public CompletableFuture> retrieve( + String id, EeocsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/eeocs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Eeoc.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..27a02f22c --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.CreateFieldMappingRequest; +import com.merge.api.ats.types.ExternalTargetFieldApiResponse; +import com.merge.api.ats.types.FieldMappingApiInstanceResponse; +import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsRetrieveRequest; +import com.merge.api.ats.types.PatchedEditFieldMappingRequest; +import com.merge.api.ats.types.RemoteFieldApiResponse; +import com.merge.api.ats.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), RemoteFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/ats/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..9af27710d --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawForceResyncClient.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/ats/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..c4693be6c --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawGenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.GenerateRemoteKeyRequest; +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java b/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java new file mode 100644 index 000000000..159643196 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java @@ -0,0 +1,439 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.InterviewsListRequest; +import com.merge.api.ats.types.InterviewsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedScheduledInterviewList; +import com.merge.api.ats.types.ScheduledInterview; +import com.merge.api.ats.types.ScheduledInterviewEndpointRequest; +import com.merge.api.ats.types.ScheduledInterviewResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawInterviewsClient { + protected final ClientOptions clientOptions; + + public AsyncRawInterviewsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public CompletableFuture>> list() { + return list(InterviewsListRequest.builder().build()); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public CompletableFuture>> list( + InterviewsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public CompletableFuture>> list( + InterviewsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews"); + if (request.getApplicationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "application_id", request.getApplicationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_id", request.getJobId().get(), false); + } + if (request.getJobInterviewStageId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "job_interview_stage_id", + request.getJobInterviewStageId().get(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrganizerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "organizer_id", request.getOrganizerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedScheduledInterviewList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedScheduledInterviewList.class); + Optional startingAfter = parsedResponse.getNext(); + InterviewsListRequest nextRequest = InterviewsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public CompletableFuture> create( + ScheduledInterviewEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public CompletableFuture> create( + ScheduledInterviewEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ScheduledInterviewResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, InterviewsRetrieveRequest.builder().build()); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public CompletableFuture> retrieve( + String id, InterviewsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public CompletableFuture> retrieve( + String id, InterviewsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ScheduledInterview.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java new file mode 100644 index 000000000..1a804dfd6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Issue; +import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.ats.types.PaginatedIssueList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java b/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java new file mode 100644 index 000000000..3d90d40a8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java @@ -0,0 +1,267 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobInterviewStage; +import com.merge.api.ats.types.JobInterviewStagesListRequest; +import com.merge.api.ats.types.JobInterviewStagesRetrieveRequest; +import com.merge.api.ats.types.PaginatedJobInterviewStageList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawJobInterviewStagesClient { + protected final ClientOptions clientOptions; + + public AsyncRawJobInterviewStagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public CompletableFuture>> list() { + return list(JobInterviewStagesListRequest.builder().build()); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public CompletableFuture>> list( + JobInterviewStagesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public CompletableFuture>> list( + JobInterviewStagesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-interview-stages"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_id", request.getJobId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedJobInterviewStageList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedJobInterviewStageList.class); + Optional startingAfter = parsedResponse.getNext(); + JobInterviewStagesListRequest nextRequest = JobInterviewStagesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, JobInterviewStagesRetrieveRequest.builder().build()); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public CompletableFuture> retrieve( + String id, JobInterviewStagesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public CompletableFuture> retrieve( + String id, JobInterviewStagesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-interview-stages") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobInterviewStage.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java b/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java new file mode 100644 index 000000000..5c51762a7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobPosting; +import com.merge.api.ats.types.JobPostingsListRequest; +import com.merge.api.ats.types.JobPostingsRetrieveRequest; +import com.merge.api.ats.types.PaginatedJobPostingList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawJobPostingsClient { + protected final ClientOptions clientOptions; + + public AsyncRawJobPostingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of JobPosting objects. + */ + public CompletableFuture>> list() { + return list(JobPostingsListRequest.builder().build()); + } + + /** + * Returns a list of JobPosting objects. + */ + public CompletableFuture>> list( + JobPostingsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of JobPosting objects. + */ + public CompletableFuture>> list( + JobPostingsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-postings"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedJobPostingList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedJobPostingList.class); + Optional startingAfter = parsedResponse.getNext(); + JobPostingsListRequest nextRequest = JobPostingsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a JobPosting object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, JobPostingsRetrieveRequest.builder().build()); + } + + /** + * Returns a JobPosting object with the given id. + */ + public CompletableFuture> retrieve(String id, JobPostingsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a JobPosting object with the given id. + */ + public CompletableFuture> retrieve( + String id, JobPostingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-postings") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobPosting.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java b/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java new file mode 100644 index 000000000..ff7e026a1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java @@ -0,0 +1,409 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Job; +import com.merge.api.ats.types.JobsListRequest; +import com.merge.api.ats.types.JobsRetrieveRequest; +import com.merge.api.ats.types.JobsScreeningQuestionsListRequest; +import com.merge.api.ats.types.PaginatedJobList; +import com.merge.api.ats.types.PaginatedScreeningQuestionList; +import com.merge.api.ats.types.ScreeningQuestion; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawJobsClient { + protected final ClientOptions clientOptions; + + public AsyncRawJobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Job objects. + */ + public CompletableFuture>> list() { + return list(JobsListRequest.builder().build()); + } + + /** + * Returns a list of Job objects. + */ + public CompletableFuture>> list(JobsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Job objects. + */ + public CompletableFuture>> list( + JobsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/jobs"); + if (request.getCode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "code", request.getCode().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOffices().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offices", request.getOffices().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedJobList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJobList.class); + Optional startingAfter = parsedResponse.getNext(); + JobsListRequest nextRequest = JobsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Job object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, JobsRetrieveRequest.builder().build()); + } + + /** + * Returns a Job object with the given id. + */ + public CompletableFuture> retrieve(String id, JobsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Job object with the given id. + */ + public CompletableFuture> retrieve( + String id, JobsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/jobs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Job.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public CompletableFuture>> screeningQuestionsList( + String jobId) { + return screeningQuestionsList( + jobId, JobsScreeningQuestionsListRequest.builder().build()); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public CompletableFuture>> screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request) { + return screeningQuestionsList(jobId, request, null); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public CompletableFuture>> screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/jobs") + .addPathSegment(jobId) + .addPathSegments("screening-questions"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedScreeningQuestionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedScreeningQuestionList.class); + Optional startingAfter = parsedResponse.getNext(); + JobsScreeningQuestionsListRequest nextRequest = JobsScreeningQuestionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return screeningQuestionsList(jobId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..ace610cc7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.EndUserDetailsRequest; +import com.merge.api.ats.types.LinkToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..3746141cf --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetailsAndActions; +import com.merge.api.ats.types.LinkedAccountsListRequest; +import com.merge.api.ats.types.PaginatedAccountDetailsAndActionsList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java b/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java new file mode 100644 index 000000000..02eb8fe39 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Offer; +import com.merge.api.ats.types.OffersListRequest; +import com.merge.api.ats.types.OffersRetrieveRequest; +import com.merge.api.ats.types.PaginatedOfferList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOffersClient { + protected final ClientOptions clientOptions; + + public AsyncRawOffersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Offer objects. + */ + public CompletableFuture>> list() { + return list(OffersListRequest.builder().build()); + } + + /** + * Returns a list of Offer objects. + */ + public CompletableFuture>> list(OffersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Offer objects. + */ + public CompletableFuture>> list( + OffersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offers"); + if (request.getApplicationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "application_id", request.getApplicationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCreatorId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "creator_id", request.getCreatorId().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedOfferList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfferList.class); + Optional startingAfter = parsedResponse.getNext(); + OffersListRequest nextRequest = OffersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Offer object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, OffersRetrieveRequest.builder().build()); + } + + /** + * Returns an Offer object with the given id. + */ + public CompletableFuture> retrieve(String id, OffersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Offer object with the given id. + */ + public CompletableFuture> retrieve( + String id, OffersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offers") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Offer.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java b/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java new file mode 100644 index 000000000..d180f1f97 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Office; +import com.merge.api.ats.types.OfficesListRequest; +import com.merge.api.ats.types.OfficesRetrieveRequest; +import com.merge.api.ats.types.PaginatedOfficeList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOfficesClient { + protected final ClientOptions clientOptions; + + public AsyncRawOfficesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Office objects. + */ + public CompletableFuture>> list() { + return list(OfficesListRequest.builder().build()); + } + + /** + * Returns a list of Office objects. + */ + public CompletableFuture>> list(OfficesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Office objects. + */ + public CompletableFuture>> list( + OfficesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offices"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedOfficeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfficeList.class); + Optional startingAfter = parsedResponse.getNext(); + OfficesListRequest nextRequest = OfficesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Office object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, OfficesRetrieveRequest.builder().build()); + } + + /** + * Returns an Office object with the given id. + */ + public CompletableFuture> retrieve(String id, OfficesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Office object with the given id. + */ + public CompletableFuture> retrieve( + String id, OfficesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offices") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Office.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/ats/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..94de4aeb9 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawPassthroughClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.DataPassthroughRequest; +import com.merge.api.ats.types.RemoteResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/ats/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..3b44d2484 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.ats.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java b/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java new file mode 100644 index 000000000..1392a4f53 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedRejectReasonList; +import com.merge.api.ats.types.RejectReason; +import com.merge.api.ats.types.RejectReasonsListRequest; +import com.merge.api.ats.types.RejectReasonsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRejectReasonsClient { + protected final ClientOptions clientOptions; + + public AsyncRawRejectReasonsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of RejectReason objects. + */ + public CompletableFuture>> list() { + return list(RejectReasonsListRequest.builder().build()); + } + + /** + * Returns a list of RejectReason objects. + */ + public CompletableFuture>> list( + RejectReasonsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of RejectReason objects. + */ + public CompletableFuture>> list( + RejectReasonsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/reject-reasons"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRejectReasonList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRejectReasonList.class); + Optional startingAfter = parsedResponse.getNext(); + RejectReasonsListRequest nextRequest = RejectReasonsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a RejectReason object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, RejectReasonsRetrieveRequest.builder().build()); + } + + /** + * Returns a RejectReason object with the given id. + */ + public CompletableFuture> retrieve( + String id, RejectReasonsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a RejectReason object with the given id. + */ + public CompletableFuture> retrieve( + String id, RejectReasonsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/reject-reasons") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RejectReason.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawScopesClient.java b/src/main/java/com/merge/api/ats/AsyncRawScopesClient.java new file mode 100644 index 000000000..57ae88bcd --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawScopesClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.CommonModelScopeApi; +import com.merge.api.ats.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java b/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java new file mode 100644 index 000000000..31c27061d --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java @@ -0,0 +1,286 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedScorecardList; +import com.merge.api.ats.types.Scorecard; +import com.merge.api.ats.types.ScorecardsListRequest; +import com.merge.api.ats.types.ScorecardsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScorecardsClient { + protected final ClientOptions clientOptions; + + public AsyncRawScorecardsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Scorecard objects. + */ + public CompletableFuture>> list() { + return list(ScorecardsListRequest.builder().build()); + } + + /** + * Returns a list of Scorecard objects. + */ + public CompletableFuture>> list(ScorecardsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Scorecard objects. + */ + public CompletableFuture>> list( + ScorecardsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/scorecards"); + if (request.getApplicationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "application_id", request.getApplicationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getInterviewId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "interview_id", request.getInterviewId().get(), false); + } + if (request.getInterviewerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "interviewer_id", request.getInterviewerId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedScorecardList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedScorecardList.class); + Optional startingAfter = parsedResponse.getNext(); + ScorecardsListRequest nextRequest = ScorecardsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Scorecard object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ScorecardsRetrieveRequest.builder().build()); + } + + /** + * Returns a Scorecard object with the given id. + */ + public CompletableFuture> retrieve(String id, ScorecardsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Scorecard object with the given id. + */ + public CompletableFuture> retrieve( + String id, ScorecardsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/scorecards") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Scorecard.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..b3f3fa3a6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedSyncStatusList; +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.ats.types.SyncStatusListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java b/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java new file mode 100644 index 000000000..93940e903 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedTagList; +import com.merge.api.ats.types.Tag; +import com.merge.api.ats.types.TagsListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTagsClient { + protected final ClientOptions clientOptions; + + public AsyncRawTagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture>> list() { + return list(TagsListRequest.builder().build()); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture>> list(TagsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture>> list( + TagsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/tags"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTagList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + Optional startingAfter = parsedResponse.getNext(); + TagsListRequest nextRequest = TagsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java b/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java new file mode 100644 index 000000000..e30aa57ef --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java @@ -0,0 +1,271 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedRemoteUserList; +import com.merge.api.ats.types.RemoteUser; +import com.merge.api.ats.types.UsersListRequest; +import com.merge.api.ats.types.UsersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of RemoteUser objects. + */ + public CompletableFuture>> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of RemoteUser objects. + */ + public CompletableFuture>> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of RemoteUser objects. + */ + public CompletableFuture>> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email", request.getEmail().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteUserList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a RemoteUser object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public CompletableFuture> retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public CompletableFuture> retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteUser.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/ats/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..37aab5080 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.ats.types.WebhookReceiver; +import com.merge.api.ats.types.WebhookReceiverRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/ats/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..2a1a9e375 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.ats.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncRejectReasonsClient.java b/src/main/java/com/merge/api/ats/AsyncRejectReasonsClient.java new file mode 100644 index 000000000..bef37290a --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncRejectReasonsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.RejectReason; +import com.merge.api.ats.types.RejectReasonsListRequest; +import com.merge.api.ats.types.RejectReasonsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncRejectReasonsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRejectReasonsClient rawClient; + + public AsyncRejectReasonsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRejectReasonsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRejectReasonsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of RejectReason objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of RejectReason objects. + */ + public CompletableFuture> list(RejectReasonsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RejectReason objects. + */ + public CompletableFuture> list( + RejectReasonsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a RejectReason object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a RejectReason object with the given id. + */ + public CompletableFuture retrieve(String id, RejectReasonsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a RejectReason object with the given id. + */ + public CompletableFuture retrieve( + String id, RejectReasonsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncScopesClient.java b/src/main/java/com/merge/api/ats/AsyncScopesClient.java new file mode 100644 index 000000000..bbef7061f --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.CommonModelScopeApi; +import com.merge.api.ats.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncScorecardsClient.java b/src/main/java/com/merge/api/ats/AsyncScorecardsClient.java new file mode 100644 index 000000000..fc0194ab3 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncScorecardsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Scorecard; +import com.merge.api.ats.types.ScorecardsListRequest; +import com.merge.api.ats.types.ScorecardsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncScorecardsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScorecardsClient rawClient; + + public AsyncScorecardsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScorecardsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScorecardsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Scorecard objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Scorecard objects. + */ + public CompletableFuture> list(ScorecardsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Scorecard objects. + */ + public CompletableFuture> list( + ScorecardsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Scorecard object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Scorecard object with the given id. + */ + public CompletableFuture retrieve(String id, ScorecardsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Scorecard object with the given id. + */ + public CompletableFuture retrieve( + String id, ScorecardsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/ats/AsyncSyncStatusClient.java new file mode 100644 index 000000000..1667e800c --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.ats.types.SyncStatusListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncTagsClient.java b/src/main/java/com/merge/api/ats/AsyncTagsClient.java new file mode 100644 index 000000000..b8e2acbbb --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncTagsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Tag; +import com.merge.api.ats.types.TagsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncTagsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTagsClient rawClient; + + public AsyncTagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTagsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTagsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture> list(TagsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture> list(TagsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncUsersClient.java b/src/main/java/com/merge/api/ats/AsyncUsersClient.java new file mode 100644 index 000000000..0a67d54ea --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncUsersClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.RemoteUser; +import com.merge.api.ats.types.UsersListRequest; +import com.merge.api.ats.types.UsersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of RemoteUser objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteUser objects. + */ + public CompletableFuture> list(UsersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteUser objects. + */ + public CompletableFuture> list( + UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public CompletableFuture retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ats/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/ats/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..c76872b44 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.WebhookReceiver; +import com.merge.api.ats.types.WebhookReceiverRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/resources/ats/AtsClient.java b/src/main/java/com/merge/api/ats/AtsClient.java similarity index 80% rename from src/main/java/com/merge/api/resources/ats/AtsClient.java rename to src/main/java/com/merge/api/ats/AtsClient.java index e8a15d6d7..514524b20 100644 --- a/src/main/java/com/merge/api/resources/ats/AtsClient.java +++ b/src/main/java/com/merge/api/ats/AtsClient.java @@ -1,43 +1,10 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats; +package com.merge.api.ats; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; -import com.merge.api.resources.ats.accountdetails.AccountDetailsClient; -import com.merge.api.resources.ats.accounttoken.AccountTokenClient; -import com.merge.api.resources.ats.activities.ActivitiesClient; -import com.merge.api.resources.ats.applications.ApplicationsClient; -import com.merge.api.resources.ats.asyncpassthrough.AsyncPassthroughClient; -import com.merge.api.resources.ats.attachments.AttachmentsClient; -import com.merge.api.resources.ats.audittrail.AuditTrailClient; -import com.merge.api.resources.ats.availableactions.AvailableActionsClient; -import com.merge.api.resources.ats.candidates.CandidatesClient; -import com.merge.api.resources.ats.deleteaccount.DeleteAccountClient; -import com.merge.api.resources.ats.departments.DepartmentsClient; -import com.merge.api.resources.ats.eeocs.EeocsClient; -import com.merge.api.resources.ats.fieldmapping.FieldMappingClient; -import com.merge.api.resources.ats.forceresync.ForceResyncClient; -import com.merge.api.resources.ats.generatekey.GenerateKeyClient; -import com.merge.api.resources.ats.interviews.InterviewsClient; -import com.merge.api.resources.ats.issues.IssuesClient; -import com.merge.api.resources.ats.jobinterviewstages.JobInterviewStagesClient; -import com.merge.api.resources.ats.jobpostings.JobPostingsClient; -import com.merge.api.resources.ats.jobs.JobsClient; -import com.merge.api.resources.ats.linkedaccounts.LinkedAccountsClient; -import com.merge.api.resources.ats.linktoken.LinkTokenClient; -import com.merge.api.resources.ats.offers.OffersClient; -import com.merge.api.resources.ats.offices.OfficesClient; -import com.merge.api.resources.ats.passthrough.PassthroughClient; -import com.merge.api.resources.ats.regeneratekey.RegenerateKeyClient; -import com.merge.api.resources.ats.rejectreasons.RejectReasonsClient; -import com.merge.api.resources.ats.scopes.ScopesClient; -import com.merge.api.resources.ats.scorecards.ScorecardsClient; -import com.merge.api.resources.ats.syncstatus.SyncStatusClient; -import com.merge.api.resources.ats.tags.TagsClient; -import com.merge.api.resources.ats.users.UsersClient; -import com.merge.api.resources.ats.webhookreceivers.WebhookReceiversClient; import java.util.function.Supplier; public class AtsClient { diff --git a/src/main/java/com/merge/api/ats/AttachmentsClient.java b/src/main/java/com/merge/api/ats/AttachmentsClient.java new file mode 100644 index 000000000..bd0aaa1c1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AttachmentsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Attachment; +import com.merge.api.ats.types.AttachmentEndpointRequest; +import com.merge.api.ats.types.AttachmentResponse; +import com.merge.api.ats.types.AttachmentsListRequest; +import com.merge.api.ats.types.AttachmentsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class AttachmentsClient { + protected final ClientOptions clientOptions; + + private final RawAttachmentsClient rawClient; + + public AttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list(AttachmentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list(AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Attachment object with the given values. + */ + public AttachmentResponse create(AttachmentEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Attachment object with the given values. + */ + public AttachmentResponse create(AttachmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Attachment POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Attachment POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/AuditTrailClient.java b/src/main/java/com/merge/api/ats/AuditTrailClient.java new file mode 100644 index 000000000..0ac743540 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AuditLogEvent; +import com.merge.api.ats.types.AuditTrailListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/AvailableActionsClient.java b/src/main/java/com/merge/api/ats/AvailableActionsClient.java new file mode 100644 index 000000000..5954c6316 --- /dev/null +++ b/src/main/java/com/merge/api/ats/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AvailableActions; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/CandidatesClient.java b/src/main/java/com/merge/api/ats/CandidatesClient.java new file mode 100644 index 000000000..85fbb9df7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/CandidatesClient.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Candidate; +import com.merge.api.ats.types.CandidateEndpointRequest; +import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesRetrieveRequest; +import com.merge.api.ats.types.IgnoreCommonModelRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PatchedCandidateEndpointRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class CandidatesClient { + protected final ClientOptions clientOptions; + + private final RawCandidatesClient rawClient; + + public CandidatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCandidatesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCandidatesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Candidate objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Candidate objects. + */ + public SyncPagingIterable list(CandidatesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Candidate objects. + */ + public SyncPagingIterable list(CandidatesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Candidate object with the given values. + */ + public CandidateResponse create(CandidateEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Candidate object with the given values. + */ + public CandidateResponse create(CandidateEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Candidate object with the given id. + */ + public Candidate retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Candidate object with the given id. + */ + public Candidate retrieve(String id, CandidatesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Candidate object with the given id. + */ + public Candidate retrieve(String id, CandidatesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates a Candidate object with the given id. + */ + public CandidateResponse partialUpdate(String id, PatchedCandidateEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a Candidate object with the given id. + */ + public CandidateResponse partialUpdate( + String id, PatchedCandidateEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + this.rawClient.ignoreCreate(modelId, request).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for Candidate POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Candidate POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/DeleteAccountClient.java b/src/main/java/com/merge/api/ats/DeleteAccountClient.java new file mode 100644 index 000000000..219b802ee --- /dev/null +++ b/src/main/java/com/merge/api/ats/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/DepartmentsClient.java b/src/main/java/com/merge/api/ats/DepartmentsClient.java new file mode 100644 index 000000000..fabdec375 --- /dev/null +++ b/src/main/java/com/merge/api/ats/DepartmentsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Department; +import com.merge.api.ats.types.DepartmentsListRequest; +import com.merge.api.ats.types.DepartmentsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class DepartmentsClient { + protected final ClientOptions clientOptions; + + private final RawDepartmentsClient rawClient; + + public DepartmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDepartmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDepartmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Department objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Department objects. + */ + public SyncPagingIterable list(DepartmentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Department objects. + */ + public SyncPagingIterable list(DepartmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Department object with the given id. + */ + public Department retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Department object with the given id. + */ + public Department retrieve(String id, DepartmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Department object with the given id. + */ + public Department retrieve(String id, DepartmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/EeocsClient.java b/src/main/java/com/merge/api/ats/EeocsClient.java new file mode 100644 index 000000000..ae1b42229 --- /dev/null +++ b/src/main/java/com/merge/api/ats/EeocsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Eeoc; +import com.merge.api.ats.types.EeocsListRequest; +import com.merge.api.ats.types.EeocsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class EeocsClient { + protected final ClientOptions clientOptions; + + private final RawEeocsClient rawClient; + + public EeocsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEeocsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEeocsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EEOC objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of EEOC objects. + */ + public SyncPagingIterable list(EeocsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of EEOC objects. + */ + public SyncPagingIterable list(EeocsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an EEOC object with the given id. + */ + public Eeoc retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an EEOC object with the given id. + */ + public Eeoc retrieve(String id, EeocsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an EEOC object with the given id. + */ + public Eeoc retrieve(String id, EeocsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/FieldMappingClient.java b/src/main/java/com/merge/api/ats/FieldMappingClient.java new file mode 100644 index 000000000..05fab54c8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/FieldMappingClient.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.CreateFieldMappingRequest; +import com.merge.api.ats.types.ExternalTargetFieldApiResponse; +import com.merge.api.ats.types.FieldMappingApiInstanceResponse; +import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsRetrieveRequest; +import com.merge.api.ats.types.PatchedEditFieldMappingRequest; +import com.merge.api.ats.types.RemoteFieldApiResponse; +import com.merge.api.ats.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/ForceResyncClient.java b/src/main/java/com/merge/api/ats/ForceResyncClient.java new file mode 100644 index 000000000..bc833a542 --- /dev/null +++ b/src/main/java/com/merge/api/ats/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/GenerateKeyClient.java b/src/main/java/com/merge/api/ats/GenerateKeyClient.java new file mode 100644 index 000000000..8afae00fc --- /dev/null +++ b/src/main/java/com/merge/api/ats/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.GenerateRemoteKeyRequest; +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/InterviewsClient.java b/src/main/java/com/merge/api/ats/InterviewsClient.java new file mode 100644 index 000000000..328f98f00 --- /dev/null +++ b/src/main/java/com/merge/api/ats/InterviewsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.InterviewsListRequest; +import com.merge.api.ats.types.InterviewsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.ScheduledInterview; +import com.merge.api.ats.types.ScheduledInterviewEndpointRequest; +import com.merge.api.ats.types.ScheduledInterviewResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class InterviewsClient { + protected final ClientOptions clientOptions; + + private final RawInterviewsClient rawClient; + + public InterviewsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawInterviewsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawInterviewsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public SyncPagingIterable list(InterviewsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public SyncPagingIterable list(InterviewsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public ScheduledInterviewResponse create(ScheduledInterviewEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public ScheduledInterviewResponse create(ScheduledInterviewEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public ScheduledInterview retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public ScheduledInterview retrieve(String id, InterviewsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public ScheduledInterview retrieve(String id, InterviewsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/IssuesClient.java b/src/main/java/com/merge/api/ats/IssuesClient.java new file mode 100644 index 000000000..d5f428383 --- /dev/null +++ b/src/main/java/com/merge/api/ats/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Issue; +import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/JobInterviewStagesClient.java b/src/main/java/com/merge/api/ats/JobInterviewStagesClient.java new file mode 100644 index 000000000..e1629adf5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/JobInterviewStagesClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobInterviewStage; +import com.merge.api.ats.types.JobInterviewStagesListRequest; +import com.merge.api.ats.types.JobInterviewStagesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class JobInterviewStagesClient { + protected final ClientOptions clientOptions; + + private final RawJobInterviewStagesClient rawClient; + + public JobInterviewStagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawJobInterviewStagesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawJobInterviewStagesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public SyncPagingIterable list(JobInterviewStagesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public SyncPagingIterable list( + JobInterviewStagesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public JobInterviewStage retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public JobInterviewStage retrieve(String id, JobInterviewStagesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public JobInterviewStage retrieve( + String id, JobInterviewStagesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/JobPostingsClient.java b/src/main/java/com/merge/api/ats/JobPostingsClient.java new file mode 100644 index 000000000..625bbafe6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/JobPostingsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobPosting; +import com.merge.api.ats.types.JobPostingsListRequest; +import com.merge.api.ats.types.JobPostingsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class JobPostingsClient { + protected final ClientOptions clientOptions; + + private final RawJobPostingsClient rawClient; + + public JobPostingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawJobPostingsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawJobPostingsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of JobPosting objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of JobPosting objects. + */ + public SyncPagingIterable list(JobPostingsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of JobPosting objects. + */ + public SyncPagingIterable list(JobPostingsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a JobPosting object with the given id. + */ + public JobPosting retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a JobPosting object with the given id. + */ + public JobPosting retrieve(String id, JobPostingsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a JobPosting object with the given id. + */ + public JobPosting retrieve(String id, JobPostingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/JobsClient.java b/src/main/java/com/merge/api/ats/JobsClient.java new file mode 100644 index 000000000..4effdf8a2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/JobsClient.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Job; +import com.merge.api.ats.types.JobsListRequest; +import com.merge.api.ats.types.JobsRetrieveRequest; +import com.merge.api.ats.types.JobsScreeningQuestionsListRequest; +import com.merge.api.ats.types.ScreeningQuestion; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class JobsClient { + protected final ClientOptions clientOptions; + + private final RawJobsClient rawClient; + + public JobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawJobsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawJobsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Job objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Job objects. + */ + public SyncPagingIterable list(JobsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Job objects. + */ + public SyncPagingIterable list(JobsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Job object with the given id. + */ + public Job retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Job object with the given id. + */ + public Job retrieve(String id, JobsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Job object with the given id. + */ + public Job retrieve(String id, JobsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public SyncPagingIterable screeningQuestionsList(String jobId) { + return this.rawClient.screeningQuestionsList(jobId).body(); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public SyncPagingIterable screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request) { + return this.rawClient.screeningQuestionsList(jobId, request).body(); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public SyncPagingIterable screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request, RequestOptions requestOptions) { + return this.rawClient + .screeningQuestionsList(jobId, request, requestOptions) + .body(); + } +} diff --git a/src/main/java/com/merge/api/ats/LinkTokenClient.java b/src/main/java/com/merge/api/ats/LinkTokenClient.java new file mode 100644 index 000000000..640d5ef3f --- /dev/null +++ b/src/main/java/com/merge/api/ats/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.EndUserDetailsRequest; +import com.merge.api.ats.types.LinkToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/LinkedAccountsClient.java b/src/main/java/com/merge/api/ats/LinkedAccountsClient.java new file mode 100644 index 000000000..1e04137d0 --- /dev/null +++ b/src/main/java/com/merge/api/ats/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetailsAndActions; +import com.merge.api.ats.types.LinkedAccountsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/OffersClient.java b/src/main/java/com/merge/api/ats/OffersClient.java new file mode 100644 index 000000000..840a47fb8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/OffersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Offer; +import com.merge.api.ats.types.OffersListRequest; +import com.merge.api.ats.types.OffersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class OffersClient { + protected final ClientOptions clientOptions; + + private final RawOffersClient rawClient; + + public OffersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOffersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOffersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Offer objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Offer objects. + */ + public SyncPagingIterable list(OffersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Offer objects. + */ + public SyncPagingIterable list(OffersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Offer object with the given id. + */ + public Offer retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Offer object with the given id. + */ + public Offer retrieve(String id, OffersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Offer object with the given id. + */ + public Offer retrieve(String id, OffersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/OfficesClient.java b/src/main/java/com/merge/api/ats/OfficesClient.java new file mode 100644 index 000000000..644de68f4 --- /dev/null +++ b/src/main/java/com/merge/api/ats/OfficesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Office; +import com.merge.api.ats.types.OfficesListRequest; +import com.merge.api.ats.types.OfficesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class OfficesClient { + protected final ClientOptions clientOptions; + + private final RawOfficesClient rawClient; + + public OfficesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOfficesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOfficesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Office objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Office objects. + */ + public SyncPagingIterable list(OfficesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Office objects. + */ + public SyncPagingIterable list(OfficesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Office object with the given id. + */ + public Office retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Office object with the given id. + */ + public Office retrieve(String id, OfficesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Office object with the given id. + */ + public Office retrieve(String id, OfficesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/PassthroughClient.java b/src/main/java/com/merge/api/ats/PassthroughClient.java new file mode 100644 index 000000000..74a57ae9c --- /dev/null +++ b/src/main/java/com/merge/api/ats/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.DataPassthroughRequest; +import com.merge.api.ats.types.RemoteResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/RawAccountDetailsClient.java b/src/main/java/com/merge/api/ats/RawAccountDetailsClient.java new file mode 100644 index 000000000..1c38fbf27 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawAccountDetailsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetails; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawAccountTokenClient.java b/src/main/java/com/merge/api/ats/RawAccountTokenClient.java new file mode 100644 index 000000000..ee4d2e261 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawAccountTokenClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawActivitiesClient.java b/src/main/java/com/merge/api/ats/RawActivitiesClient.java new file mode 100644 index 000000000..8c2b695de --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawActivitiesClient.java @@ -0,0 +1,358 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.ActivitiesListRequest; +import com.merge.api.ats.types.ActivitiesRetrieveRequest; +import com.merge.api.ats.types.Activity; +import com.merge.api.ats.types.ActivityEndpointRequest; +import com.merge.api.ats.types.ActivityResponse; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedActivityList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawActivitiesClient { + protected final ClientOptions clientOptions; + + public RawActivitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Activity objects. + */ + public MergeApiHttpResponse> list() { + return list(ActivitiesListRequest.builder().build()); + } + + /** + * Returns a list of Activity objects. + */ + public MergeApiHttpResponse> list(ActivitiesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Activity objects. + */ + public MergeApiHttpResponse> list( + ActivitiesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getUserId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_id", request.getUserId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedActivityList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedActivityList.class); + Optional startingAfter = parsedResponse.getNext(); + ActivitiesListRequest nextRequest = ActivitiesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Activity object with the given values. + */ + public MergeApiHttpResponse create(ActivityEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Activity object with the given values. + */ + public MergeApiHttpResponse create( + ActivityEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ActivityResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Activity object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ActivitiesRetrieveRequest.builder().build()); + } + + /** + * Returns an Activity object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ActivitiesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Activity object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ActivitiesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Activity.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Activity POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Activity POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/activities/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawApplicationsClient.java b/src/main/java/com/merge/api/ats/RawApplicationsClient.java new file mode 100644 index 000000000..87db24a73 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawApplicationsClient.java @@ -0,0 +1,453 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Application; +import com.merge.api.ats.types.ApplicationEndpointRequest; +import com.merge.api.ats.types.ApplicationResponse; +import com.merge.api.ats.types.ApplicationsListRequest; +import com.merge.api.ats.types.ApplicationsMetaPostRetrieveRequest; +import com.merge.api.ats.types.ApplicationsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedApplicationList; +import com.merge.api.ats.types.UpdateApplicationStageRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawApplicationsClient { + protected final ClientOptions clientOptions; + + public RawApplicationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Application objects. + */ + public MergeApiHttpResponse> list() { + return list(ApplicationsListRequest.builder().build()); + } + + /** + * Returns a list of Application objects. + */ + public MergeApiHttpResponse> list(ApplicationsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Application objects. + */ + public MergeApiHttpResponse> list( + ApplicationsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications"); + if (request.getCandidateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "candidate_id", request.getCandidateId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCreditedToId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "credited_to_id", request.getCreditedToId().get(), false); + } + if (request.getCurrentStageId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "current_stage_id", request.getCurrentStageId().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_id", request.getJobId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRejectReasonId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "reject_reason_id", request.getRejectReasonId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getSource().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "source", request.getSource().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedApplicationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedApplicationList.class); + Optional startingAfter = parsedResponse.getNext(); + ApplicationsListRequest nextRequest = ApplicationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public MergeApiHttpResponse create(ApplicationEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Application object with the given values. + * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. + *

See our Help Center article for detailed support per integration.

+ */ + public MergeApiHttpResponse create( + ApplicationEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Application object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ApplicationsRetrieveRequest.builder().build()); + } + + /** + * Returns an Application object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ApplicationsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Application object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ApplicationsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Application.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates the current_stage field of an Application object + */ + public MergeApiHttpResponse changeStageCreate(String id) { + return changeStageCreate(id, UpdateApplicationStageRequest.builder().build()); + } + + /** + * Updates the current_stage field of an Application object + */ + public MergeApiHttpResponse changeStageCreate( + String id, UpdateApplicationStageRequest request) { + return changeStageCreate(id, request, null); + } + + /** + * Updates the current_stage field of an Application object + */ + public MergeApiHttpResponse changeStageCreate( + String id, UpdateApplicationStageRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications") + .addPathSegment(id) + .addPathSegments("change-stage"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + if (request.getJobInterviewStage().isPresent()) { + properties.put("job_interview_stage", request.getJobInterviewStage()); + } + if (request.getRemoteUserId().isPresent()) { + properties.put("remote_user_id", request.getRemoteUserId()); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Application POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(ApplicationsMetaPostRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Application POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(ApplicationsMetaPostRetrieveRequest request) { + return metaPostRetrieve(request, null); + } + + /** + * Returns metadata for Application POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve( + ApplicationsMetaPostRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/applications/meta/post"); + if (request.getApplicationRemoteTemplateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "application_remote_template_id", + request.getApplicationRemoteTemplateId().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..33c300674 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.AsyncPassthroughReciept; +import com.merge.api.ats.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.ats.types.DataPassthroughRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawAttachmentsClient.java b/src/main/java/com/merge/api/ats/RawAttachmentsClient.java new file mode 100644 index 000000000..e910fcb3a --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawAttachmentsClient.java @@ -0,0 +1,352 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Attachment; +import com.merge.api.ats.types.AttachmentEndpointRequest; +import com.merge.api.ats.types.AttachmentResponse; +import com.merge.api.ats.types.AttachmentsListRequest; +import com.merge.api.ats.types.AttachmentsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedAttachmentList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAttachmentsClient { + protected final ClientOptions clientOptions; + + public RawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list(AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments"); + if (request.getCandidateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "candidate_id", request.getCandidateId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Attachment object with the given values. + */ + public MergeApiHttpResponse create(AttachmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Attachment object with the given values. + */ + public MergeApiHttpResponse create( + AttachmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AttachmentResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Attachment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Attachment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/attachments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawAuditTrailClient.java b/src/main/java/com/merge/api/ats/RawAuditTrailClient.java new file mode 100644 index 000000000..5455c7db5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawAuditTrailClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AuditLogEvent; +import com.merge.api.ats.types.AuditTrailListRequest; +import com.merge.api.ats.types.PaginatedAuditLogEventList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawAvailableActionsClient.java b/src/main/java/com/merge/api/ats/RawAvailableActionsClient.java new file mode 100644 index 000000000..73a0bdc8b --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawAvailableActionsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AvailableActions; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawCandidatesClient.java b/src/main/java/com/merge/api/ats/RawCandidatesClient.java new file mode 100644 index 000000000..49ecdc3ba --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawCandidatesClient.java @@ -0,0 +1,507 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.Candidate; +import com.merge.api.ats.types.CandidateEndpointRequest; +import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesRetrieveRequest; +import com.merge.api.ats.types.IgnoreCommonModelRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedCandidateList; +import com.merge.api.ats.types.PatchedCandidateEndpointRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCandidatesClient { + protected final ClientOptions clientOptions; + + public RawCandidatesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Candidate objects. + */ + public MergeApiHttpResponse> list() { + return list(CandidatesListRequest.builder().build()); + } + + /** + * Returns a list of Candidate objects. + */ + public MergeApiHttpResponse> list(CandidatesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Candidate objects. + */ + public MergeApiHttpResponse> list( + CandidatesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddresses().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_addresses", request.getEmailAddresses().get(), false); + } + if (request.getFirstName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "first_name", request.getFirstName().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getLastName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "last_name", request.getLastName().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTags().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "tags", request.getTags().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCandidateList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCandidateList.class); + Optional startingAfter = parsedResponse.getNext(); + CandidatesListRequest nextRequest = CandidatesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Candidate object with the given values. + */ + public MergeApiHttpResponse create(CandidateEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Candidate object with the given values. + */ + public MergeApiHttpResponse create( + CandidateEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Candidate object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CandidatesRetrieveRequest.builder().build()); + } + + /** + * Returns a Candidate object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CandidatesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Candidate object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CandidatesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Candidate.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a Candidate object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedCandidateEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Candidate object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedCandidateEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Candidate POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Candidate POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/candidates/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawDeleteAccountClient.java b/src/main/java/com/merge/api/ats/RawDeleteAccountClient.java new file mode 100644 index 000000000..707eaa04c --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawDeleteAccountClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawDepartmentsClient.java b/src/main/java/com/merge/api/ats/RawDepartmentsClient.java new file mode 100644 index 000000000..4d1e21118 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawDepartmentsClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Department; +import com.merge.api.ats.types.DepartmentsListRequest; +import com.merge.api.ats.types.DepartmentsRetrieveRequest; +import com.merge.api.ats.types.PaginatedDepartmentList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDepartmentsClient { + protected final ClientOptions clientOptions; + + public RawDepartmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Department objects. + */ + public MergeApiHttpResponse> list() { + return list(DepartmentsListRequest.builder().build()); + } + + /** + * Returns a list of Department objects. + */ + public MergeApiHttpResponse> list(DepartmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Department objects. + */ + public MergeApiHttpResponse> list( + DepartmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/departments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedDepartmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDepartmentList.class); + Optional startingAfter = parsedResponse.getNext(); + DepartmentsListRequest nextRequest = DepartmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Department object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, DepartmentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Department object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, DepartmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Department object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, DepartmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/departments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Department.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawEeocsClient.java b/src/main/java/com/merge/api/ats/RawEeocsClient.java new file mode 100644 index 000000000..658c27ee1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawEeocsClient.java @@ -0,0 +1,246 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Eeoc; +import com.merge.api.ats.types.EeocsListRequest; +import com.merge.api.ats.types.EeocsRetrieveRequest; +import com.merge.api.ats.types.PaginatedEeocList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEeocsClient { + protected final ClientOptions clientOptions; + + public RawEeocsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EEOC objects. + */ + public MergeApiHttpResponse> list() { + return list(EeocsListRequest.builder().build()); + } + + /** + * Returns a list of EEOC objects. + */ + public MergeApiHttpResponse> list(EeocsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EEOC objects. + */ + public MergeApiHttpResponse> list( + EeocsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/eeocs"); + if (request.getCandidateId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "candidate_id", request.getCandidateId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEeocList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEeocList.class); + Optional startingAfter = parsedResponse.getNext(); + EeocsListRequest nextRequest = EeocsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an EEOC object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EeocsRetrieveRequest.builder().build()); + } + + /** + * Returns an EEOC object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EeocsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EEOC object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EeocsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/eeocs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Eeoc.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawFieldMappingClient.java b/src/main/java/com/merge/api/ats/RawFieldMappingClient.java new file mode 100644 index 000000000..5bb4ed390 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawFieldMappingClient.java @@ -0,0 +1,380 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.CreateFieldMappingRequest; +import com.merge.api.ats.types.ExternalTargetFieldApiResponse; +import com.merge.api.ats.types.FieldMappingApiInstanceResponse; +import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsRetrieveRequest; +import com.merge.api.ats.types.PatchedEditFieldMappingRequest; +import com.merge.api.ats.types.RemoteFieldApiResponse; +import com.merge.api.ats.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawForceResyncClient.java b/src/main/java/com/merge/api/ats/RawForceResyncClient.java new file mode 100644 index 000000000..48a4e0f56 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawForceResyncClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawGenerateKeyClient.java b/src/main/java/com/merge/api/ats/RawGenerateKeyClient.java new file mode 100644 index 000000000..2e814572b --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawGenerateKeyClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.GenerateRemoteKeyRequest; +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawInterviewsClient.java b/src/main/java/com/merge/api/ats/RawInterviewsClient.java new file mode 100644 index 000000000..1b31b9133 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawInterviewsClient.java @@ -0,0 +1,368 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.InterviewsListRequest; +import com.merge.api.ats.types.InterviewsRetrieveRequest; +import com.merge.api.ats.types.MetaResponse; +import com.merge.api.ats.types.PaginatedScheduledInterviewList; +import com.merge.api.ats.types.ScheduledInterview; +import com.merge.api.ats.types.ScheduledInterviewEndpointRequest; +import com.merge.api.ats.types.ScheduledInterviewResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawInterviewsClient { + protected final ClientOptions clientOptions; + + public RawInterviewsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public MergeApiHttpResponse> list() { + return list(InterviewsListRequest.builder().build()); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public MergeApiHttpResponse> list(InterviewsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of ScheduledInterview objects. + */ + public MergeApiHttpResponse> list( + InterviewsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews"); + if (request.getApplicationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "application_id", request.getApplicationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_id", request.getJobId().get(), false); + } + if (request.getJobInterviewStageId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "job_interview_stage_id", + request.getJobInterviewStageId().get(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrganizerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "organizer_id", request.getOrganizerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedScheduledInterviewList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedScheduledInterviewList.class); + Optional startingAfter = parsedResponse.getNext(); + InterviewsListRequest nextRequest = InterviewsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public MergeApiHttpResponse create(ScheduledInterviewEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a ScheduledInterview object with the given values. + */ + public MergeApiHttpResponse create( + ScheduledInterviewEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + properties.put("remote_user_id", request.getRemoteUserId()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ScheduledInterviewResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, InterviewsRetrieveRequest.builder().build()); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, InterviewsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a ScheduledInterview object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, InterviewsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ScheduledInterview.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for ScheduledInterview POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/interviews/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawIssuesClient.java b/src/main/java/com/merge/api/ats/RawIssuesClient.java new file mode 100644 index 000000000..599a9811a --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawIssuesClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Issue; +import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.ats.types.PaginatedIssueList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java b/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java new file mode 100644 index 000000000..4da8cc8a9 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobInterviewStage; +import com.merge.api.ats.types.JobInterviewStagesListRequest; +import com.merge.api.ats.types.JobInterviewStagesRetrieveRequest; +import com.merge.api.ats.types.PaginatedJobInterviewStageList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawJobInterviewStagesClient { + protected final ClientOptions clientOptions; + + public RawJobInterviewStagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public MergeApiHttpResponse> list() { + return list(JobInterviewStagesListRequest.builder().build()); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public MergeApiHttpResponse> list(JobInterviewStagesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of JobInterviewStage objects. + */ + public MergeApiHttpResponse> list( + JobInterviewStagesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-interview-stages"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_id", request.getJobId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedJobInterviewStageList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedJobInterviewStageList.class); + Optional startingAfter = parsedResponse.getNext(); + JobInterviewStagesListRequest nextRequest = JobInterviewStagesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, JobInterviewStagesRetrieveRequest.builder().build()); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, JobInterviewStagesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a JobInterviewStage object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, JobInterviewStagesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-interview-stages") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobInterviewStage.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawJobPostingsClient.java b/src/main/java/com/merge/api/ats/RawJobPostingsClient.java new file mode 100644 index 000000000..6af214cd4 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawJobPostingsClient.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.JobPosting; +import com.merge.api.ats.types.JobPostingsListRequest; +import com.merge.api.ats.types.JobPostingsRetrieveRequest; +import com.merge.api.ats.types.PaginatedJobPostingList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawJobPostingsClient { + protected final ClientOptions clientOptions; + + public RawJobPostingsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of JobPosting objects. + */ + public MergeApiHttpResponse> list() { + return list(JobPostingsListRequest.builder().build()); + } + + /** + * Returns a list of JobPosting objects. + */ + public MergeApiHttpResponse> list(JobPostingsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of JobPosting objects. + */ + public MergeApiHttpResponse> list( + JobPostingsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-postings"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedJobPostingList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJobPostingList.class); + Optional startingAfter = parsedResponse.getNext(); + JobPostingsListRequest nextRequest = JobPostingsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a JobPosting object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, JobPostingsRetrieveRequest.builder().build()); + } + + /** + * Returns a JobPosting object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, JobPostingsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a JobPosting object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, JobPostingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/job-postings") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobPosting.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawJobsClient.java b/src/main/java/com/merge/api/ats/RawJobsClient.java new file mode 100644 index 000000000..13f4632b2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawJobsClient.java @@ -0,0 +1,349 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Job; +import com.merge.api.ats.types.JobsListRequest; +import com.merge.api.ats.types.JobsRetrieveRequest; +import com.merge.api.ats.types.JobsScreeningQuestionsListRequest; +import com.merge.api.ats.types.PaginatedJobList; +import com.merge.api.ats.types.PaginatedScreeningQuestionList; +import com.merge.api.ats.types.ScreeningQuestion; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawJobsClient { + protected final ClientOptions clientOptions; + + public RawJobsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Job objects. + */ + public MergeApiHttpResponse> list() { + return list(JobsListRequest.builder().build()); + } + + /** + * Returns a list of Job objects. + */ + public MergeApiHttpResponse> list(JobsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Job objects. + */ + public MergeApiHttpResponse> list(JobsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/jobs"); + if (request.getCode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "code", request.getCode().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOffices().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offices", request.getOffices().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedJobList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJobList.class); + Optional startingAfter = parsedResponse.getNext(); + JobsListRequest nextRequest = JobsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Job object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, JobsRetrieveRequest.builder().build()); + } + + /** + * Returns a Job object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, JobsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Job object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, JobsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/jobs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Job.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public MergeApiHttpResponse> screeningQuestionsList(String jobId) { + return screeningQuestionsList( + jobId, JobsScreeningQuestionsListRequest.builder().build()); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public MergeApiHttpResponse> screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request) { + return screeningQuestionsList(jobId, request, null); + } + + /** + * Returns a list of ScreeningQuestion objects. + */ + public MergeApiHttpResponse> screeningQuestionsList( + String jobId, JobsScreeningQuestionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/jobs") + .addPathSegment(jobId) + .addPathSegments("screening-questions"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedScreeningQuestionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedScreeningQuestionList.class); + Optional startingAfter = parsedResponse.getNext(); + JobsScreeningQuestionsListRequest nextRequest = JobsScreeningQuestionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> screeningQuestionsList( + jobId, nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawLinkTokenClient.java b/src/main/java/com/merge/api/ats/RawLinkTokenClient.java new file mode 100644 index 000000000..3566c0e8c --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawLinkTokenClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.EndUserDetailsRequest; +import com.merge.api.ats.types.LinkToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java new file mode 100644 index 000000000..0d4a40dc5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.AccountDetailsAndActions; +import com.merge.api.ats.types.LinkedAccountsListRequest; +import com.merge.api.ats.types.PaginatedAccountDetailsAndActionsList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawOffersClient.java b/src/main/java/com/merge/api/ats/RawOffersClient.java new file mode 100644 index 000000000..18f425a0f --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawOffersClient.java @@ -0,0 +1,245 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Offer; +import com.merge.api.ats.types.OffersListRequest; +import com.merge.api.ats.types.OffersRetrieveRequest; +import com.merge.api.ats.types.PaginatedOfferList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOffersClient { + protected final ClientOptions clientOptions; + + public RawOffersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Offer objects. + */ + public MergeApiHttpResponse> list() { + return list(OffersListRequest.builder().build()); + } + + /** + * Returns a list of Offer objects. + */ + public MergeApiHttpResponse> list(OffersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Offer objects. + */ + public MergeApiHttpResponse> list( + OffersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offers"); + if (request.getApplicationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "application_id", request.getApplicationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCreatorId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "creator_id", request.getCreatorId().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedOfferList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfferList.class); + Optional startingAfter = parsedResponse.getNext(); + OffersListRequest nextRequest = OffersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Offer object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, OffersRetrieveRequest.builder().build()); + } + + /** + * Returns an Offer object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, OffersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Offer object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, OffersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offers") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Offer.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawOfficesClient.java b/src/main/java/com/merge/api/ats/RawOfficesClient.java new file mode 100644 index 000000000..6c9f7bc56 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawOfficesClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Office; +import com.merge.api.ats.types.OfficesListRequest; +import com.merge.api.ats.types.OfficesRetrieveRequest; +import com.merge.api.ats.types.PaginatedOfficeList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOfficesClient { + protected final ClientOptions clientOptions; + + public RawOfficesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Office objects. + */ + public MergeApiHttpResponse> list() { + return list(OfficesListRequest.builder().build()); + } + + /** + * Returns a list of Office objects. + */ + public MergeApiHttpResponse> list(OfficesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Office objects. + */ + public MergeApiHttpResponse> list( + OfficesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offices"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedOfficeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfficeList.class); + Optional startingAfter = parsedResponse.getNext(); + OfficesListRequest nextRequest = OfficesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Office object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, OfficesRetrieveRequest.builder().build()); + } + + /** + * Returns an Office object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, OfficesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Office object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, OfficesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/offices") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Office.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawPassthroughClient.java b/src/main/java/com/merge/api/ats/RawPassthroughClient.java new file mode 100644 index 000000000..177b115d2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawPassthroughClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.DataPassthroughRequest; +import com.merge.api.ats.types.RemoteResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/ats/RawRegenerateKeyClient.java new file mode 100644 index 000000000..996678ea6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawRegenerateKeyClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.ats.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java b/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java new file mode 100644 index 000000000..bcb412d5d --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedRejectReasonList; +import com.merge.api.ats.types.RejectReason; +import com.merge.api.ats.types.RejectReasonsListRequest; +import com.merge.api.ats.types.RejectReasonsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRejectReasonsClient { + protected final ClientOptions clientOptions; + + public RawRejectReasonsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of RejectReason objects. + */ + public MergeApiHttpResponse> list() { + return list(RejectReasonsListRequest.builder().build()); + } + + /** + * Returns a list of RejectReason objects. + */ + public MergeApiHttpResponse> list(RejectReasonsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of RejectReason objects. + */ + public MergeApiHttpResponse> list( + RejectReasonsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/reject-reasons"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRejectReasonList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRejectReasonList.class); + Optional startingAfter = parsedResponse.getNext(); + RejectReasonsListRequest nextRequest = RejectReasonsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a RejectReason object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, RejectReasonsRetrieveRequest.builder().build()); + } + + /** + * Returns a RejectReason object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, RejectReasonsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a RejectReason object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, RejectReasonsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/reject-reasons") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RejectReason.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawScopesClient.java b/src/main/java/com/merge/api/ats/RawScopesClient.java new file mode 100644 index 000000000..80a4840e2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawScopesClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.ats.types.CommonModelScopeApi; +import com.merge.api.ats.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawScorecardsClient.java b/src/main/java/com/merge/api/ats/RawScorecardsClient.java new file mode 100644 index 000000000..7f6ab47f0 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawScorecardsClient.java @@ -0,0 +1,249 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedScorecardList; +import com.merge.api.ats.types.Scorecard; +import com.merge.api.ats.types.ScorecardsListRequest; +import com.merge.api.ats.types.ScorecardsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScorecardsClient { + protected final ClientOptions clientOptions; + + public RawScorecardsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Scorecard objects. + */ + public MergeApiHttpResponse> list() { + return list(ScorecardsListRequest.builder().build()); + } + + /** + * Returns a list of Scorecard objects. + */ + public MergeApiHttpResponse> list(ScorecardsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Scorecard objects. + */ + public MergeApiHttpResponse> list( + ScorecardsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/scorecards"); + if (request.getApplicationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "application_id", request.getApplicationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getInterviewId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "interview_id", request.getInterviewId().get(), false); + } + if (request.getInterviewerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "interviewer_id", request.getInterviewerId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedScorecardList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedScorecardList.class); + Optional startingAfter = parsedResponse.getNext(); + ScorecardsListRequest nextRequest = ScorecardsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Scorecard object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ScorecardsRetrieveRequest.builder().build()); + } + + /** + * Returns a Scorecard object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ScorecardsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Scorecard object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ScorecardsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/scorecards") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Scorecard.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawSyncStatusClient.java b/src/main/java/com/merge/api/ats/RawSyncStatusClient.java new file mode 100644 index 000000000..bd38df800 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawSyncStatusClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedSyncStatusList; +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.ats.types.SyncStatusListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawTagsClient.java b/src/main/java/com/merge/api/ats/RawTagsClient.java new file mode 100644 index 000000000..72939dca3 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawTagsClient.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedTagList; +import com.merge.api.ats.types.Tag; +import com.merge.api.ats.types.TagsListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTagsClient { + protected final ClientOptions clientOptions; + + public RawTagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Tag objects. + */ + public MergeApiHttpResponse> list() { + return list(TagsListRequest.builder().build()); + } + + /** + * Returns a list of Tag objects. + */ + public MergeApiHttpResponse> list(TagsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Tag objects. + */ + public MergeApiHttpResponse> list(TagsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/tags"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTagList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + Optional startingAfter = parsedResponse.getNext(); + TagsListRequest nextRequest = TagsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawUsersClient.java b/src/main/java/com/merge/api/ats/RawUsersClient.java new file mode 100644 index 000000000..8a46761f8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawUsersClient.java @@ -0,0 +1,233 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.PaginatedRemoteUserList; +import com.merge.api.ats.types.RemoteUser; +import com.merge.api.ats.types.UsersListRequest; +import com.merge.api.ats.types.UsersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of RemoteUser objects. + */ + public MergeApiHttpResponse> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of RemoteUser objects. + */ + public MergeApiHttpResponse> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of RemoteUser objects. + */ + public MergeApiHttpResponse> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email", request.getEmail().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a RemoteUser object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteUser.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/ats/RawWebhookReceiversClient.java new file mode 100644 index 000000000..32d230149 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RawWebhookReceiversClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.ats.types.WebhookReceiver; +import com.merge.api.ats.types.WebhookReceiverRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ats/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ats/RegenerateKeyClient.java b/src/main/java/com/merge/api/ats/RegenerateKeyClient.java new file mode 100644 index 000000000..0028785f2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.RemoteKey; +import com.merge.api.ats.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/RejectReasonsClient.java b/src/main/java/com/merge/api/ats/RejectReasonsClient.java new file mode 100644 index 000000000..63432c984 --- /dev/null +++ b/src/main/java/com/merge/api/ats/RejectReasonsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.RejectReason; +import com.merge.api.ats.types.RejectReasonsListRequest; +import com.merge.api.ats.types.RejectReasonsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class RejectReasonsClient { + protected final ClientOptions clientOptions; + + private final RawRejectReasonsClient rawClient; + + public RejectReasonsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRejectReasonsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRejectReasonsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of RejectReason objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of RejectReason objects. + */ + public SyncPagingIterable list(RejectReasonsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of RejectReason objects. + */ + public SyncPagingIterable list(RejectReasonsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a RejectReason object with the given id. + */ + public RejectReason retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a RejectReason object with the given id. + */ + public RejectReason retrieve(String id, RejectReasonsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a RejectReason object with the given id. + */ + public RejectReason retrieve(String id, RejectReasonsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/ScopesClient.java b/src/main/java/com/merge/api/ats/ScopesClient.java new file mode 100644 index 000000000..a4e9d23b0 --- /dev/null +++ b/src/main/java/com/merge/api/ats/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.CommonModelScopeApi; +import com.merge.api.ats.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/ScorecardsClient.java b/src/main/java/com/merge/api/ats/ScorecardsClient.java new file mode 100644 index 000000000..2b9176043 --- /dev/null +++ b/src/main/java/com/merge/api/ats/ScorecardsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Scorecard; +import com.merge.api.ats.types.ScorecardsListRequest; +import com.merge.api.ats.types.ScorecardsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ScorecardsClient { + protected final ClientOptions clientOptions; + + private final RawScorecardsClient rawClient; + + public ScorecardsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScorecardsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScorecardsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Scorecard objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Scorecard objects. + */ + public SyncPagingIterable list(ScorecardsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Scorecard objects. + */ + public SyncPagingIterable list(ScorecardsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Scorecard object with the given id. + */ + public Scorecard retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Scorecard object with the given id. + */ + public Scorecard retrieve(String id, ScorecardsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Scorecard object with the given id. + */ + public Scorecard retrieve(String id, ScorecardsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/SyncStatusClient.java b/src/main/java/com/merge/api/ats/SyncStatusClient.java new file mode 100644 index 000000000..ac974dabc --- /dev/null +++ b/src/main/java/com/merge/api/ats/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.SyncStatus; +import com.merge.api.ats.types.SyncStatusListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/TagsClient.java b/src/main/java/com/merge/api/ats/TagsClient.java new file mode 100644 index 000000000..21eaa0cef --- /dev/null +++ b/src/main/java/com/merge/api/ats/TagsClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.Tag; +import com.merge.api.ats.types.TagsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class TagsClient { + protected final ClientOptions clientOptions; + + private final RawTagsClient rawClient; + + public TagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTagsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTagsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Tag objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Tag objects. + */ + public SyncPagingIterable list(TagsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Tag objects. + */ + public SyncPagingIterable list(TagsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/UsersClient.java b/src/main/java/com/merge/api/ats/UsersClient.java new file mode 100644 index 000000000..b8569d24b --- /dev/null +++ b/src/main/java/com/merge/api/ats/UsersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.RemoteUser; +import com.merge.api.ats.types.UsersListRequest; +import com.merge.api.ats.types.UsersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of RemoteUser objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of RemoteUser objects. + */ + public SyncPagingIterable list(UsersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of RemoteUser objects. + */ + public SyncPagingIterable list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public RemoteUser retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public RemoteUser retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a RemoteUser object with the given id. + */ + public RemoteUser retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ats/WebhookReceiversClient.java b/src/main/java/com/merge/api/ats/WebhookReceiversClient.java new file mode 100644 index 000000000..da2238fa6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats; + +import com.merge.api.ats.types.WebhookReceiver; +import com.merge.api.ats.types.WebhookReceiverRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/AccessRoleEnum.java b/src/main/java/com/merge/api/ats/types/AccessRoleEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/ats/types/AccessRoleEnum.java rename to src/main/java/com/merge/api/ats/types/AccessRoleEnum.java index 2f10c8818..368371d0e 100644 --- a/src/main/java/com/merge/api/resources/ats/types/AccessRoleEnum.java +++ b/src/main/java/com/merge/api/ats/types/AccessRoleEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/AccountDetails.java b/src/main/java/com/merge/api/ats/types/AccountDetails.java new file mode 100644 index 000000000..990971ea6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AccountDetails.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..4d2f7dba1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatusEnum status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatusEnum status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatusEnum getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(CategoryEnum category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatusEnum status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

The tenant or domain the customer has provided access to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..d56732249 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..a6dd1f03a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountDetailsAndActionsStatusEnum { + COMPLETE("COMPLETE"), + + INCOMPLETE("INCOMPLETE"), + + RELINK_NEEDED("RELINK_NEEDED"), + + IDLE("IDLE"); + + private final String value; + + AccountDetailsAndActionsStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/AccountIntegration.java b/src/main/java/com/merge/api/ats/types/AccountIntegration.java new file mode 100644 index 000000000..7a91982bf --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AccountIntegration.java @@ -0,0 +1,463 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

Company name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

Category or categories this integration is in beta status for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

Company logo in square shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

Company logo in rectangular shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AccountToken.java b/src/main/java/com/merge/api/ats/types/AccountToken.java new file mode 100644 index 000000000..fadc34230 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/activities/requests/ActivitiesListRequest.java b/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/activities/requests/ActivitiesListRequest.java rename to src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java index bfbd731b4..ab14ee463 100644 --- a/src/main/java/com/merge/api/resources/ats/activities/requests/ActivitiesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.activities.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,10 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.activities.types.ActivitiesListRequestRemoteFields; -import com.merge.api.resources.ats.activities.types.ActivitiesListRequestShowEnumOrigins; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -23,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ActivitiesListRequest.Builder.class) public final class ActivitiesListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -54,10 +54,10 @@ public final class ActivitiesListRequest { private final Map additionalProperties; private ActivitiesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -69,10 +69,10 @@ private ActivitiesListRequest( Optional showEnumOrigins, Optional userId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -86,6 +86,14 @@ private ActivitiesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -110,14 +118,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -210,10 +210,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(ActivitiesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -229,10 +229,10 @@ private boolean equalTo(ActivitiesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -256,14 +256,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -290,10 +290,10 @@ public static final class Builder { private Builder() {} public Builder from(ActivitiesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -307,6 +307,22 @@ public Builder from(ActivitiesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -340,17 +356,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -463,10 +468,10 @@ public Builder userId(String userId) { public ActivitiesListRequest build() { return new ActivitiesListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/ActivitiesListRequestRemoteFields.java similarity index 90% rename from src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesListRequestRemoteFields.java rename to src/main/java/com/merge/api/ats/types/ActivitiesListRequestRemoteFields.java index ed8cdcc1d..24653aa7f 100644 --- a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.activities.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/ActivitiesListRequestShowEnumOrigins.java similarity index 90% rename from src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/ats/types/ActivitiesListRequestShowEnumOrigins.java index 0cd3389b6..b9c1b4053 100644 --- a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.activities.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/activities/requests/ActivitiesRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequest.java similarity index 77% rename from src/main/java/com/merge/api/resources/ats/activities/requests/ActivitiesRetrieveRequest.java rename to src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequest.java index 673d7fba5..7110e2ee7 100644 --- a/src/main/java/com/merge/api/resources/ats/activities/requests/ActivitiesRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.activities.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.activities.types.ActivitiesRetrieveRequestRemoteFields; -import com.merge.api.resources.ats.activities.types.ActivitiesRetrieveRequestShowEnumOrigins; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,10 +22,12 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ActivitiesRetrieveRequest.Builder.class) public final class ActivitiesRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -33,13 +35,15 @@ public final class ActivitiesRetrieveRequest { private final Map additionalProperties; private ActivitiesRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -49,7 +53,7 @@ private ActivitiesRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -61,6 +65,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -91,13 +103,15 @@ public Map getAdditionalProperties() { private boolean equalTo(ActivitiesRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -111,10 +125,12 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -127,22 +143,28 @@ private Builder() {} public Builder from(ActivitiesRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(String expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -154,6 +176,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -178,7 +211,7 @@ public Builder showEnumOrigins(ActivitiesRetrieveRequestShowEnumOrigins showEnum public ActivitiesRetrieveRequest build() { return new ActivitiesRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestRemoteFields.java similarity index 90% rename from src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestRemoteFields.java index 0da927eb0..52be4900d 100644 --- a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.activities.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestShowEnumOrigins.java similarity index 90% rename from src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestShowEnumOrigins.java index 2bb502824..91c6cd6fd 100644 --- a/src/main/java/com/merge/api/resources/ats/activities/types/ActivitiesRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.activities.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/types/Activity.java b/src/main/java/com/merge/api/ats/types/Activity.java similarity index 94% rename from src/main/java/com/merge/api/resources/ats/types/Activity.java rename to src/main/java/com/merge/api/ats/types/Activity.java index 26a61cda5..6a2ac5ba7 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Activity.java +++ b/src/main/java/com/merge/api/ats/types/Activity.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,13 +35,13 @@ public final class Activity { private final Optional remoteCreatedAt; - private final Optional activityType; + private final Optional activityType; private final Optional subject; private final Optional body; - private final Optional visibility; + private final Optional visibility; private final Optional candidate; @@ -60,10 +60,10 @@ private Activity( Optional modifiedAt, Optional user, Optional remoteCreatedAt, - Optional activityType, + Optional activityType, Optional subject, Optional body, - Optional visibility, + Optional visibility, Optional candidate, Optional remoteWasDeleted, Optional> fieldMappings, @@ -140,7 +140,7 @@ public Optional getRemoteCreatedAt() { * */ @JsonProperty("activity_type") - public Optional getActivityType() { + public Optional getActivityType() { return activityType; } @@ -169,7 +169,7 @@ public Optional getBody() { * */ @JsonProperty("visibility") - public Optional getVisibility() { + public Optional getVisibility() { return visibility; } @@ -266,13 +266,13 @@ public static final class Builder { private Optional remoteCreatedAt = Optional.empty(); - private Optional activityType = Optional.empty(); + private Optional activityType = Optional.empty(); private Optional subject = Optional.empty(); private Optional body = Optional.empty(); - private Optional visibility = Optional.empty(); + private Optional visibility = Optional.empty(); private Optional candidate = Optional.empty(); @@ -372,12 +372,12 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { } @JsonSetter(value = "activity_type", nulls = Nulls.SKIP) - public Builder activityType(Optional activityType) { + public Builder activityType(Optional activityType) { this.activityType = activityType; return this; } - public Builder activityType(ActivityActivityType activityType) { + public Builder activityType(ActivityTypeEnum activityType) { this.activityType = Optional.ofNullable(activityType); return this; } @@ -405,12 +405,12 @@ public Builder body(String body) { } @JsonSetter(value = "visibility", nulls = Nulls.SKIP) - public Builder visibility(Optional visibility) { + public Builder visibility(Optional visibility) { this.visibility = visibility; return this; } - public Builder visibility(ActivityVisibility visibility) { + public Builder visibility(VisibilityEnum visibility) { this.visibility = Optional.ofNullable(visibility); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/activities/requests/ActivityEndpointRequest.java b/src/main/java/com/merge/api/ats/types/ActivityEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/activities/requests/ActivityEndpointRequest.java rename to src/main/java/com/merge/api/ats/types/ActivityEndpointRequest.java index 5d544aa22..42aa07e1a 100644 --- a/src/main/java/com/merge/api/resources/ats/activities/requests/ActivityEndpointRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivityEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.activities.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.ActivityRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityRequest.java b/src/main/java/com/merge/api/ats/types/ActivityRequest.java similarity index 90% rename from src/main/java/com/merge/api/resources/ats/types/ActivityRequest.java rename to src/main/java/com/merge/api/ats/types/ActivityRequest.java index 226a85e22..a3630642c 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivityRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -23,13 +23,13 @@ public final class ActivityRequest { private final Optional user; - private final Optional activityType; + private final Optional activityType; private final Optional subject; private final Optional body; - private final Optional visibility; + private final Optional visibility; private final Optional candidate; @@ -41,10 +41,10 @@ public final class ActivityRequest { private ActivityRequest( Optional user, - Optional activityType, + Optional activityType, Optional subject, Optional body, - Optional visibility, + Optional visibility, Optional candidate, Optional> integrationParams, Optional> linkedAccountParams, @@ -77,7 +77,7 @@ public Optional getUser() { * */ @JsonProperty("activity_type") - public Optional getActivityType() { + public Optional getActivityType() { return activityType; } @@ -106,7 +106,7 @@ public Optional getBody() { * */ @JsonProperty("visibility") - public Optional getVisibility() { + public Optional getVisibility() { return visibility; } @@ -173,13 +173,13 @@ public static Builder builder() { public static final class Builder { private Optional user = Optional.empty(); - private Optional activityType = Optional.empty(); + private Optional activityType = Optional.empty(); private Optional subject = Optional.empty(); private Optional body = Optional.empty(); - private Optional visibility = Optional.empty(); + private Optional visibility = Optional.empty(); private Optional candidate = Optional.empty(); @@ -216,12 +216,12 @@ public Builder user(ActivityRequestUser user) { } @JsonSetter(value = "activity_type", nulls = Nulls.SKIP) - public Builder activityType(Optional activityType) { + public Builder activityType(Optional activityType) { this.activityType = activityType; return this; } - public Builder activityType(ActivityRequestActivityType activityType) { + public Builder activityType(ActivityTypeEnum activityType) { this.activityType = Optional.ofNullable(activityType); return this; } @@ -249,12 +249,12 @@ public Builder body(String body) { } @JsonSetter(value = "visibility", nulls = Nulls.SKIP) - public Builder visibility(Optional visibility) { + public Builder visibility(Optional visibility) { this.visibility = visibility; return this; } - public Builder visibility(ActivityRequestVisibility visibility) { + public Builder visibility(VisibilityEnum visibility) { this.visibility = Optional.ofNullable(visibility); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityRequestUser.java b/src/main/java/com/merge/api/ats/types/ActivityRequestUser.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ActivityRequestUser.java rename to src/main/java/com/merge/api/ats/types/ActivityRequestUser.java index ae6c5620b..1fb1ebdc4 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityRequestUser.java +++ b/src/main/java/com/merge/api/ats/types/ActivityRequestUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ActivityRequestUser deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ActivityRequestUser deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityResponse.java b/src/main/java/com/merge/api/ats/types/ActivityResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/ActivityResponse.java rename to src/main/java/com/merge/api/ats/types/ActivityResponse.java index bf2070b5b..85b5789d3 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityResponse.java +++ b/src/main/java/com/merge/api/ats/types/ActivityResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/ActivityTypeEnum.java b/src/main/java/com/merge/api/ats/types/ActivityTypeEnum.java new file mode 100644 index 000000000..5e1a26c65 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ActivityTypeEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ActivityTypeEnum { + NOTE("NOTE"), + + EMAIL("EMAIL"), + + OTHER("OTHER"); + + private final String value; + + ActivityTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityUser.java b/src/main/java/com/merge/api/ats/types/ActivityUser.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/ActivityUser.java rename to src/main/java/com/merge/api/ats/types/ActivityUser.java index 17d65a734..5108a4aa4 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityUser.java +++ b/src/main/java/com/merge/api/ats/types/ActivityUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ActivityUser deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ActivityUser deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/ats/types/AdvancedMetadata.java b/src/main/java/com/merge/api/ats/types/AdvancedMetadata.java new file mode 100644 index 000000000..8865ceeb6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/Application.java b/src/main/java/com/merge/api/ats/types/Application.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/Application.java rename to src/main/java/com/merge/api/ats/types/Application.java index 8fa42dddc..2f359e576 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Application.java +++ b/src/main/java/com/merge/api/ats/types/Application.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationCandidate.java b/src/main/java/com/merge/api/ats/types/ApplicationCandidate.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationCandidate.java rename to src/main/java/com/merge/api/ats/types/ApplicationCandidate.java index 38a3991a8..1f53da3aa 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationCandidate.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationCandidate.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ApplicationCandidate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ApplicationCandidate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationCreditedTo.java b/src/main/java/com/merge/api/ats/types/ApplicationCreditedTo.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationCreditedTo.java rename to src/main/java/com/merge/api/ats/types/ApplicationCreditedTo.java index 0124aa5b3..2cbde7486 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationCreditedTo.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationCreditedTo.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ApplicationCreditedTo deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ApplicationCreditedTo deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationCurrentStage.java b/src/main/java/com/merge/api/ats/types/ApplicationCurrentStage.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationCurrentStage.java rename to src/main/java/com/merge/api/ats/types/ApplicationCurrentStage.java index ab586d70a..d251ede4a 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationCurrentStage.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationCurrentStage.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public ApplicationCurrentStage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ApplicationCurrentStage deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationEndpointRequest.java b/src/main/java/com/merge/api/ats/types/ApplicationEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationEndpointRequest.java rename to src/main/java/com/merge/api/ats/types/ApplicationEndpointRequest.java index a1c3863c3..00af91b1a 100644 --- a/src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationEndpointRequest.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.applications.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.ApplicationRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationJob.java b/src/main/java/com/merge/api/ats/types/ApplicationJob.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationJob.java rename to src/main/java/com/merge/api/ats/types/ApplicationJob.java index 8f224cd4d..043de68c8 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationJob.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationJob.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ApplicationJob deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ApplicationJob deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationOffersItem.java b/src/main/java/com/merge/api/ats/types/ApplicationOffersItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationOffersItem.java rename to src/main/java/com/merge/api/ats/types/ApplicationOffersItem.java index 9d90f742a..4ffaee10f 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationOffersItem.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationOffersItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ApplicationOffersItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ApplicationOffersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationRejectReason.java b/src/main/java/com/merge/api/ats/types/ApplicationRejectReason.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationRejectReason.java rename to src/main/java/com/merge/api/ats/types/ApplicationRejectReason.java index b8190ecd2..b3935ff3f 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationRejectReason.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationRejectReason.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public ApplicationRejectReason deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ApplicationRejectReason deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationRequest.java b/src/main/java/com/merge/api/ats/types/ApplicationRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationRequest.java rename to src/main/java/com/merge/api/ats/types/ApplicationRequest.java index fc6755949..86b323dae 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationRequest.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationRequestCandidate.java b/src/main/java/com/merge/api/ats/types/ApplicationRequestCandidate.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationRequestCandidate.java rename to src/main/java/com/merge/api/ats/types/ApplicationRequestCandidate.java index ccdf4ffbf..57495d584 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationRequestCandidate.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationRequestCandidate.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ApplicationRequestJob deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ApplicationRequestJob deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ApplicationRequestOffersItem.java b/src/main/java/com/merge/api/ats/types/ApplicationRequestOffersItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ApplicationRequestOffersItem.java rename to src/main/java/com/merge/api/ats/types/ApplicationRequestOffersItem.java index ba4e832bb..043e098df 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ApplicationRequestOffersItem.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationRequestOffersItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional candidateId; private final Optional createdAfter; @@ -34,8 +37,6 @@ public final class ApplicationsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,13 +60,13 @@ public final class ApplicationsListRequest { private final Map additionalProperties; private ApplicationsListRequest( + Optional> expand, Optional candidateId, Optional createdAfter, Optional createdBefore, Optional creditedToId, Optional currentStageId, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -77,13 +78,13 @@ private ApplicationsListRequest( Optional remoteId, Optional source, Map additionalProperties) { + this.expand = expand; this.candidateId = candidateId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.creditedToId = creditedToId; this.currentStageId = currentStageId; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -97,6 +98,14 @@ private ApplicationsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return applications for this candidate. */ @@ -145,14 +154,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -245,13 +246,13 @@ public Map getAdditionalProperties() { } private boolean equalTo(ApplicationsListRequest other) { - return candidateId.equals(other.candidateId) + return expand.equals(other.expand) + && candidateId.equals(other.candidateId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && creditedToId.equals(other.creditedToId) && currentStageId.equals(other.currentStageId) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -267,13 +268,13 @@ private boolean equalTo(ApplicationsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.candidateId, this.createdAfter, this.createdBefore, this.creditedToId, this.currentStageId, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -297,6 +298,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional candidateId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -309,8 +312,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -337,13 +338,13 @@ public static final class Builder { private Builder() {} public Builder from(ApplicationsListRequest other) { + expand(other.getExpand()); candidateId(other.getCandidateId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); creditedToId(other.getCreditedToId()); currentStageId(other.getCurrentStageId()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -357,6 +358,22 @@ public Builder from(ApplicationsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ApplicationsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "candidate_id", nulls = Nulls.SKIP) public Builder candidateId(Optional candidateId) { this.candidateId = candidateId; @@ -423,17 +440,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ApplicationsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -546,13 +552,13 @@ public Builder source(String source) { public ApplicationsListRequest build() { return new ApplicationsListRequest( + expand, candidateId, createdAfter, createdBefore, creditedToId, currentStageId, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ats/types/ApplicationsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/ApplicationsListRequestExpandItem.java new file mode 100644 index 000000000..9a6d91784 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ApplicationsListRequestExpandItem.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ApplicationsListRequestExpandItem { + CANDIDATE("candidate"), + + CREDITED_TO("credited_to"), + + CURRENT_STAGE("current_stage"), + + JOB("job"), + + OFFERS("offers"), + + REJECT_REASON("reject_reason"), + + SCREENING_QUESTION_ANSWERS("screening_question_answers"), + + SCREENING_QUESTION_ANSWERS_QUESTION("screening_question_answers.question"); + + private final String value; + + ApplicationsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationsMetaPostRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/ApplicationsMetaPostRetrieveRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationsMetaPostRetrieveRequest.java rename to src/main/java/com/merge/api/ats/types/ApplicationsMetaPostRetrieveRequest.java index 7bb373c3d..c26caa43f 100644 --- a/src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationsMetaPostRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationsMetaPostRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.applications.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/ApplicationsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/ApplicationsRetrieveRequest.java new file mode 100644 index 000000000..25dfc0945 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ApplicationsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ApplicationsRetrieveRequest.Builder.class) +public final class ApplicationsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ApplicationsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplicationsRetrieveRequest && equalTo((ApplicationsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplicationsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ApplicationsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ApplicationsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ApplicationsRetrieveRequest build() { + return new ApplicationsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/ApplicationsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/ApplicationsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..2326f471c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ApplicationsRetrieveRequestExpandItem.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ApplicationsRetrieveRequestExpandItem { + CANDIDATE("candidate"), + + CREDITED_TO("credited_to"), + + CURRENT_STAGE("current_stage"), + + JOB("job"), + + OFFERS("offers"), + + REJECT_REASON("reject_reason"), + + SCREENING_QUESTION_ANSWERS("screening_question_answers"), + + SCREENING_QUESTION_ANSWERS_QUESTION("screening_question_answers.question"); + + private final String value; + + ApplicationsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/ats/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..d58fb086f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/ats/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..e45b749c4 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/Attachment.java b/src/main/java/com/merge/api/ats/types/Attachment.java new file mode 100644 index 000000000..6578926ce --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/Attachment.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Attachment.Builder.class) +public final class Attachment { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional fileName; + + private final Optional fileUrl; + + private final Optional candidate; + + private final Optional attachmentType; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Attachment( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional fileName, + Optional fileUrl, + Optional candidate, + Optional attachmentType, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.fileName = fileName; + this.fileUrl = fileUrl; + this.candidate = candidate; + this.attachmentType = attachmentType; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The attachment's name. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The attachment's url. + */ + @JsonProperty("file_url") + public Optional getFileUrl() { + return fileUrl; + } + + /** + * @return + */ + @JsonProperty("candidate") + public Optional getCandidate() { + return candidate; + } + + /** + * @return The attachment's type. + *
    + *
  • RESUME - RESUME
  • + *
  • COVER_LETTER - COVER_LETTER
  • + *
  • OFFER_LETTER - OFFER_LETTER
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("attachment_type") + public Optional getAttachmentType() { + return attachmentType; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Attachment && equalTo((Attachment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Attachment other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && fileName.equals(other.fileName) + && fileUrl.equals(other.fileUrl) + && candidate.equals(other.candidate) + && attachmentType.equals(other.attachmentType) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.fileName, + this.fileUrl, + this.candidate, + this.attachmentType, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional fileUrl = Optional.empty(); + + private Optional candidate = Optional.empty(); + + private Optional attachmentType = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Attachment other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + fileName(other.getFileName()); + fileUrl(other.getFileUrl()); + candidate(other.getCandidate()); + attachmentType(other.getAttachmentType()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public Builder fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + public Builder fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @JsonSetter(value = "file_url", nulls = Nulls.SKIP) + public Builder fileUrl(Optional fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + public Builder fileUrl(String fileUrl) { + this.fileUrl = Optional.ofNullable(fileUrl); + return this; + } + + @JsonSetter(value = "candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(String candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "attachment_type", nulls = Nulls.SKIP) + public Builder attachmentType(Optional attachmentType) { + this.attachmentType = attachmentType; + return this; + } + + public Builder attachmentType(AttachmentTypeEnum attachmentType) { + this.attachmentType = Optional.ofNullable(attachmentType); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Attachment build() { + return new Attachment( + id, + remoteId, + createdAt, + modifiedAt, + fileName, + fileUrl, + candidate, + attachmentType, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentEndpointRequest.java b/src/main/java/com/merge/api/ats/types/AttachmentEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentEndpointRequest.java rename to src/main/java/com/merge/api/ats/types/AttachmentEndpointRequest.java index 142098d92..6747c25b7 100644 --- a/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentEndpointRequest.java +++ b/src/main/java/com/merge/api/ats/types/AttachmentEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.attachments.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.AttachmentRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/ats/types/AttachmentRequest.java b/src/main/java/com/merge/api/ats/types/AttachmentRequest.java new file mode 100644 index 000000000..ca14d669e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentRequest.java @@ -0,0 +1,249 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentRequest.Builder.class) +public final class AttachmentRequest { + private final Optional fileName; + + private final Optional fileUrl; + + private final Optional candidate; + + private final Optional attachmentType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private AttachmentRequest( + Optional fileName, + Optional fileUrl, + Optional candidate, + Optional attachmentType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.fileName = fileName; + this.fileUrl = fileUrl; + this.candidate = candidate; + this.attachmentType = attachmentType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The attachment's name. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The attachment's url. + */ + @JsonProperty("file_url") + public Optional getFileUrl() { + return fileUrl; + } + + /** + * @return + */ + @JsonProperty("candidate") + public Optional getCandidate() { + return candidate; + } + + /** + * @return The attachment's type. + *
    + *
  • RESUME - RESUME
  • + *
  • COVER_LETTER - COVER_LETTER
  • + *
  • OFFER_LETTER - OFFER_LETTER
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("attachment_type") + public Optional getAttachmentType() { + return attachmentType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentRequest && equalTo((AttachmentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentRequest other) { + return fileName.equals(other.fileName) + && fileUrl.equals(other.fileUrl) + && candidate.equals(other.candidate) + && attachmentType.equals(other.attachmentType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.fileName, + this.fileUrl, + this.candidate, + this.attachmentType, + this.integrationParams, + this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional fileName = Optional.empty(); + + private Optional fileUrl = Optional.empty(); + + private Optional candidate = Optional.empty(); + + private Optional attachmentType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentRequest other) { + fileName(other.getFileName()); + fileUrl(other.getFileUrl()); + candidate(other.getCandidate()); + attachmentType(other.getAttachmentType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public Builder fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + public Builder fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @JsonSetter(value = "file_url", nulls = Nulls.SKIP) + public Builder fileUrl(Optional fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + public Builder fileUrl(String fileUrl) { + this.fileUrl = Optional.ofNullable(fileUrl); + return this; + } + + @JsonSetter(value = "candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(String candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "attachment_type", nulls = Nulls.SKIP) + public Builder attachmentType(Optional attachmentType) { + this.attachmentType = attachmentType; + return this; + } + + public Builder attachmentType(AttachmentTypeEnum attachmentType) { + this.attachmentType = Optional.ofNullable(attachmentType); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public AttachmentRequest build() { + return new AttachmentRequest( + fileName, + fileUrl, + candidate, + attachmentType, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/AttachmentResponse.java b/src/main/java/com/merge/api/ats/types/AttachmentResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/AttachmentResponse.java rename to src/main/java/com/merge/api/ats/types/AttachmentResponse.java index 26e82de90..dd7342a89 100644 --- a/src/main/java/com/merge/api/resources/ats/types/AttachmentResponse.java +++ b/src/main/java/com/merge/api/ats/types/AttachmentResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/AttachmentTypeEnum.java b/src/main/java/com/merge/api/ats/types/AttachmentTypeEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/types/AttachmentTypeEnum.java rename to src/main/java/com/merge/api/ats/types/AttachmentTypeEnum.java index 8766255b7..345928f36 100644 --- a/src/main/java/com/merge/api/resources/ats/types/AttachmentTypeEnum.java +++ b/src/main/java/com/merge/api/ats/types/AttachmentTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsListRequest.java b/src/main/java/com/merge/api/ats/types/AttachmentsListRequest.java new file mode 100644 index 000000000..295b24dbb --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsListRequest.java @@ -0,0 +1,488 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsListRequest.Builder.class) +public final class AttachmentsListRequest { + private final Optional> expand; + + private final Optional candidateId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private AttachmentsListRequest( + Optional> expand, + Optional candidateId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.candidateId = candidateId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return attachments for this candidate. + */ + @JsonProperty("candidate_id") + public Optional getCandidateId() { + return candidateId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsListRequest && equalTo((AttachmentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsListRequest other) { + return expand.equals(other.expand) + && candidateId.equals(other.candidateId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.candidateId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional candidateId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsListRequest other) { + expand(other.getExpand()); + candidateId(other.getCandidateId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "candidate_id", nulls = Nulls.SKIP) + public Builder candidateId(Optional candidateId) { + this.candidateId = candidateId; + return this; + } + + public Builder candidateId(String candidateId) { + this.candidateId = Optional.ofNullable(candidateId); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public AttachmentsListRequest build() { + return new AttachmentsListRequest( + expand, + candidateId, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequest.java new file mode 100644 index 000000000..dbcc26c31 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) +public final class AttachmentsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private AttachmentsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsRetrieveRequest && equalTo((AttachmentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public AttachmentsRetrieveRequest build() { + return new AttachmentsRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AuditLogEvent.java b/src/main/java/com/merge/api/ats/types/AuditLogEvent.java new file mode 100644 index 000000000..771884f81 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AuditLogEvent.java @@ -0,0 +1,449 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final RoleEnum role; + + private final String ipAddress; + + private final EventTypeEnum eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + RoleEnum role, + String ipAddress, + EventTypeEnum eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ */ + @JsonProperty("role") + public RoleEnum getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ */ + @JsonProperty("event_type") + public EventTypeEnum getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + IpAddressStage role(@NotNull RoleEnum role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + EventDescriptionStage eventType(@NotNull EventTypeEnum eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private RoleEnum role; + + private String ipAddress; + + private EventTypeEnum eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

+ *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull RoleEnum role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

Designates the type of event that occurred.

+ *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull EventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The User's email at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

The User's full name at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/ats/types/AuditTrailListRequest.java new file mode 100644 index 000000000..2a4e2c481 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AuditTrailListRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/AvailableActions.java b/src/main/java/com/merge/api/ats/types/AvailableActions.java new file mode 100644 index 000000000..c84d7bec8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/Candidate.java b/src/main/java/com/merge/api/ats/types/Candidate.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/Candidate.java rename to src/main/java/com/merge/api/ats/types/Candidate.java index f6766c464..05e01b2e3 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Candidate.java +++ b/src/main/java/com/merge/api/ats/types/Candidate.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/CandidateApplicationsItem.java b/src/main/java/com/merge/api/ats/types/CandidateApplicationsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/CandidateApplicationsItem.java rename to src/main/java/com/merge/api/ats/types/CandidateApplicationsItem.java index 23fc86b86..d114f7baa 100644 --- a/src/main/java/com/merge/api/resources/ats/types/CandidateApplicationsItem.java +++ b/src/main/java/com/merge/api/ats/types/CandidateApplicationsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -30,8 +33,6 @@ public final class CandidatesListRequest { private final Optional emailAddresses; - private final Optional expand; - private final Optional firstName; private final Optional includeDeletedData; @@ -55,11 +56,11 @@ public final class CandidatesListRequest { private final Map additionalProperties; private CandidatesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional emailAddresses, - Optional expand, Optional firstName, Optional includeDeletedData, Optional includeRemoteData, @@ -71,11 +72,11 @@ private CandidatesListRequest( Optional remoteId, Optional tags, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.emailAddresses = emailAddresses; - this.expand = expand; this.firstName = firstName; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; @@ -89,6 +90,14 @@ private CandidatesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -121,14 +130,6 @@ public Optional getEmailAddresses() { return emailAddresses; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return If provided, will only return candidates with this first name. */ @@ -221,11 +222,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(CandidatesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && emailAddresses.equals(other.emailAddresses) - && expand.equals(other.expand) && firstName.equals(other.firstName) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) @@ -241,11 +242,11 @@ private boolean equalTo(CandidatesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.emailAddresses, - this.expand, this.firstName, this.includeDeletedData, this.includeRemoteData, @@ -269,6 +270,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -277,8 +280,6 @@ public static final class Builder { private Optional emailAddresses = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional firstName = Optional.empty(); private Optional includeDeletedData = Optional.empty(); @@ -305,11 +306,11 @@ public static final class Builder { private Builder() {} public Builder from(CandidatesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); emailAddresses(other.getEmailAddresses()); - expand(other.getExpand()); firstName(other.getFirstName()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); @@ -323,6 +324,22 @@ public Builder from(CandidatesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CandidatesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -367,17 +384,6 @@ public Builder emailAddresses(String emailAddresses) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CandidatesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "first_name", nulls = Nulls.SKIP) public Builder firstName(Optional firstName) { this.firstName = firstName; @@ -490,11 +496,11 @@ public Builder tags(String tags) { public CandidatesListRequest build() { return new CandidatesListRequest( + expand, createdAfter, createdBefore, cursor, emailAddresses, - expand, firstName, includeDeletedData, includeRemoteData, diff --git a/src/main/java/com/merge/api/ats/types/CandidatesListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/CandidatesListRequestExpandItem.java new file mode 100644 index 000000000..ccc97b82f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CandidatesListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CandidatesListRequestExpandItem { + APPLICATIONS("applications"), + + ATTACHMENTS("attachments"); + + private final String value; + + CandidatesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/CandidatesRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/CandidatesRetrieveRequest.java new file mode 100644 index 000000000..acc3cec56 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CandidatesRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CandidatesRetrieveRequest.Builder.class) +public final class CandidatesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private CandidatesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidatesRetrieveRequest && equalTo((CandidatesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CandidatesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CandidatesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CandidatesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public CandidatesRetrieveRequest build() { + return new CandidatesRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/CandidatesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/CandidatesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..965a6e957 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CandidatesRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CandidatesRetrieveRequestExpandItem { + APPLICATIONS("applications"), + + ATTACHMENTS("attachments"); + + private final String value; + + CandidatesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/CategoriesEnum.java b/src/main/java/com/merge/api/ats/types/CategoriesEnum.java new file mode 100644 index 000000000..058d8c67d --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoriesEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoriesEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/CategoryEnum.java b/src/main/java/com/merge/api/ats/types/CategoryEnum.java new file mode 100644 index 000000000..ed3b243e2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoryEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/ats/types/CommonModelScopeApi.java new file mode 100644 index 000000000..8b7726971 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CommonModelScopeApi.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/ats/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..cbe41cf4b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/ats/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..94c5035fa --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CreateFieldMappingRequest.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final String targetFieldName; + + private final String targetFieldDescription; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + String targetFieldName, + String targetFieldDescription, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return The name of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_name") + public String getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_description") + public String getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TargetFieldNameStage builder() { + return new Builder(); + } + + public interface TargetFieldNameStage { + TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); + + Builder from(CreateFieldMappingRequest other); + } + + public interface TargetFieldDescriptionStage { + RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); + } + + public interface RemoteMethodStage { + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + } + + public interface RemoteUrlPathStage { + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TargetFieldNameStage, + TargetFieldDescriptionStage, + RemoteMethodStage, + RemoteUrlPathStage, + CommonModelNameStage, + _FinalStage { + private String targetFieldName; + + private String targetFieldDescription; + + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + return this; + } + + /** + *

The name of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_name") + public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

The description of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_description") + public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

The method of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

The path of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

The name of the Common Model that the remote field corresponds to in a given category.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/ats/types/DataPassthroughRequest.java new file mode 100644 index 000000000..6abf232fe --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/DataPassthroughRequest.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final MethodEnum method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + MethodEnum method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public MethodEnum getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull MethodEnum method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + _FinalStage data(Optional data); + + _FinalStage data(String data); + + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(RequestFormatEnum requestFormat); + + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private MethodEnum method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull MethodEnum method) { + this.method = method; + return this; + } + + /** + *

The path of the request in the third party's platform.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

The data with the request. You must include a request_format parameter matching the data's format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

An optional override of the third party's base url for the request.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/DebugModeLog.java b/src/main/java/com/merge/api/ats/types/DebugModeLog.java new file mode 100644 index 000000000..23194859a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/ats/types/DebugModelLogSummary.java new file mode 100644 index 000000000..0365ae079 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/Department.java b/src/main/java/com/merge/api/ats/types/Department.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/Department.java rename to src/main/java/com/merge/api/ats/types/Department.java index 42ddc5324..e89016c33 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Department.java +++ b/src/main/java/com/merge/api/ats/types/Department.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/departments/requests/DepartmentsListRequest.java b/src/main/java/com/merge/api/ats/types/DepartmentsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/departments/requests/DepartmentsListRequest.java rename to src/main/java/com/merge/api/ats/types/DepartmentsListRequest.java index aafa0e6b3..01a217fd3 100644 --- a/src/main/java/com/merge/api/resources/ats/departments/requests/DepartmentsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/DepartmentsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.departments.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/DepartmentsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/DepartmentsRetrieveRequest.java new file mode 100644 index 000000000..29510dcca --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/DepartmentsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DepartmentsRetrieveRequest.Builder.class) +public final class DepartmentsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private DepartmentsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DepartmentsRetrieveRequest && equalTo((DepartmentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DepartmentsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DepartmentsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public DepartmentsRetrieveRequest build() { + return new DepartmentsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/DisabilityStatusEnum.java b/src/main/java/com/merge/api/ats/types/DisabilityStatusEnum.java similarity index 93% rename from src/main/java/com/merge/api/resources/ats/types/DisabilityStatusEnum.java rename to src/main/java/com/merge/api/ats/types/DisabilityStatusEnum.java index ae066da37..eaf2ecd3d 100644 --- a/src/main/java/com/merge/api/resources/ats/types/DisabilityStatusEnum.java +++ b/src/main/java/com/merge/api/ats/types/DisabilityStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/types/Eeoc.java b/src/main/java/com/merge/api/ats/types/Eeoc.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/types/Eeoc.java rename to src/main/java/com/merge/api/ats/types/Eeoc.java index a6f1df3ee..2c9df6097 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Eeoc.java +++ b/src/main/java/com/merge/api/ats/types/Eeoc.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,13 +35,13 @@ public final class Eeoc { private final Optional submittedAt; - private final Optional race; + private final Optional race; - private final Optional gender; + private final Optional gender; - private final Optional veteranStatus; + private final Optional veteranStatus; - private final Optional disabilityStatus; + private final Optional disabilityStatus; private final Optional remoteWasDeleted; @@ -58,10 +58,10 @@ private Eeoc( Optional modifiedAt, Optional candidate, Optional submittedAt, - Optional race, - Optional gender, - Optional veteranStatus, - Optional disabilityStatus, + Optional race, + Optional gender, + Optional veteranStatus, + Optional disabilityStatus, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -141,7 +141,7 @@ public Optional getSubmittedAt() { * */ @JsonProperty("race") - public Optional getRace() { + public Optional getRace() { return race; } @@ -156,7 +156,7 @@ public Optional getRace() { * */ @JsonProperty("gender") - public Optional getGender() { + public Optional getGender() { return gender; } @@ -169,7 +169,7 @@ public Optional getGender() { * */ @JsonProperty("veteran_status") - public Optional getVeteranStatus() { + public Optional getVeteranStatus() { return veteranStatus; } @@ -182,7 +182,7 @@ public Optional getVeteranStatus() { * */ @JsonProperty("disability_status") - public Optional getDisabilityStatus() { + public Optional getDisabilityStatus() { return disabilityStatus; } @@ -272,13 +272,13 @@ public static final class Builder { private Optional submittedAt = Optional.empty(); - private Optional race = Optional.empty(); + private Optional race = Optional.empty(); - private Optional gender = Optional.empty(); + private Optional gender = Optional.empty(); - private Optional veteranStatus = Optional.empty(); + private Optional veteranStatus = Optional.empty(); - private Optional disabilityStatus = Optional.empty(); + private Optional disabilityStatus = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -375,45 +375,45 @@ public Builder submittedAt(OffsetDateTime submittedAt) { } @JsonSetter(value = "race", nulls = Nulls.SKIP) - public Builder race(Optional race) { + public Builder race(Optional race) { this.race = race; return this; } - public Builder race(EeocRace race) { + public Builder race(RaceEnum race) { this.race = Optional.ofNullable(race); return this; } @JsonSetter(value = "gender", nulls = Nulls.SKIP) - public Builder gender(Optional gender) { + public Builder gender(Optional gender) { this.gender = gender; return this; } - public Builder gender(EeocGender gender) { + public Builder gender(GenderEnum gender) { this.gender = Optional.ofNullable(gender); return this; } @JsonSetter(value = "veteran_status", nulls = Nulls.SKIP) - public Builder veteranStatus(Optional veteranStatus) { + public Builder veteranStatus(Optional veteranStatus) { this.veteranStatus = veteranStatus; return this; } - public Builder veteranStatus(EeocVeteranStatus veteranStatus) { + public Builder veteranStatus(VeteranStatusEnum veteranStatus) { this.veteranStatus = Optional.ofNullable(veteranStatus); return this; } @JsonSetter(value = "disability_status", nulls = Nulls.SKIP) - public Builder disabilityStatus(Optional disabilityStatus) { + public Builder disabilityStatus(Optional disabilityStatus) { this.disabilityStatus = disabilityStatus; return this; } - public Builder disabilityStatus(EeocDisabilityStatus disabilityStatus) { + public Builder disabilityStatus(DisabilityStatusEnum disabilityStatus) { this.disabilityStatus = Optional.ofNullable(disabilityStatus); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/EeocCandidate.java b/src/main/java/com/merge/api/ats/types/EeocCandidate.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/EeocCandidate.java rename to src/main/java/com/merge/api/ats/types/EeocCandidate.java index 45c830796..70a21c587 100644 --- a/src/main/java/com/merge/api/resources/ats/types/EeocCandidate.java +++ b/src/main/java/com/merge/api/ats/types/EeocCandidate.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EeocCandidate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EeocCandidate deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/eeocs/requests/EeocsListRequest.java b/src/main/java/com/merge/api/ats/types/EeocsListRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/eeocs/requests/EeocsListRequest.java rename to src/main/java/com/merge/api/ats/types/EeocsListRequest.java index 2da87e38d..9dbf5e26d 100644 --- a/src/main/java/com/merge/api/resources/ats/eeocs/requests/EeocsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/EeocsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.eeocs.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,10 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.eeocs.types.EeocsListRequestRemoteFields; -import com.merge.api.resources.ats.eeocs.types.EeocsListRequestShowEnumOrigins; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EeocsListRequest.Builder.class) public final class EeocsListRequest { + private final Optional> expand; + private final Optional candidateId; private final Optional createdAfter; @@ -31,8 +33,6 @@ public final class EeocsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -54,11 +54,11 @@ public final class EeocsListRequest { private final Map additionalProperties; private EeocsListRequest( + Optional> expand, Optional candidateId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -69,11 +69,11 @@ private EeocsListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.candidateId = candidateId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -86,6 +86,14 @@ private EeocsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return EEOC info for this candidate. */ @@ -118,14 +126,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -210,11 +210,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(EeocsListRequest other) { - return candidateId.equals(other.candidateId) + return expand.equals(other.expand) + && candidateId.equals(other.candidateId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -229,11 +229,11 @@ private boolean equalTo(EeocsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.candidateId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -256,6 +256,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional candidateId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -264,8 +266,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -290,11 +290,11 @@ public static final class Builder { private Builder() {} public Builder from(EeocsListRequest other) { + expand(other.getExpand()); candidateId(other.getCandidateId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -307,6 +307,22 @@ public Builder from(EeocsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "candidate_id", nulls = Nulls.SKIP) public Builder candidateId(Optional candidateId) { this.candidateId = candidateId; @@ -351,17 +367,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -463,11 +468,11 @@ public Builder showEnumOrigins(EeocsListRequestShowEnumOrigins showEnumOrigins) public EeocsListRequest build() { return new EeocsListRequest( + expand, candidateId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/EeocsListRequestRemoteFields.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsListRequestRemoteFields.java rename to src/main/java/com/merge/api/ats/types/EeocsListRequestRemoteFields.java index cfa315482..729b79b98 100644 --- a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/ats/types/EeocsListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.eeocs.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/EeocsListRequestShowEnumOrigins.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/ats/types/EeocsListRequestShowEnumOrigins.java index 930945c02..b7bc27238 100644 --- a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/ats/types/EeocsListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.eeocs.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/eeocs/requests/EeocsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequest.java similarity index 76% rename from src/main/java/com/merge/api/resources/ats/eeocs/requests/EeocsRetrieveRequest.java rename to src/main/java/com/merge/api/ats/types/EeocsRetrieveRequest.java index 38f71d42d..4acd5a3c8 100644 --- a/src/main/java/com/merge/api/resources/ats/eeocs/requests/EeocsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.eeocs.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.eeocs.types.EeocsRetrieveRequestRemoteFields; -import com.merge.api.resources.ats.eeocs.types.EeocsRetrieveRequestShowEnumOrigins; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,10 +22,12 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EeocsRetrieveRequest.Builder.class) public final class EeocsRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -33,13 +35,15 @@ public final class EeocsRetrieveRequest { private final Map additionalProperties; private EeocsRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -49,7 +53,7 @@ private EeocsRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -61,6 +65,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -91,13 +103,15 @@ public Map getAdditionalProperties() { private boolean equalTo(EeocsRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -111,10 +125,12 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -127,22 +143,28 @@ private Builder() {} public Builder from(EeocsRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(String expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -154,6 +176,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -178,7 +211,7 @@ public Builder showEnumOrigins(EeocsRetrieveRequestShowEnumOrigins showEnumOrigi public EeocsRetrieveRequest build() { return new EeocsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestRemoteFields.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestRemoteFields.java index c4171095c..1ace1a7bf 100644 --- a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.eeocs.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestShowEnumOrigins.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestShowEnumOrigins.java index 62f374604..78e0f80d2 100644 --- a/src/main/java/com/merge/api/resources/ats/eeocs/types/EeocsRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.eeocs.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/EmailAddress.java b/src/main/java/com/merge/api/ats/types/EmailAddress.java new file mode 100644 index 000000000..5717a016c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EmailAddress.java @@ -0,0 +1,215 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailAddress.Builder.class) +public final class EmailAddress { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional value; + + private final Optional emailAddressType; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private EmailAddress( + Optional createdAt, + Optional modifiedAt, + Optional value, + Optional emailAddressType, + Optional remoteWasDeleted, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.value = value; + this.emailAddressType = emailAddressType; + this.remoteWasDeleted = remoteWasDeleted; + this.additionalProperties = additionalProperties; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The email address. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + /** + * @return The type of email address. + *
    + *
  • PERSONAL - PERSONAL
  • + *
  • WORK - WORK
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("email_address_type") + public Optional getEmailAddressType() { + return emailAddressType; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailAddress && equalTo((EmailAddress) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailAddress other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && value.equals(other.value) + && emailAddressType.equals(other.emailAddressType) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.value, this.emailAddressType, this.remoteWasDeleted); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional value = Optional.empty(); + + private Optional emailAddressType = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailAddress other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + value(other.getValue()); + emailAddressType(other.getEmailAddressType()); + remoteWasDeleted(other.getRemoteWasDeleted()); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) + public Builder emailAddressType(Optional emailAddressType) { + this.emailAddressType = emailAddressType; + return this; + } + + public Builder emailAddressType(EmailAddressTypeEnum emailAddressType) { + this.emailAddressType = Optional.ofNullable(emailAddressType); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + public EmailAddress build() { + return new EmailAddress( + createdAt, modifiedAt, value, emailAddressType, remoteWasDeleted, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/EmailAddressRequest.java b/src/main/java/com/merge/api/ats/types/EmailAddressRequest.java new file mode 100644 index 000000000..2601b9c03 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EmailAddressRequest.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailAddressRequest.Builder.class) +public final class EmailAddressRequest { + private final Optional value; + + private final Optional emailAddressType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private EmailAddressRequest( + Optional value, + Optional emailAddressType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.value = value; + this.emailAddressType = emailAddressType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The email address. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + /** + * @return The type of email address. + *
    + *
  • PERSONAL - PERSONAL
  • + *
  • WORK - WORK
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("email_address_type") + public Optional getEmailAddressType() { + return emailAddressType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailAddressRequest && equalTo((EmailAddressRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailAddressRequest other) { + return value.equals(other.value) + && emailAddressType.equals(other.emailAddressType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.emailAddressType, this.integrationParams, this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional value = Optional.empty(); + + private Optional emailAddressType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailAddressRequest other) { + value(other.getValue()); + emailAddressType(other.getEmailAddressType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) + public Builder emailAddressType(Optional emailAddressType) { + this.emailAddressType = emailAddressType; + return this; + } + + public Builder emailAddressType(EmailAddressTypeEnum emailAddressType) { + this.emailAddressType = Optional.ofNullable(emailAddressType); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public EmailAddressRequest build() { + return new EmailAddressRequest( + value, emailAddressType, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/EmailAddressTypeEnum.java b/src/main/java/com/merge/api/ats/types/EmailAddressTypeEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/types/EmailAddressTypeEnum.java rename to src/main/java/com/merge/api/ats/types/EmailAddressTypeEnum.java index 9004e9860..3ab2ffbc2 100644 --- a/src/main/java/com/merge/api/resources/ats/types/EmailAddressTypeEnum.java +++ b/src/main/java/com/merge/api/ats/types/EmailAddressTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/ats/types/EnabledActionsEnum.java new file mode 100644 index 000000000..d37c23517 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EnabledActionsEnum { + READ("READ"), + + WRITE("WRITE"); + + private final String value; + + EnabledActionsEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/EncodingEnum.java b/src/main/java/com/merge/api/ats/types/EncodingEnum.java new file mode 100644 index 000000000..50d103fb7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EncodingEnum { + RAW("RAW"), + + BASE_64("BASE64"), + + GZIP_BASE_64("GZIP_BASE64"); + + private final String value; + + EncodingEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/ats/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..a2264c7ba --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EndUserDetailsRequest.java @@ -0,0 +1,607 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + _FinalStage language(Optional language); + + _FinalStage language(LanguageEnum language); + + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + return this; + } + + /** + *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

Your end user's organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

A JSON object containing integration-specific configuration options.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

The following subset of IETF language tags can be used to configure localization.

+ *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/ats/types/ErrorValidationProblem.java new file mode 100644 index 000000000..e8eda3523 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ErrorValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/EventTypeEnum.java b/src/main/java/com/merge/api/ats/types/EventTypeEnum.java new file mode 100644 index 000000000..5a5e7b56c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EventTypeEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EventTypeEnum { + CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), + + DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), + + CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), + + DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), + + REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), + + INVITED_USER("INVITED_USER"), + + TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), + + TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), + + DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), + + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT("DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"), + + CREATED_DESTINATION("CREATED_DESTINATION"), + + DELETED_DESTINATION("DELETED_DESTINATION"), + + CHANGED_DESTINATION("CHANGED_DESTINATION"), + + CHANGED_SCOPES("CHANGED_SCOPES"), + + CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), + + CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), + + ENABLED_INTEGRATION("ENABLED_INTEGRATION"), + + DISABLED_INTEGRATION("DISABLED_INTEGRATION"), + + ENABLED_CATEGORY("ENABLED_CATEGORY"), + + DISABLED_CATEGORY("DISABLED_CATEGORY"), + + CHANGED_PASSWORD("CHANGED_PASSWORD"), + + RESET_PASSWORD("RESET_PASSWORD"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), + + DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), + + DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), + + MUTED_ISSUE("MUTED_ISSUE"), + + GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), + + ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), + + DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), + + MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), + + END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); + + private final String value; + + EventTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..1866b3629 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..13a0ae77c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> activity; + + private final Optional> application; + + private final Optional> attachment; + + private final Optional> candidate; + + private final Optional> department; + + private final Optional> eeoc; + + private final Optional> scheduledInterview; + + private final Optional> job; + + private final Optional> jobPosting; + + private final Optional> jobInterviewStage; + + private final Optional> offer; + + private final Optional> office; + + private final Optional> rejectReason; + + private final Optional> scorecard; + + private final Optional> tag; + + private final Optional> remoteUser; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> activity, + Optional> application, + Optional> attachment, + Optional> candidate, + Optional> department, + Optional> eeoc, + Optional> scheduledInterview, + Optional> job, + Optional> jobPosting, + Optional> jobInterviewStage, + Optional> offer, + Optional> office, + Optional> rejectReason, + Optional> scorecard, + Optional> tag, + Optional> remoteUser, + Map additionalProperties) { + this.activity = activity; + this.application = application; + this.attachment = attachment; + this.candidate = candidate; + this.department = department; + this.eeoc = eeoc; + this.scheduledInterview = scheduledInterview; + this.job = job; + this.jobPosting = jobPosting; + this.jobInterviewStage = jobInterviewStage; + this.offer = offer; + this.office = office; + this.rejectReason = rejectReason; + this.scorecard = scorecard; + this.tag = tag; + this.remoteUser = remoteUser; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Activity") + public Optional> getActivity() { + return activity; + } + + @JsonProperty("Application") + public Optional> getApplication() { + return application; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("Candidate") + public Optional> getCandidate() { + return candidate; + } + + @JsonProperty("Department") + public Optional> getDepartment() { + return department; + } + + @JsonProperty("EEOC") + public Optional> getEeoc() { + return eeoc; + } + + @JsonProperty("ScheduledInterview") + public Optional> getScheduledInterview() { + return scheduledInterview; + } + + @JsonProperty("Job") + public Optional> getJob() { + return job; + } + + @JsonProperty("JobPosting") + public Optional> getJobPosting() { + return jobPosting; + } + + @JsonProperty("JobInterviewStage") + public Optional> getJobInterviewStage() { + return jobInterviewStage; + } + + @JsonProperty("Offer") + public Optional> getOffer() { + return offer; + } + + @JsonProperty("Office") + public Optional> getOffice() { + return office; + } + + @JsonProperty("RejectReason") + public Optional> getRejectReason() { + return rejectReason; + } + + @JsonProperty("Scorecard") + public Optional> getScorecard() { + return scorecard; + } + + @JsonProperty("Tag") + public Optional> getTag() { + return tag; + } + + @JsonProperty("RemoteUser") + public Optional> getRemoteUser() { + return remoteUser; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return activity.equals(other.activity) + && application.equals(other.application) + && attachment.equals(other.attachment) + && candidate.equals(other.candidate) + && department.equals(other.department) + && eeoc.equals(other.eeoc) + && scheduledInterview.equals(other.scheduledInterview) + && job.equals(other.job) + && jobPosting.equals(other.jobPosting) + && jobInterviewStage.equals(other.jobInterviewStage) + && offer.equals(other.offer) + && office.equals(other.office) + && rejectReason.equals(other.rejectReason) + && scorecard.equals(other.scorecard) + && tag.equals(other.tag) + && remoteUser.equals(other.remoteUser); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.activity, + this.application, + this.attachment, + this.candidate, + this.department, + this.eeoc, + this.scheduledInterview, + this.job, + this.jobPosting, + this.jobInterviewStage, + this.offer, + this.office, + this.rejectReason, + this.scorecard, + this.tag, + this.remoteUser); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> activity = Optional.empty(); + + private Optional> application = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> candidate = Optional.empty(); + + private Optional> department = Optional.empty(); + + private Optional> eeoc = Optional.empty(); + + private Optional> scheduledInterview = Optional.empty(); + + private Optional> job = Optional.empty(); + + private Optional> jobPosting = Optional.empty(); + + private Optional> jobInterviewStage = Optional.empty(); + + private Optional> offer = Optional.empty(); + + private Optional> office = Optional.empty(); + + private Optional> rejectReason = Optional.empty(); + + private Optional> scorecard = Optional.empty(); + + private Optional> tag = Optional.empty(); + + private Optional> remoteUser = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + activity(other.getActivity()); + application(other.getApplication()); + attachment(other.getAttachment()); + candidate(other.getCandidate()); + department(other.getDepartment()); + eeoc(other.getEeoc()); + scheduledInterview(other.getScheduledInterview()); + job(other.getJob()); + jobPosting(other.getJobPosting()); + jobInterviewStage(other.getJobInterviewStage()); + offer(other.getOffer()); + office(other.getOffice()); + rejectReason(other.getRejectReason()); + scorecard(other.getScorecard()); + tag(other.getTag()); + remoteUser(other.getRemoteUser()); + return this; + } + + @JsonSetter(value = "Activity", nulls = Nulls.SKIP) + public Builder activity(Optional> activity) { + this.activity = activity; + return this; + } + + public Builder activity(List activity) { + this.activity = Optional.ofNullable(activity); + return this; + } + + @JsonSetter(value = "Application", nulls = Nulls.SKIP) + public Builder application(Optional> application) { + this.application = application; + return this; + } + + public Builder application(List application) { + this.application = Optional.ofNullable(application); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "Candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional> candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(List candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "Department", nulls = Nulls.SKIP) + public Builder department(Optional> department) { + this.department = department; + return this; + } + + public Builder department(List department) { + this.department = Optional.ofNullable(department); + return this; + } + + @JsonSetter(value = "EEOC", nulls = Nulls.SKIP) + public Builder eeoc(Optional> eeoc) { + this.eeoc = eeoc; + return this; + } + + public Builder eeoc(List eeoc) { + this.eeoc = Optional.ofNullable(eeoc); + return this; + } + + @JsonSetter(value = "ScheduledInterview", nulls = Nulls.SKIP) + public Builder scheduledInterview(Optional> scheduledInterview) { + this.scheduledInterview = scheduledInterview; + return this; + } + + public Builder scheduledInterview(List scheduledInterview) { + this.scheduledInterview = Optional.ofNullable(scheduledInterview); + return this; + } + + @JsonSetter(value = "Job", nulls = Nulls.SKIP) + public Builder job(Optional> job) { + this.job = job; + return this; + } + + public Builder job(List job) { + this.job = Optional.ofNullable(job); + return this; + } + + @JsonSetter(value = "JobPosting", nulls = Nulls.SKIP) + public Builder jobPosting(Optional> jobPosting) { + this.jobPosting = jobPosting; + return this; + } + + public Builder jobPosting(List jobPosting) { + this.jobPosting = Optional.ofNullable(jobPosting); + return this; + } + + @JsonSetter(value = "JobInterviewStage", nulls = Nulls.SKIP) + public Builder jobInterviewStage(Optional> jobInterviewStage) { + this.jobInterviewStage = jobInterviewStage; + return this; + } + + public Builder jobInterviewStage(List jobInterviewStage) { + this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); + return this; + } + + @JsonSetter(value = "Offer", nulls = Nulls.SKIP) + public Builder offer(Optional> offer) { + this.offer = offer; + return this; + } + + public Builder offer(List offer) { + this.offer = Optional.ofNullable(offer); + return this; + } + + @JsonSetter(value = "Office", nulls = Nulls.SKIP) + public Builder office(Optional> office) { + this.office = office; + return this; + } + + public Builder office(List office) { + this.office = Optional.ofNullable(office); + return this; + } + + @JsonSetter(value = "RejectReason", nulls = Nulls.SKIP) + public Builder rejectReason(Optional> rejectReason) { + this.rejectReason = rejectReason; + return this; + } + + public Builder rejectReason(List rejectReason) { + this.rejectReason = Optional.ofNullable(rejectReason); + return this; + } + + @JsonSetter(value = "Scorecard", nulls = Nulls.SKIP) + public Builder scorecard(Optional> scorecard) { + this.scorecard = scorecard; + return this; + } + + public Builder scorecard(List scorecard) { + this.scorecard = Optional.ofNullable(scorecard); + return this; + } + + @JsonSetter(value = "Tag", nulls = Nulls.SKIP) + public Builder tag(Optional> tag) { + this.tag = tag; + return this; + } + + public Builder tag(List tag) { + this.tag = Optional.ofNullable(tag); + return this; + } + + @JsonSetter(value = "RemoteUser", nulls = Nulls.SKIP) + public Builder remoteUser(Optional> remoteUser) { + this.remoteUser = remoteUser; + return this; + } + + public Builder remoteUser(List remoteUser) { + this.remoteUser = Optional.ofNullable(remoteUser); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse( + activity, + application, + attachment, + candidate, + department, + eeoc, + scheduledInterview, + job, + jobPosting, + jobInterviewStage, + offer, + office, + rejectReason, + scorecard, + tag, + remoteUser, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..98cc4621b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..c75015f7b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..f06617594 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..ec0e3edf3 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> activity; + + private final Optional> application; + + private final Optional> attachment; + + private final Optional> candidate; + + private final Optional> department; + + private final Optional> eeoc; + + private final Optional> scheduledInterview; + + private final Optional> job; + + private final Optional> jobPosting; + + private final Optional> jobInterviewStage; + + private final Optional> offer; + + private final Optional> office; + + private final Optional> rejectReason; + + private final Optional> scorecard; + + private final Optional> tag; + + private final Optional> remoteUser; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> activity, + Optional> application, + Optional> attachment, + Optional> candidate, + Optional> department, + Optional> eeoc, + Optional> scheduledInterview, + Optional> job, + Optional> jobPosting, + Optional> jobInterviewStage, + Optional> offer, + Optional> office, + Optional> rejectReason, + Optional> scorecard, + Optional> tag, + Optional> remoteUser, + Map additionalProperties) { + this.activity = activity; + this.application = application; + this.attachment = attachment; + this.candidate = candidate; + this.department = department; + this.eeoc = eeoc; + this.scheduledInterview = scheduledInterview; + this.job = job; + this.jobPosting = jobPosting; + this.jobInterviewStage = jobInterviewStage; + this.offer = offer; + this.office = office; + this.rejectReason = rejectReason; + this.scorecard = scorecard; + this.tag = tag; + this.remoteUser = remoteUser; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Activity") + public Optional> getActivity() { + return activity; + } + + @JsonProperty("Application") + public Optional> getApplication() { + return application; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("Candidate") + public Optional> getCandidate() { + return candidate; + } + + @JsonProperty("Department") + public Optional> getDepartment() { + return department; + } + + @JsonProperty("EEOC") + public Optional> getEeoc() { + return eeoc; + } + + @JsonProperty("ScheduledInterview") + public Optional> getScheduledInterview() { + return scheduledInterview; + } + + @JsonProperty("Job") + public Optional> getJob() { + return job; + } + + @JsonProperty("JobPosting") + public Optional> getJobPosting() { + return jobPosting; + } + + @JsonProperty("JobInterviewStage") + public Optional> getJobInterviewStage() { + return jobInterviewStage; + } + + @JsonProperty("Offer") + public Optional> getOffer() { + return offer; + } + + @JsonProperty("Office") + public Optional> getOffice() { + return office; + } + + @JsonProperty("RejectReason") + public Optional> getRejectReason() { + return rejectReason; + } + + @JsonProperty("Scorecard") + public Optional> getScorecard() { + return scorecard; + } + + @JsonProperty("Tag") + public Optional> getTag() { + return tag; + } + + @JsonProperty("RemoteUser") + public Optional> getRemoteUser() { + return remoteUser; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return activity.equals(other.activity) + && application.equals(other.application) + && attachment.equals(other.attachment) + && candidate.equals(other.candidate) + && department.equals(other.department) + && eeoc.equals(other.eeoc) + && scheduledInterview.equals(other.scheduledInterview) + && job.equals(other.job) + && jobPosting.equals(other.jobPosting) + && jobInterviewStage.equals(other.jobInterviewStage) + && offer.equals(other.offer) + && office.equals(other.office) + && rejectReason.equals(other.rejectReason) + && scorecard.equals(other.scorecard) + && tag.equals(other.tag) + && remoteUser.equals(other.remoteUser); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.activity, + this.application, + this.attachment, + this.candidate, + this.department, + this.eeoc, + this.scheduledInterview, + this.job, + this.jobPosting, + this.jobInterviewStage, + this.offer, + this.office, + this.rejectReason, + this.scorecard, + this.tag, + this.remoteUser); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> activity = Optional.empty(); + + private Optional> application = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> candidate = Optional.empty(); + + private Optional> department = Optional.empty(); + + private Optional> eeoc = Optional.empty(); + + private Optional> scheduledInterview = Optional.empty(); + + private Optional> job = Optional.empty(); + + private Optional> jobPosting = Optional.empty(); + + private Optional> jobInterviewStage = Optional.empty(); + + private Optional> offer = Optional.empty(); + + private Optional> office = Optional.empty(); + + private Optional> rejectReason = Optional.empty(); + + private Optional> scorecard = Optional.empty(); + + private Optional> tag = Optional.empty(); + + private Optional> remoteUser = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + activity(other.getActivity()); + application(other.getApplication()); + attachment(other.getAttachment()); + candidate(other.getCandidate()); + department(other.getDepartment()); + eeoc(other.getEeoc()); + scheduledInterview(other.getScheduledInterview()); + job(other.getJob()); + jobPosting(other.getJobPosting()); + jobInterviewStage(other.getJobInterviewStage()); + offer(other.getOffer()); + office(other.getOffice()); + rejectReason(other.getRejectReason()); + scorecard(other.getScorecard()); + tag(other.getTag()); + remoteUser(other.getRemoteUser()); + return this; + } + + @JsonSetter(value = "Activity", nulls = Nulls.SKIP) + public Builder activity(Optional> activity) { + this.activity = activity; + return this; + } + + public Builder activity(List activity) { + this.activity = Optional.ofNullable(activity); + return this; + } + + @JsonSetter(value = "Application", nulls = Nulls.SKIP) + public Builder application(Optional> application) { + this.application = application; + return this; + } + + public Builder application(List application) { + this.application = Optional.ofNullable(application); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "Candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional> candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(List candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "Department", nulls = Nulls.SKIP) + public Builder department(Optional> department) { + this.department = department; + return this; + } + + public Builder department(List department) { + this.department = Optional.ofNullable(department); + return this; + } + + @JsonSetter(value = "EEOC", nulls = Nulls.SKIP) + public Builder eeoc(Optional> eeoc) { + this.eeoc = eeoc; + return this; + } + + public Builder eeoc(List eeoc) { + this.eeoc = Optional.ofNullable(eeoc); + return this; + } + + @JsonSetter(value = "ScheduledInterview", nulls = Nulls.SKIP) + public Builder scheduledInterview(Optional> scheduledInterview) { + this.scheduledInterview = scheduledInterview; + return this; + } + + public Builder scheduledInterview(List scheduledInterview) { + this.scheduledInterview = Optional.ofNullable(scheduledInterview); + return this; + } + + @JsonSetter(value = "Job", nulls = Nulls.SKIP) + public Builder job(Optional> job) { + this.job = job; + return this; + } + + public Builder job(List job) { + this.job = Optional.ofNullable(job); + return this; + } + + @JsonSetter(value = "JobPosting", nulls = Nulls.SKIP) + public Builder jobPosting(Optional> jobPosting) { + this.jobPosting = jobPosting; + return this; + } + + public Builder jobPosting(List jobPosting) { + this.jobPosting = Optional.ofNullable(jobPosting); + return this; + } + + @JsonSetter(value = "JobInterviewStage", nulls = Nulls.SKIP) + public Builder jobInterviewStage(Optional> jobInterviewStage) { + this.jobInterviewStage = jobInterviewStage; + return this; + } + + public Builder jobInterviewStage(List jobInterviewStage) { + this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); + return this; + } + + @JsonSetter(value = "Offer", nulls = Nulls.SKIP) + public Builder offer(Optional> offer) { + this.offer = offer; + return this; + } + + public Builder offer(List offer) { + this.offer = Optional.ofNullable(offer); + return this; + } + + @JsonSetter(value = "Office", nulls = Nulls.SKIP) + public Builder office(Optional> office) { + this.office = office; + return this; + } + + public Builder office(List office) { + this.office = Optional.ofNullable(office); + return this; + } + + @JsonSetter(value = "RejectReason", nulls = Nulls.SKIP) + public Builder rejectReason(Optional> rejectReason) { + this.rejectReason = rejectReason; + return this; + } + + public Builder rejectReason(List rejectReason) { + this.rejectReason = Optional.ofNullable(rejectReason); + return this; + } + + @JsonSetter(value = "Scorecard", nulls = Nulls.SKIP) + public Builder scorecard(Optional> scorecard) { + this.scorecard = scorecard; + return this; + } + + public Builder scorecard(List scorecard) { + this.scorecard = Optional.ofNullable(scorecard); + return this; + } + + @JsonSetter(value = "Tag", nulls = Nulls.SKIP) + public Builder tag(Optional> tag) { + this.tag = tag; + return this; + } + + public Builder tag(List tag) { + this.tag = Optional.ofNullable(tag); + return this; + } + + @JsonSetter(value = "RemoteUser", nulls = Nulls.SKIP) + public Builder remoteUser(Optional> remoteUser) { + this.remoteUser = remoteUser; + return this; + } + + public Builder remoteUser(List remoteUser) { + this.remoteUser = Optional.ofNullable(remoteUser); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse( + activity, + application, + attachment, + candidate, + department, + eeoc, + scheduledInterview, + job, + jobPosting, + jobInterviewStage, + offer, + office, + rejectReason, + scorecard, + tag, + remoteUser, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..4dbbfd351 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/ats/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..ac5055764 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingInstanceResponse.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..bb1fb769d --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/ats/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..e2a46ad51 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/ats/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..0c1f0b08f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/GenderEnum.java b/src/main/java/com/merge/api/ats/types/GenderEnum.java new file mode 100644 index 000000000..e463e4149 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/GenderEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GenderEnum { + MALE("MALE"), + + FEMALE("FEMALE"), + + NON_BINARY("NON-BINARY"), + + OTHER("OTHER"), + + DECLINE_TO_SELF_IDENTIFY("DECLINE_TO_SELF_IDENTIFY"); + + private final String value; + + GenderEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/ats/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..ea22e52d6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/IgnoreCommonModelRequest.java b/src/main/java/com/merge/api/ats/types/IgnoreCommonModelRequest.java new file mode 100644 index 000000000..e56a06342 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/IgnoreCommonModelRequest.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IgnoreCommonModelRequest.Builder.class) +public final class IgnoreCommonModelRequest { + private final ReasonEnum reason; + + private final Optional message; + + private final Map additionalProperties; + + private IgnoreCommonModelRequest( + ReasonEnum reason, Optional message, Map additionalProperties) { + this.reason = reason; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("reason") + public ReasonEnum getReason() { + return reason; + } + + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IgnoreCommonModelRequest && equalTo((IgnoreCommonModelRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IgnoreCommonModelRequest other) { + return reason.equals(other.reason) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.reason, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ReasonStage builder() { + return new Builder(); + } + + public interface ReasonStage { + _FinalStage reason(@NotNull ReasonEnum reason); + + Builder from(IgnoreCommonModelRequest other); + } + + public interface _FinalStage { + IgnoreCommonModelRequest build(); + + _FinalStage message(Optional message); + + _FinalStage message(String message); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ReasonStage, _FinalStage { + private ReasonEnum reason; + + private Optional message = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IgnoreCommonModelRequest other) { + reason(other.getReason()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("reason") + public _FinalStage reason(@NotNull ReasonEnum reason) { + this.reason = reason; + return this; + } + + @java.lang.Override + public _FinalStage message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + @java.lang.Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @java.lang.Override + public IgnoreCommonModelRequest build() { + return new IgnoreCommonModelRequest(reason, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/ats/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..f2ef13fae --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/ats/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..431a880e6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/interviews/requests/InterviewsListRequest.java b/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/interviews/requests/InterviewsListRequest.java rename to src/main/java/com/merge/api/ats/types/InterviewsListRequest.java index 0296b8a99..80dfdd324 100644 --- a/src/main/java/com/merge/api/resources/ats/interviews/requests/InterviewsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.interviews.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.interviews.types.InterviewsListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = InterviewsListRequest.Builder.class) public final class InterviewsListRequest { + private final Optional> expand; + private final Optional applicationId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class InterviewsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,11 +60,11 @@ public final class InterviewsListRequest { private final Map additionalProperties; private InterviewsListRequest( + Optional> expand, Optional applicationId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -77,11 +78,11 @@ private InterviewsListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.applicationId = applicationId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -97,6 +98,14 @@ private InterviewsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return interviews for this application. */ @@ -129,14 +138,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -245,11 +246,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(InterviewsListRequest other) { - return applicationId.equals(other.applicationId) + return expand.equals(other.expand) + && applicationId.equals(other.applicationId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -267,11 +268,11 @@ private boolean equalTo(InterviewsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.applicationId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -297,6 +298,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional applicationId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -305,8 +308,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -337,11 +338,11 @@ public static final class Builder { private Builder() {} public Builder from(InterviewsListRequest other) { + expand(other.getExpand()); applicationId(other.getApplicationId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -357,6 +358,22 @@ public Builder from(InterviewsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(InterviewsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "application_id", nulls = Nulls.SKIP) public Builder applicationId(Optional applicationId) { this.applicationId = applicationId; @@ -401,17 +418,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(InterviewsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -546,11 +552,11 @@ public Builder showEnumOrigins(String showEnumOrigins) { public InterviewsListRequest build() { return new InterviewsListRequest( + expand, applicationId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ats/types/InterviewsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/InterviewsListRequestExpandItem.java new file mode 100644 index 000000000..0181e2f42 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/InterviewsListRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InterviewsListRequestExpandItem { + APPLICATION("application"), + + INTERVIEWERS("interviewers"), + + JOB_INTERVIEW_STAGE("job_interview_stage"), + + ORGANIZER("organizer"); + + private final String value; + + InterviewsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequest.java new file mode 100644 index 000000000..a760fed70 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InterviewsRetrieveRequest.Builder.class) +public final class InterviewsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private InterviewsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InterviewsRetrieveRequest && equalTo((InterviewsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InterviewsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InterviewsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(InterviewsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public InterviewsRetrieveRequest build() { + return new InterviewsRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..49910b945 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum InterviewsRetrieveRequestExpandItem { + APPLICATION("application"), + + INTERVIEWERS("interviewers"), + + JOB_INTERVIEW_STAGE("job_interview_stage"), + + ORGANIZER("organizer"); + + private final String value; + + InterviewsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/Issue.java b/src/main/java/com/merge/api/ats/types/Issue.java new file mode 100644 index 000000000..a6d784c17 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/Issue.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage status(Optional status); + + _FinalStage status(IssueStatusEnum status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

+ *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/IssueStatusEnum.java b/src/main/java/com/merge/api/ats/types/IssueStatusEnum.java new file mode 100644 index 000000000..583331ce1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssueStatusEnum { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssueStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/IssuesListRequest.java b/src/main/java/com/merge/api/ats/types/IssuesListRequest.java new file mode 100644 index 000000000..4054cf5ce --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/IssuesListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/ats/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..997e6e8a3 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssuesListRequestStatus { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssuesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/Job.java b/src/main/java/com/merge/api/ats/types/Job.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/types/Job.java rename to src/main/java/com/merge/api/ats/types/Job.java index e41a3f926..e6fe49d31 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Job.java +++ b/src/main/java/com/merge/api/ats/types/Job.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,7 +37,7 @@ public final class Job { private final Optional code; - private final Optional status; + private final Optional status; private final Optional type; @@ -75,7 +75,7 @@ private Job( Optional name, Optional description, Optional code, - Optional status, + Optional status, Optional type, Optional>> jobPostings, Optional> jobPostingUrls, @@ -178,7 +178,7 @@ public Optional getCode() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -368,7 +368,7 @@ public static final class Builder { private Optional code = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional type = Optional.empty(); @@ -504,12 +504,12 @@ public Builder code(String code) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(JobStatus status) { + public Builder status(JobStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/JobDepartmentsItem.java b/src/main/java/com/merge/api/ats/types/JobDepartmentsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/JobDepartmentsItem.java rename to src/main/java/com/merge/api/ats/types/JobDepartmentsItem.java index 7d1bcc7e5..04eb1e6b3 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobDepartmentsItem.java +++ b/src/main/java/com/merge/api/ats/types/JobDepartmentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JobDepartmentsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JobDepartmentsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/JobHiringManagersItem.java b/src/main/java/com/merge/api/ats/types/JobHiringManagersItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/JobHiringManagersItem.java rename to src/main/java/com/merge/api/ats/types/JobHiringManagersItem.java index a462d503e..bbf0b9b49 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobHiringManagersItem.java +++ b/src/main/java/com/merge/api/ats/types/JobHiringManagersItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JobHiringManagersItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JobHiringManagersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/JobInterviewStage.java b/src/main/java/com/merge/api/ats/types/JobInterviewStage.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/JobInterviewStage.java rename to src/main/java/com/merge/api/ats/types/JobInterviewStage.java index cd9e8bcd3..3ad6e3043 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobInterviewStage.java +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStage.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/JobInterviewStageJob.java b/src/main/java/com/merge/api/ats/types/JobInterviewStageJob.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/JobInterviewStageJob.java rename to src/main/java/com/merge/api/ats/types/JobInterviewStageJob.java index 5859a8e2f..bc6525a36 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobInterviewStageJob.java +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStageJob.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JobInterviewStageJob deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JobInterviewStageJob deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesListRequest.java b/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesListRequest.java rename to src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java index 16d84bd18..83cea40fb 100644 --- a/src/main/java/com/merge/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.jobinterviewstages.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JobInterviewStagesListRequest.Builder.class) public final class JobInterviewStagesListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -48,10 +50,10 @@ public final class JobInterviewStagesListRequest { private final Map additionalProperties; private JobInterviewStagesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,10 +63,10 @@ private JobInterviewStagesListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -76,6 +78,14 @@ private JobInterviewStagesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -100,14 +110,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -184,10 +186,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(JobInterviewStagesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -201,10 +203,10 @@ private boolean equalTo(JobInterviewStagesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -226,14 +228,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -256,10 +258,10 @@ public static final class Builder { private Builder() {} public Builder from(JobInterviewStagesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -271,6 +273,22 @@ public Builder from(JobInterviewStagesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -304,17 +322,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -405,10 +412,10 @@ public Builder remoteId(String remoteId) { public JobInterviewStagesListRequest build() { return new JobInterviewStagesListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequest.java new file mode 100644 index 000000000..2df6e04fb --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequest.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JobInterviewStagesRetrieveRequest.Builder.class) +public final class JobInterviewStagesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private JobInterviewStagesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobInterviewStagesRetrieveRequest && equalTo((JobInterviewStagesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobInterviewStagesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(JobInterviewStagesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public JobInterviewStagesRetrieveRequest build() { + return new JobInterviewStagesRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/JobOfficesItem.java b/src/main/java/com/merge/api/ats/types/JobOfficesItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/JobOfficesItem.java rename to src/main/java/com/merge/api/ats/types/JobOfficesItem.java index 69418a273..23371d3e6 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobOfficesItem.java +++ b/src/main/java/com/merge/api/ats/types/JobOfficesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JobOfficesItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JobOfficesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/JobPosting.java b/src/main/java/com/merge/api/ats/types/JobPosting.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/JobPosting.java rename to src/main/java/com/merge/api/ats/types/JobPosting.java index 6a27cc6ed..5789fdd64 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobPosting.java +++ b/src/main/java/com/merge/api/ats/types/JobPosting.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/JobPostingJob.java b/src/main/java/com/merge/api/ats/types/JobPostingJob.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/JobPostingJob.java rename to src/main/java/com/merge/api/ats/types/JobPostingJob.java index 8973f0695..beced4651 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobPostingJob.java +++ b/src/main/java/com/merge/api/ats/types/JobPostingJob.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JobPostingJob deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JobPostingJob deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/JobPostingJobPostingUrlsItem.java b/src/main/java/com/merge/api/ats/types/JobPostingJobPostingUrlsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/JobPostingJobPostingUrlsItem.java rename to src/main/java/com/merge/api/ats/types/JobPostingJobPostingUrlsItem.java index 4472dab38..6b3a1d162 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobPostingJobPostingUrlsItem.java +++ b/src/main/java/com/merge/api/ats/types/JobPostingJobPostingUrlsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -49,10 +50,10 @@ public final class JobPostingsListRequest { private final Map additionalProperties; private JobPostingsListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -62,10 +63,10 @@ private JobPostingsListRequest( Optional remoteId, Optional status, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -77,6 +78,14 @@ private JobPostingsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -101,14 +110,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -192,10 +193,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(JobPostingsListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -209,10 +210,10 @@ private boolean equalTo(JobPostingsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -234,14 +235,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -264,10 +265,10 @@ public static final class Builder { private Builder() {} public Builder from(JobPostingsListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -279,6 +280,22 @@ public Builder from(JobPostingsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -312,17 +329,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -413,10 +419,10 @@ public Builder status(JobPostingsListRequestStatus status) { public JobPostingsListRequest build() { return new JobPostingsListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/ats/jobpostings/types/JobPostingsListRequestStatus.java b/src/main/java/com/merge/api/ats/types/JobPostingsListRequestStatus.java similarity index 90% rename from src/main/java/com/merge/api/resources/ats/jobpostings/types/JobPostingsListRequestStatus.java rename to src/main/java/com/merge/api/ats/types/JobPostingsListRequestStatus.java index 6709ee28e..73b3bbf9e 100644 --- a/src/main/java/com/merge/api/resources/ats/jobpostings/types/JobPostingsListRequestStatus.java +++ b/src/main/java/com/merge/api/ats/types/JobPostingsListRequestStatus.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.jobpostings.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequest.java new file mode 100644 index 000000000..a669b4b2f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JobPostingsRetrieveRequest.Builder.class) +public final class JobPostingsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private JobPostingsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobPostingsRetrieveRequest && equalTo((JobPostingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobPostingsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(JobPostingsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public JobPostingsRetrieveRequest build() { + return new JobPostingsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/JobRecruitersItem.java b/src/main/java/com/merge/api/ats/types/JobRecruitersItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/JobRecruitersItem.java rename to src/main/java/com/merge/api/ats/types/JobRecruitersItem.java index 5c6122bfe..1b8f4eebf 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobRecruitersItem.java +++ b/src/main/java/com/merge/api/ats/types/JobRecruitersItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public JobRecruitersItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public JobRecruitersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/JobStatusEnum.java b/src/main/java/com/merge/api/ats/types/JobStatusEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/types/JobStatusEnum.java rename to src/main/java/com/merge/api/ats/types/JobStatusEnum.java index a400ba039..9c46a1f8d 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobStatusEnum.java +++ b/src/main/java/com/merge/api/ats/types/JobStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/types/JobTypeEnum.java b/src/main/java/com/merge/api/ats/types/JobTypeEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/types/JobTypeEnum.java rename to src/main/java/com/merge/api/ats/types/JobTypeEnum.java index b3ecf0219..c78766609 100644 --- a/src/main/java/com/merge/api/resources/ats/types/JobTypeEnum.java +++ b/src/main/java/com/merge/api/ats/types/JobTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/jobs/requests/JobsListRequest.java b/src/main/java/com/merge/api/ats/types/JobsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/jobs/requests/JobsListRequest.java rename to src/main/java/com/merge/api/ats/types/JobsListRequest.java index ff90a1334..66717c76d 100644 --- a/src/main/java/com/merge/api/resources/ats/jobs/requests/JobsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.jobs.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,10 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.jobs.types.JobsListRequestExpand; -import com.merge.api.resources.ats.jobs.types.JobsListRequestStatus; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JobsListRequest.Builder.class) public final class JobsListRequest { + private final Optional> expand; + private final Optional code; private final Optional createdAfter; @@ -31,8 +33,6 @@ public final class JobsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -58,11 +58,11 @@ public final class JobsListRequest { private final Map additionalProperties; private JobsListRequest( + Optional> expand, Optional code, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -75,11 +75,11 @@ private JobsListRequest( Optional showEnumOrigins, Optional status, Map additionalProperties) { + this.expand = expand; this.code = code; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -94,6 +94,14 @@ private JobsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return jobs with this code. */ @@ -126,14 +134,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -241,11 +241,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(JobsListRequest other) { - return code.equals(other.code) + return expand.equals(other.expand) + && code.equals(other.code) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -262,11 +262,11 @@ private boolean equalTo(JobsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.code, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -291,6 +291,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional code = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -299,8 +301,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -329,11 +329,11 @@ public static final class Builder { private Builder() {} public Builder from(JobsListRequest other) { + expand(other.getExpand()); code(other.getCode()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -348,6 +348,22 @@ public Builder from(JobsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(JobsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "code", nulls = Nulls.SKIP) public Builder code(Optional code) { this.code = code; @@ -392,17 +408,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(JobsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -526,11 +531,11 @@ public Builder status(JobsListRequestStatus status) { public JobsListRequest build() { return new JobsListRequest( + expand, code, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ats/types/JobsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/JobsListRequestExpandItem.java new file mode 100644 index 000000000..5f486c24a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsListRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobsListRequestExpandItem { + DEPARTMENTS("departments"), + + HIRING_MANAGERS("hiring_managers"), + + JOB_POSTINGS("job_postings"), + + OFFICES("offices"), + + RECRUITERS("recruiters"); + + private final String value; + + JobsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsListRequestStatus.java b/src/main/java/com/merge/api/ats/types/JobsListRequestStatus.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/jobs/types/JobsListRequestStatus.java rename to src/main/java/com/merge/api/ats/types/JobsListRequestStatus.java index e4c884c1d..5a0cf49ed 100644 --- a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsListRequestStatus.java +++ b/src/main/java/com/merge/api/ats/types/JobsListRequestStatus.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.jobs.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/JobsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequest.java new file mode 100644 index 000000000..9dd4d9e8f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = JobsRetrieveRequest.Builder.class) +public final class JobsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private JobsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JobsRetrieveRequest && equalTo((JobsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(JobsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(JobsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(JobsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public JobsRetrieveRequest build() { + return new JobsRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..2f40d6caa --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestExpandItem.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobsRetrieveRequestExpandItem { + DEPARTMENTS("departments"), + + HIRING_MANAGERS("hiring_managers"), + + JOB_POSTINGS("job_postings"), + + OFFICES("offices"), + + RECRUITERS("recruiters"); + + private final String value; + + JobsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/jobs/requests/JobsScreeningQuestionsListRequest.java b/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequest.java similarity index 90% rename from src/main/java/com/merge/api/resources/ats/jobs/requests/JobsScreeningQuestionsListRequest.java rename to src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequest.java index 2711bfa23..4a49cf340 100644 --- a/src/main/java/com/merge/api/resources/ats/jobs/requests/JobsScreeningQuestionsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.jobs.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.jobs.types.JobsScreeningQuestionsListRequestExpand; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,9 +22,9 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JobsScreeningQuestionsListRequest.Builder.class) public final class JobsScreeningQuestionsListRequest { - private final Optional cursor; + private final Optional> expand; - private final Optional expand; + private final Optional cursor; private final Optional includeDeletedData; @@ -36,15 +37,15 @@ public final class JobsScreeningQuestionsListRequest { private final Map additionalProperties; private JobsScreeningQuestionsListRequest( + Optional> expand, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; this.expand = expand; + this.cursor = cursor; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -53,19 +54,19 @@ private JobsScreeningQuestionsListRequest( } /** - * @return The pagination cursor value. + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; + @JsonProperty("expand") + public Optional> getExpand() { + return expand; } /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + * @return The pagination cursor value. */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; } /** @@ -112,8 +113,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(JobsScreeningQuestionsListRequest other) { - return cursor.equals(other.cursor) - && expand.equals(other.expand) + return expand.equals(other.expand) + && cursor.equals(other.cursor) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -123,8 +124,8 @@ private boolean equalTo(JobsScreeningQuestionsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.cursor, this.expand, + this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -142,9 +143,9 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional cursor = Optional.empty(); + private Optional> expand = Optional.empty(); - private Optional expand = Optional.empty(); + private Optional cursor = Optional.empty(); private Optional includeDeletedData = Optional.empty(); @@ -160,8 +161,8 @@ public static final class Builder { private Builder() {} public Builder from(JobsScreeningQuestionsListRequest other) { - cursor(other.getCursor()); expand(other.getExpand()); + cursor(other.getCursor()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -169,25 +170,30 @@ public Builder from(JobsScreeningQuestionsListRequest other) { return this; } - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; return this; } - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; + public Builder expand(JobsScreeningQuestionsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); return this; } - public Builder expand(JobsScreeningQuestionsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); return this; } @@ -237,8 +243,8 @@ public Builder pageSize(Integer pageSize) { public JobsScreeningQuestionsListRequest build() { return new JobsScreeningQuestionsListRequest( - cursor, expand, + cursor, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequestExpandItem.java new file mode 100644 index 000000000..1bdfec611 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum JobsScreeningQuestionsListRequestExpandItem { + JOB("job"), + + OPTIONS("options"); + + private final String value; + + JobsScreeningQuestionsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/LanguageEnum.java b/src/main/java/com/merge/api/ats/types/LanguageEnum.java new file mode 100644 index 000000000..195e794c3 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LanguageEnum { + EN("en"), + + DE("de"); + + private final String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/LastSyncResultEnum.java b/src/main/java/com/merge/api/ats/types/LastSyncResultEnum.java new file mode 100644 index 000000000..115a62280 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/LastSyncResultEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LastSyncResultEnum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + LastSyncResultEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/LinkToken.java b/src/main/java/com/merge/api/ats/types/LinkToken.java new file mode 100644 index 000000000..1a8cda5e0 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/LinkToken.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkToken.Builder.class) +public final class LinkToken { + private final String linkToken; + + private final Optional integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/ats/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..aaecfa73c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/ats/types/LinkedAccountStatus.java new file mode 100644 index 000000000..d6e70ef95 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/LinkedAccountStatus.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) +public final class LinkedAccountStatus { + private final String linkedAccountStatus; + + private final boolean canMakeRequest; + + private final Map additionalProperties; + + private LinkedAccountStatus( + String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { + this.linkedAccountStatus = linkedAccountStatus; + this.canMakeRequest = canMakeRequest; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_status") + public String getLinkedAccountStatus() { + return linkedAccountStatus; + } + + @JsonProperty("can_make_request") + public boolean getCanMakeRequest() { + return canMakeRequest; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountStatus other) { + return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountStatusStage builder() { + return new Builder(); + } + + public interface LinkedAccountStatusStage { + CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); + + Builder from(LinkedAccountStatus other); + } + + public interface CanMakeRequestStage { + _FinalStage canMakeRequest(boolean canMakeRequest); + } + + public interface _FinalStage { + LinkedAccountStatus build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { + private String linkedAccountStatus; + + private boolean canMakeRequest; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @java.lang.Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @java.lang.Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..594bdedcb --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java @@ -0,0 +1,457 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing + *
    + *
  • hris - hris
  • + *
  • ats - ats
  • + *
  • accounting - accounting
  • + *
  • ticketing - ticketing
  • + *
  • crm - crm
  • + *
  • mktg - mktg
  • + *
  • filestorage - filestorage
  • + *
+ */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..9fc4471bb --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LinkedAccountsListRequestCategory { + ACCOUNTING("accounting"), + + ATS("ats"), + + CRM("crm"), + + FILESTORAGE("filestorage"), + + HRIS("hris"), + + MKTG("mktg"), + + TICKETING("ticketing"); + + private final String value; + + LinkedAccountsListRequestCategory(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/MetaResponse.java b/src/main/java/com/merge/api/ats/types/MetaResponse.java new file mode 100644 index 000000000..60c071eae --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/MetaResponse.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MetaResponse.Builder.class) +public final class MetaResponse { + private final Map requestSchema; + + private final Optional> remoteFieldClasses; + + private final Optional status; + + private final boolean hasConditionalParams; + + private final boolean hasRequiredLinkedAccountParams; + + private final Map additionalProperties; + + private MetaResponse( + Map requestSchema, + Optional> remoteFieldClasses, + Optional status, + boolean hasConditionalParams, + boolean hasRequiredLinkedAccountParams, + Map additionalProperties) { + this.requestSchema = requestSchema; + this.remoteFieldClasses = remoteFieldClasses; + this.status = status; + this.hasConditionalParams = hasConditionalParams; + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("request_schema") + public Map getRequestSchema() { + return requestSchema; + } + + @JsonProperty("remote_field_classes") + public Optional> getRemoteFieldClasses() { + return remoteFieldClasses; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("has_conditional_params") + public boolean getHasConditionalParams() { + return hasConditionalParams; + } + + @JsonProperty("has_required_linked_account_params") + public boolean getHasRequiredLinkedAccountParams() { + return hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MetaResponse && equalTo((MetaResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MetaResponse other) { + return requestSchema.equals(other.requestSchema) + && remoteFieldClasses.equals(other.remoteFieldClasses) + && status.equals(other.status) + && hasConditionalParams == other.hasConditionalParams + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasConditionalParamsStage builder() { + return new Builder(); + } + + public interface HasConditionalParamsStage { + HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); + + Builder from(MetaResponse other); + } + + public interface HasRequiredLinkedAccountParamsStage { + _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); + } + + public interface _FinalStage { + MetaResponse build(); + + _FinalStage requestSchema(Map requestSchema); + + _FinalStage putAllRequestSchema(Map requestSchema); + + _FinalStage requestSchema(String key, JsonNode value); + + _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); + + _FinalStage remoteFieldClasses(Map remoteFieldClasses); + + _FinalStage status(Optional status); + + _FinalStage status(LinkedAccountStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { + private boolean hasConditionalParams; + + private boolean hasRequiredLinkedAccountParams; + + private Optional status = Optional.empty(); + + private Optional> remoteFieldClasses = Optional.empty(); + + private Map requestSchema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @java.lang.Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @java.lang.Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @java.lang.Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @java.lang.Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/MethodEnum.java b/src/main/java/com/merge/api/ats/types/MethodEnum.java new file mode 100644 index 000000000..a894a1f76 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MethodEnum { + GET("GET"), + + OPTIONS("OPTIONS"), + + HEAD("HEAD"), + + POST("POST"), + + PUT("PUT"), + + PATCH("PATCH"), + + DELETE("DELETE"); + + private final String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/ModelOperation.java b/src/main/java/com/merge/api/ats/types/ModelOperation.java new file mode 100644 index 000000000..064a3e13f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ModelOperation.java @@ -0,0 +1,226 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/ats/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..9ac15504a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/ats/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..11b0c4c7c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/ats/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..33e8a5c6b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/MultipartFormFieldRequest.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(EncodingEnum encoding); + + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

The name of the form field

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

The data for the form field.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

The MIME type of the file, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

The file name of the form field, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

The encoding of the value of data. Defaults to RAW if not defined.

+ *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(EncodingEnum encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/Offer.java b/src/main/java/com/merge/api/ats/types/Offer.java similarity index 97% rename from src/main/java/com/merge/api/resources/ats/types/Offer.java rename to src/main/java/com/merge/api/ats/types/Offer.java index 3354e8911..e056b7e46 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Offer.java +++ b/src/main/java/com/merge/api/ats/types/Offer.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -43,7 +43,7 @@ public final class Offer { private final Optional startDate; - private final Optional status; + private final Optional status; private final Optional remoteWasDeleted; @@ -64,7 +64,7 @@ private Offer( Optional closedAt, Optional sentAt, Optional startDate, - Optional status, + Optional status, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -178,7 +178,7 @@ public Optional getStartDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -278,7 +278,7 @@ public static final class Builder { private Optional startDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -420,12 +420,12 @@ public Builder startDate(OffsetDateTime startDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(OfferStatus status) { + public Builder status(OfferStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/OfferApplication.java b/src/main/java/com/merge/api/ats/types/OfferApplication.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/OfferApplication.java rename to src/main/java/com/merge/api/ats/types/OfferApplication.java index ecfec0c61..f5d3b0257 100644 --- a/src/main/java/com/merge/api/resources/ats/types/OfferApplication.java +++ b/src/main/java/com/merge/api/ats/types/OfferApplication.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public OfferApplication deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public OfferApplication deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/OfferCreator.java b/src/main/java/com/merge/api/ats/types/OfferCreator.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/OfferCreator.java rename to src/main/java/com/merge/api/ats/types/OfferCreator.java index 1d332b003..f4d653d84 100644 --- a/src/main/java/com/merge/api/resources/ats/types/OfferCreator.java +++ b/src/main/java/com/merge/api/ats/types/OfferCreator.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public OfferCreator deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public OfferCreator deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/OfferStatusEnum.java b/src/main/java/com/merge/api/ats/types/OfferStatusEnum.java similarity index 93% rename from src/main/java/com/merge/api/resources/ats/types/OfferStatusEnum.java rename to src/main/java/com/merge/api/ats/types/OfferStatusEnum.java index 837f3f8e6..e69db055f 100644 --- a/src/main/java/com/merge/api/resources/ats/types/OfferStatusEnum.java +++ b/src/main/java/com/merge/api/ats/types/OfferStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/offers/requests/OffersListRequest.java b/src/main/java/com/merge/api/ats/types/OffersListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/offers/requests/OffersListRequest.java rename to src/main/java/com/merge/api/ats/types/OffersListRequest.java index eccd03295..2309d8e6a 100644 --- a/src/main/java/com/merge/api/resources/ats/offers/requests/OffersListRequest.java +++ b/src/main/java/com/merge/api/ats/types/OffersListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.offers.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.offers.types.OffersListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = OffersListRequest.Builder.class) public final class OffersListRequest { + private final Optional> expand; + private final Optional applicationId; private final Optional createdAfter; @@ -32,8 +35,6 @@ public final class OffersListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -55,12 +56,12 @@ public final class OffersListRequest { private final Map additionalProperties; private OffersListRequest( + Optional> expand, Optional applicationId, Optional createdAfter, Optional createdBefore, Optional creatorId, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -71,12 +72,12 @@ private OffersListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.applicationId = applicationId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.creatorId = creatorId; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -89,6 +90,14 @@ private OffersListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return offers for this application. */ @@ -129,14 +138,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -221,12 +222,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(OffersListRequest other) { - return applicationId.equals(other.applicationId) + return expand.equals(other.expand) + && applicationId.equals(other.applicationId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && creatorId.equals(other.creatorId) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -241,12 +242,12 @@ private boolean equalTo(OffersListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.applicationId, this.createdAfter, this.createdBefore, this.creatorId, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -269,6 +270,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional applicationId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -279,8 +282,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -305,12 +306,12 @@ public static final class Builder { private Builder() {} public Builder from(OffersListRequest other) { + expand(other.getExpand()); applicationId(other.getApplicationId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); creatorId(other.getCreatorId()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -323,6 +324,22 @@ public Builder from(OffersListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(OffersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "application_id", nulls = Nulls.SKIP) public Builder applicationId(Optional applicationId) { this.applicationId = applicationId; @@ -378,17 +395,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(OffersListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -490,12 +496,12 @@ public Builder showEnumOrigins(String showEnumOrigins) { public OffersListRequest build() { return new OffersListRequest( + expand, applicationId, createdAfter, createdBefore, creatorId, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ats/types/OffersListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/OffersListRequestExpandItem.java new file mode 100644 index 000000000..7fbd047ca --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OffersListRequestExpandItem { + APPLICATION("application"), + + CREATOR("creator"); + + private final String value; + + OffersListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/OffersRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequest.java new file mode 100644 index 000000000..5c4f785f5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OffersRetrieveRequest.Builder.class) +public final class OffersRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private OffersRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OffersRetrieveRequest && equalTo((OffersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OffersRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OffersRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(OffersRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public OffersRetrieveRequest build() { + return new OffersRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestExpandItem.java new file mode 100644 index 000000000..6f5b6932a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OffersRetrieveRequestExpandItem { + APPLICATION("application"), + + CREATOR("creator"); + + private final String value; + + OffersRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/Office.java b/src/main/java/com/merge/api/ats/types/Office.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/Office.java rename to src/main/java/com/merge/api/ats/types/Office.java index 4726009fc..d3e9ff05c 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Office.java +++ b/src/main/java/com/merge/api/ats/types/Office.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/offices/requests/OfficesListRequest.java b/src/main/java/com/merge/api/ats/types/OfficesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/offices/requests/OfficesListRequest.java rename to src/main/java/com/merge/api/ats/types/OfficesListRequest.java index 9becaea16..73d6b5ded 100644 --- a/src/main/java/com/merge/api/resources/ats/offices/requests/OfficesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/OfficesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.offices.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/OfficesRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/OfficesRetrieveRequest.java new file mode 100644 index 000000000..832bff785 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OfficesRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OfficesRetrieveRequest.Builder.class) +public final class OfficesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private OfficesRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OfficesRetrieveRequest && equalTo((OfficesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(OfficesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OfficesRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public OfficesRetrieveRequest build() { + return new OfficesRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/OverallRecommendationEnum.java b/src/main/java/com/merge/api/ats/types/OverallRecommendationEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/ats/types/OverallRecommendationEnum.java rename to src/main/java/com/merge/api/ats/types/OverallRecommendationEnum.java index e3c7fbdf9..977eeca9f 100644 --- a/src/main/java/com/merge/api/resources/ats/types/OverallRecommendationEnum.java +++ b/src/main/java/com/merge/api/ats/types/OverallRecommendationEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/ats/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..bf2b08937 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedActivityList.java b/src/main/java/com/merge/api/ats/types/PaginatedActivityList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedActivityList.java rename to src/main/java/com/merge/api/ats/types/PaginatedActivityList.java index f5cf57455..04986ba09 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedActivityList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedActivityList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedApplicationList.java b/src/main/java/com/merge/api/ats/types/PaginatedApplicationList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedApplicationList.java rename to src/main/java/com/merge/api/ats/types/PaginatedApplicationList.java index 0f02d7fe4..d1ba81129 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedApplicationList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedApplicationList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedAttachmentList.java b/src/main/java/com/merge/api/ats/types/PaginatedAttachmentList.java new file mode 100644 index 000000000..15f08bbca --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PaginatedAttachmentList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAttachmentList.Builder.class) +public final class PaginatedAttachmentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAttachmentList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAttachmentList && equalTo((PaginatedAttachmentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAttachmentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAttachmentList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAttachmentList build() { + return new PaginatedAttachmentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/ats/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..3bb1d6c74 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedCandidateList.java b/src/main/java/com/merge/api/ats/types/PaginatedCandidateList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedCandidateList.java rename to src/main/java/com/merge/api/ats/types/PaginatedCandidateList.java index 72439949e..59a70a382 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedCandidateList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedCandidateList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedDepartmentList.java b/src/main/java/com/merge/api/ats/types/PaginatedDepartmentList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedDepartmentList.java rename to src/main/java/com/merge/api/ats/types/PaginatedDepartmentList.java index c15d4c9c5..dfddcec7e 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedDepartmentList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedDepartmentList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedEeocList.java b/src/main/java/com/merge/api/ats/types/PaginatedEeocList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedEeocList.java rename to src/main/java/com/merge/api/ats/types/PaginatedEeocList.java index c8b884655..cda0d3bf1 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedEeocList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedEeocList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedIssueList.java b/src/main/java/com/merge/api/ats/types/PaginatedIssueList.java new file mode 100644 index 000000000..272624016 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedJobInterviewStageList.java b/src/main/java/com/merge/api/ats/types/PaginatedJobInterviewStageList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedJobInterviewStageList.java rename to src/main/java/com/merge/api/ats/types/PaginatedJobInterviewStageList.java index d40786f0a..30bde6ae0 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedJobInterviewStageList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedJobInterviewStageList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedJobList.java b/src/main/java/com/merge/api/ats/types/PaginatedJobList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedJobList.java rename to src/main/java/com/merge/api/ats/types/PaginatedJobList.java index abb11b88d..65a2973b8 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedJobList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedJobList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedJobPostingList.java b/src/main/java/com/merge/api/ats/types/PaginatedJobPostingList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedJobPostingList.java rename to src/main/java/com/merge/api/ats/types/PaginatedJobPostingList.java index fc077863a..3feb7ee69 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedJobPostingList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedJobPostingList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedOfferList.java b/src/main/java/com/merge/api/ats/types/PaginatedOfferList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedOfferList.java rename to src/main/java/com/merge/api/ats/types/PaginatedOfferList.java index 237d1e987..ac648bb45 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedOfferList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedOfferList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedOfficeList.java b/src/main/java/com/merge/api/ats/types/PaginatedOfficeList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedOfficeList.java rename to src/main/java/com/merge/api/ats/types/PaginatedOfficeList.java index 06c743e71..b5140f1cc 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedOfficeList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedOfficeList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedRejectReasonList.java b/src/main/java/com/merge/api/ats/types/PaginatedRejectReasonList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedRejectReasonList.java rename to src/main/java/com/merge/api/ats/types/PaginatedRejectReasonList.java index dd478c003..cd3dc5429 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedRejectReasonList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedRejectReasonList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedRemoteUserList.java b/src/main/java/com/merge/api/ats/types/PaginatedRemoteUserList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedRemoteUserList.java rename to src/main/java/com/merge/api/ats/types/PaginatedRemoteUserList.java index cf1ae545f..6c18136e1 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedRemoteUserList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedRemoteUserList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedScheduledInterviewList.java b/src/main/java/com/merge/api/ats/types/PaginatedScheduledInterviewList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedScheduledInterviewList.java rename to src/main/java/com/merge/api/ats/types/PaginatedScheduledInterviewList.java index fe5803470..66489d1b4 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedScheduledInterviewList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedScheduledInterviewList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedScorecardList.java b/src/main/java/com/merge/api/ats/types/PaginatedScorecardList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedScorecardList.java rename to src/main/java/com/merge/api/ats/types/PaginatedScorecardList.java index ee14a24bf..cea5681d9 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedScorecardList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedScorecardList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedScreeningQuestionList.java b/src/main/java/com/merge/api/ats/types/PaginatedScreeningQuestionList.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PaginatedScreeningQuestionList.java rename to src/main/java/com/merge/api/ats/types/PaginatedScreeningQuestionList.java index c86fb25eb..83991e4f1 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedScreeningQuestionList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedScreeningQuestionList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/ats/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..b479353aa --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/PaginatedTagList.java b/src/main/java/com/merge/api/ats/types/PaginatedTagList.java new file mode 100644 index 000000000..9a3609cb4 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PaginatedTagList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTagList.Builder.class) +public final class PaginatedTagList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTagList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTagList && equalTo((PaginatedTagList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTagList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedTagList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedTagList build() { + return new PaginatedTagList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/candidates/requests/PatchedCandidateEndpointRequest.java b/src/main/java/com/merge/api/ats/types/PatchedCandidateEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/ats/candidates/requests/PatchedCandidateEndpointRequest.java rename to src/main/java/com/merge/api/ats/types/PatchedCandidateEndpointRequest.java index 87e9ef42f..03fe18e50 100644 --- a/src/main/java/com/merge/api/resources/ats/candidates/requests/PatchedCandidateEndpointRequest.java +++ b/src/main/java/com/merge/api/ats/types/PatchedCandidateEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.candidates.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.PatchedCandidateRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/ats/types/PatchedCandidateRequest.java b/src/main/java/com/merge/api/ats/types/PatchedCandidateRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/PatchedCandidateRequest.java rename to src/main/java/com/merge/api/ats/types/PatchedCandidateRequest.java index 7cdccc3bd..0236bd821 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PatchedCandidateRequest.java +++ b/src/main/java/com/merge/api/ats/types/PatchedCandidateRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/ats/types/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..2c6400d03 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PatchedEditFieldMappingRequest.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) +public final class PatchedEditFieldMappingRequest { + private final Optional> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Map additionalProperties) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + return this; + } + + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/PhoneNumber.java b/src/main/java/com/merge/api/ats/types/PhoneNumber.java new file mode 100644 index 000000000..27dece06a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PhoneNumber.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneNumber.Builder.class) +public final class PhoneNumber { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional value; + + private final Optional phoneNumberType; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private PhoneNumber( + Optional createdAt, + Optional modifiedAt, + Optional value, + Optional phoneNumberType, + Optional remoteWasDeleted, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.value = value; + this.phoneNumberType = phoneNumberType; + this.remoteWasDeleted = remoteWasDeleted; + this.additionalProperties = additionalProperties; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The phone number. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + /** + * @return The type of phone number. + *
    + *
  • HOME - HOME
  • + *
  • WORK - WORK
  • + *
  • MOBILE - MOBILE
  • + *
  • SKYPE - SKYPE
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("phone_number_type") + public Optional getPhoneNumberType() { + return phoneNumberType; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneNumber && equalTo((PhoneNumber) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneNumber other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && value.equals(other.value) + && phoneNumberType.equals(other.phoneNumberType) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.value, this.phoneNumberType, this.remoteWasDeleted); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional value = Optional.empty(); + + private Optional phoneNumberType = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneNumber other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + value(other.getValue()); + phoneNumberType(other.getPhoneNumberType()); + remoteWasDeleted(other.getRemoteWasDeleted()); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) + public Builder phoneNumberType(Optional phoneNumberType) { + this.phoneNumberType = phoneNumberType; + return this; + } + + public Builder phoneNumberType(PhoneNumberTypeEnum phoneNumberType) { + this.phoneNumberType = Optional.ofNullable(phoneNumberType); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + public PhoneNumber build() { + return new PhoneNumber( + createdAt, modifiedAt, value, phoneNumberType, remoteWasDeleted, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/PhoneNumberRequest.java b/src/main/java/com/merge/api/ats/types/PhoneNumberRequest.java new file mode 100644 index 000000000..04f02636a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/PhoneNumberRequest.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneNumberRequest.Builder.class) +public final class PhoneNumberRequest { + private final Optional value; + + private final Optional phoneNumberType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private PhoneNumberRequest( + Optional value, + Optional phoneNumberType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.value = value; + this.phoneNumberType = phoneNumberType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The phone number. + */ + @JsonProperty("value") + public Optional getValue() { + return value; + } + + /** + * @return The type of phone number. + *
    + *
  • HOME - HOME
  • + *
  • WORK - WORK
  • + *
  • MOBILE - MOBILE
  • + *
  • SKYPE - SKYPE
  • + *
  • OTHER - OTHER
  • + *
+ */ + @JsonProperty("phone_number_type") + public Optional getPhoneNumberType() { + return phoneNumberType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneNumberRequest && equalTo((PhoneNumberRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneNumberRequest other) { + return value.equals(other.value) + && phoneNumberType.equals(other.phoneNumberType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.phoneNumberType, this.integrationParams, this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional value = Optional.empty(); + + private Optional phoneNumberType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneNumberRequest other) { + value(other.getValue()); + phoneNumberType(other.getPhoneNumberType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(String value) { + this.value = Optional.ofNullable(value); + return this; + } + + @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) + public Builder phoneNumberType(Optional phoneNumberType) { + this.phoneNumberType = phoneNumberType; + return this; + } + + public Builder phoneNumberType(PhoneNumberTypeEnum phoneNumberType) { + this.phoneNumberType = Optional.ofNullable(phoneNumberType); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public PhoneNumberRequest build() { + return new PhoneNumberRequest( + value, phoneNumberType, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberTypeEnum.java b/src/main/java/com/merge/api/ats/types/PhoneNumberTypeEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/types/PhoneNumberTypeEnum.java rename to src/main/java/com/merge/api/ats/types/PhoneNumberTypeEnum.java index 9f96140e8..55416ffdf 100644 --- a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberTypeEnum.java +++ b/src/main/java/com/merge/api/ats/types/PhoneNumberTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/types/RaceEnum.java b/src/main/java/com/merge/api/ats/types/RaceEnum.java similarity index 94% rename from src/main/java/com/merge/api/resources/ats/types/RaceEnum.java rename to src/main/java/com/merge/api/ats/types/RaceEnum.java index e51a33d76..42e96a5e2 100644 --- a/src/main/java/com/merge/api/resources/ats/types/RaceEnum.java +++ b/src/main/java/com/merge/api/ats/types/RaceEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/ReasonEnum.java b/src/main/java/com/merge/api/ats/types/ReasonEnum.java new file mode 100644 index 000000000..97861747c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ReasonEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ReasonEnum { + GENERAL_CUSTOMER_REQUEST("GENERAL_CUSTOMER_REQUEST"), + + GDPR("GDPR"), + + OTHER("OTHER"); + + private final String value; + + ReasonEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/RejectReason.java b/src/main/java/com/merge/api/ats/types/RejectReason.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/RejectReason.java rename to src/main/java/com/merge/api/ats/types/RejectReason.java index f93c8c1f6..1dd86e0b5 100644 --- a/src/main/java/com/merge/api/resources/ats/types/RejectReason.java +++ b/src/main/java/com/merge/api/ats/types/RejectReason.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/rejectreasons/requests/RejectReasonsListRequest.java b/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/rejectreasons/requests/RejectReasonsListRequest.java rename to src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java index 7a6f3e5bd..4c6077728 100644 --- a/src/main/java/com/merge/api/resources/ats/rejectreasons/requests/RejectReasonsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.rejectreasons.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ats/types/RejectReasonsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/RejectReasonsRetrieveRequest.java new file mode 100644 index 000000000..22abe3083 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RejectReasonsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RejectReasonsRetrieveRequest.Builder.class) +public final class RejectReasonsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private RejectReasonsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RejectReasonsRetrieveRequest && equalTo((RejectReasonsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RejectReasonsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RejectReasonsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public RejectReasonsRetrieveRequest build() { + return new RejectReasonsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteData.java b/src/main/java/com/merge/api/ats/types/RemoteData.java new file mode 100644 index 000000000..29a9929b3 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteData.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

The third-party API path that is being called.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/ats/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..f24b1c7ae --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteEndpointInfo.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteFieldApi.java b/src/main/java/com/merge/api/ats/types/RemoteFieldApi.java new file mode 100644 index 000000000..a8066edf0 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteFieldApi.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/ats/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..c954a54e1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/ats/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..e033ffaef --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteFieldApiResponse.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> activity; + + private final Optional> application; + + private final Optional> attachment; + + private final Optional> candidate; + + private final Optional> department; + + private final Optional> eeoc; + + private final Optional> scheduledInterview; + + private final Optional> job; + + private final Optional> jobPosting; + + private final Optional> jobInterviewStage; + + private final Optional> offer; + + private final Optional> office; + + private final Optional> rejectReason; + + private final Optional> scorecard; + + private final Optional> tag; + + private final Optional> remoteUser; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> activity, + Optional> application, + Optional> attachment, + Optional> candidate, + Optional> department, + Optional> eeoc, + Optional> scheduledInterview, + Optional> job, + Optional> jobPosting, + Optional> jobInterviewStage, + Optional> offer, + Optional> office, + Optional> rejectReason, + Optional> scorecard, + Optional> tag, + Optional> remoteUser, + Map additionalProperties) { + this.activity = activity; + this.application = application; + this.attachment = attachment; + this.candidate = candidate; + this.department = department; + this.eeoc = eeoc; + this.scheduledInterview = scheduledInterview; + this.job = job; + this.jobPosting = jobPosting; + this.jobInterviewStage = jobInterviewStage; + this.offer = offer; + this.office = office; + this.rejectReason = rejectReason; + this.scorecard = scorecard; + this.tag = tag; + this.remoteUser = remoteUser; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Activity") + public Optional> getActivity() { + return activity; + } + + @JsonProperty("Application") + public Optional> getApplication() { + return application; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("Candidate") + public Optional> getCandidate() { + return candidate; + } + + @JsonProperty("Department") + public Optional> getDepartment() { + return department; + } + + @JsonProperty("EEOC") + public Optional> getEeoc() { + return eeoc; + } + + @JsonProperty("ScheduledInterview") + public Optional> getScheduledInterview() { + return scheduledInterview; + } + + @JsonProperty("Job") + public Optional> getJob() { + return job; + } + + @JsonProperty("JobPosting") + public Optional> getJobPosting() { + return jobPosting; + } + + @JsonProperty("JobInterviewStage") + public Optional> getJobInterviewStage() { + return jobInterviewStage; + } + + @JsonProperty("Offer") + public Optional> getOffer() { + return offer; + } + + @JsonProperty("Office") + public Optional> getOffice() { + return office; + } + + @JsonProperty("RejectReason") + public Optional> getRejectReason() { + return rejectReason; + } + + @JsonProperty("Scorecard") + public Optional> getScorecard() { + return scorecard; + } + + @JsonProperty("Tag") + public Optional> getTag() { + return tag; + } + + @JsonProperty("RemoteUser") + public Optional> getRemoteUser() { + return remoteUser; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return activity.equals(other.activity) + && application.equals(other.application) + && attachment.equals(other.attachment) + && candidate.equals(other.candidate) + && department.equals(other.department) + && eeoc.equals(other.eeoc) + && scheduledInterview.equals(other.scheduledInterview) + && job.equals(other.job) + && jobPosting.equals(other.jobPosting) + && jobInterviewStage.equals(other.jobInterviewStage) + && offer.equals(other.offer) + && office.equals(other.office) + && rejectReason.equals(other.rejectReason) + && scorecard.equals(other.scorecard) + && tag.equals(other.tag) + && remoteUser.equals(other.remoteUser); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.activity, + this.application, + this.attachment, + this.candidate, + this.department, + this.eeoc, + this.scheduledInterview, + this.job, + this.jobPosting, + this.jobInterviewStage, + this.offer, + this.office, + this.rejectReason, + this.scorecard, + this.tag, + this.remoteUser); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> activity = Optional.empty(); + + private Optional> application = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> candidate = Optional.empty(); + + private Optional> department = Optional.empty(); + + private Optional> eeoc = Optional.empty(); + + private Optional> scheduledInterview = Optional.empty(); + + private Optional> job = Optional.empty(); + + private Optional> jobPosting = Optional.empty(); + + private Optional> jobInterviewStage = Optional.empty(); + + private Optional> offer = Optional.empty(); + + private Optional> office = Optional.empty(); + + private Optional> rejectReason = Optional.empty(); + + private Optional> scorecard = Optional.empty(); + + private Optional> tag = Optional.empty(); + + private Optional> remoteUser = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + activity(other.getActivity()); + application(other.getApplication()); + attachment(other.getAttachment()); + candidate(other.getCandidate()); + department(other.getDepartment()); + eeoc(other.getEeoc()); + scheduledInterview(other.getScheduledInterview()); + job(other.getJob()); + jobPosting(other.getJobPosting()); + jobInterviewStage(other.getJobInterviewStage()); + offer(other.getOffer()); + office(other.getOffice()); + rejectReason(other.getRejectReason()); + scorecard(other.getScorecard()); + tag(other.getTag()); + remoteUser(other.getRemoteUser()); + return this; + } + + @JsonSetter(value = "Activity", nulls = Nulls.SKIP) + public Builder activity(Optional> activity) { + this.activity = activity; + return this; + } + + public Builder activity(List activity) { + this.activity = Optional.ofNullable(activity); + return this; + } + + @JsonSetter(value = "Application", nulls = Nulls.SKIP) + public Builder application(Optional> application) { + this.application = application; + return this; + } + + public Builder application(List application) { + this.application = Optional.ofNullable(application); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "Candidate", nulls = Nulls.SKIP) + public Builder candidate(Optional> candidate) { + this.candidate = candidate; + return this; + } + + public Builder candidate(List candidate) { + this.candidate = Optional.ofNullable(candidate); + return this; + } + + @JsonSetter(value = "Department", nulls = Nulls.SKIP) + public Builder department(Optional> department) { + this.department = department; + return this; + } + + public Builder department(List department) { + this.department = Optional.ofNullable(department); + return this; + } + + @JsonSetter(value = "EEOC", nulls = Nulls.SKIP) + public Builder eeoc(Optional> eeoc) { + this.eeoc = eeoc; + return this; + } + + public Builder eeoc(List eeoc) { + this.eeoc = Optional.ofNullable(eeoc); + return this; + } + + @JsonSetter(value = "ScheduledInterview", nulls = Nulls.SKIP) + public Builder scheduledInterview(Optional> scheduledInterview) { + this.scheduledInterview = scheduledInterview; + return this; + } + + public Builder scheduledInterview(List scheduledInterview) { + this.scheduledInterview = Optional.ofNullable(scheduledInterview); + return this; + } + + @JsonSetter(value = "Job", nulls = Nulls.SKIP) + public Builder job(Optional> job) { + this.job = job; + return this; + } + + public Builder job(List job) { + this.job = Optional.ofNullable(job); + return this; + } + + @JsonSetter(value = "JobPosting", nulls = Nulls.SKIP) + public Builder jobPosting(Optional> jobPosting) { + this.jobPosting = jobPosting; + return this; + } + + public Builder jobPosting(List jobPosting) { + this.jobPosting = Optional.ofNullable(jobPosting); + return this; + } + + @JsonSetter(value = "JobInterviewStage", nulls = Nulls.SKIP) + public Builder jobInterviewStage(Optional> jobInterviewStage) { + this.jobInterviewStage = jobInterviewStage; + return this; + } + + public Builder jobInterviewStage(List jobInterviewStage) { + this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); + return this; + } + + @JsonSetter(value = "Offer", nulls = Nulls.SKIP) + public Builder offer(Optional> offer) { + this.offer = offer; + return this; + } + + public Builder offer(List offer) { + this.offer = Optional.ofNullable(offer); + return this; + } + + @JsonSetter(value = "Office", nulls = Nulls.SKIP) + public Builder office(Optional> office) { + this.office = office; + return this; + } + + public Builder office(List office) { + this.office = Optional.ofNullable(office); + return this; + } + + @JsonSetter(value = "RejectReason", nulls = Nulls.SKIP) + public Builder rejectReason(Optional> rejectReason) { + this.rejectReason = rejectReason; + return this; + } + + public Builder rejectReason(List rejectReason) { + this.rejectReason = Optional.ofNullable(rejectReason); + return this; + } + + @JsonSetter(value = "Scorecard", nulls = Nulls.SKIP) + public Builder scorecard(Optional> scorecard) { + this.scorecard = scorecard; + return this; + } + + public Builder scorecard(List scorecard) { + this.scorecard = Optional.ofNullable(scorecard); + return this; + } + + @JsonSetter(value = "Tag", nulls = Nulls.SKIP) + public Builder tag(Optional> tag) { + this.tag = tag; + return this; + } + + public Builder tag(List tag) { + this.tag = Optional.ofNullable(tag); + return this; + } + + @JsonSetter(value = "RemoteUser", nulls = Nulls.SKIP) + public Builder remoteUser(Optional> remoteUser) { + this.remoteUser = remoteUser; + return this; + } + + public Builder remoteUser(List remoteUser) { + this.remoteUser = Optional.ofNullable(remoteUser); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse( + activity, + application, + attachment, + candidate, + department, + eeoc, + scheduledInterview, + job, + jobPosting, + jobInterviewStage, + offer, + office, + rejectReason, + scorecard, + tag, + remoteUser, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..85f5f72ec --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteKey.java b/src/main/java/com/merge/api/ats/types/RemoteKey.java new file mode 100644 index 000000000..4dd1c6720 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/ats/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..194d5b050 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RemoteResponse.java b/src/main/java/com/merge/api/ats/types/RemoteResponse.java new file mode 100644 index 000000000..3071e1a0d --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(ResponseTypeEnum responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteUser.java b/src/main/java/com/merge/api/ats/types/RemoteUser.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/RemoteUser.java rename to src/main/java/com/merge/api/ats/types/RemoteUser.java index 3d4c66f3c..9c1268649 100644 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteUser.java +++ b/src/main/java/com/merge/api/ats/types/RemoteUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -41,7 +41,7 @@ public final class RemoteUser { private final Optional remoteCreatedAt; - private final Optional accessRole; + private final Optional accessRole; private final Optional remoteWasDeleted; @@ -61,7 +61,7 @@ private RemoteUser( Optional email, Optional disabled, Optional remoteCreatedAt, - Optional accessRole, + Optional accessRole, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -162,7 +162,7 @@ public Optional getRemoteCreatedAt() { * */ @JsonProperty("access_role") - public Optional getAccessRole() { + public Optional getAccessRole() { return accessRole; } @@ -258,7 +258,7 @@ public static final class Builder { private Optional remoteCreatedAt = Optional.empty(); - private Optional accessRole = Optional.empty(); + private Optional accessRole = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -388,12 +388,12 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { } @JsonSetter(value = "access_role", nulls = Nulls.SKIP) - public Builder accessRole(Optional accessRole) { + public Builder accessRole(Optional accessRole) { this.accessRole = accessRole; return this; } - public Builder accessRole(RemoteUserAccessRole accessRole) { + public Builder accessRole(AccessRoleEnum accessRole) { this.accessRole = Optional.ofNullable(accessRole); return this; } diff --git a/src/main/java/com/merge/api/ats/types/RequestFormatEnum.java b/src/main/java/com/merge/api/ats/types/RequestFormatEnum.java new file mode 100644 index 000000000..c07c587ca --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RequestFormatEnum { + JSON("JSON"), + + XML("XML"), + + MULTIPART("MULTIPART"); + + private final String value; + + RequestFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/ats/types/ResponseTypeEnum.java new file mode 100644 index 000000000..aac158db2 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ResponseTypeEnum { + JSON("JSON"), + + BASE_64_GZIP("BASE64_GZIP"); + + private final String value; + + ResponseTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/RoleEnum.java b/src/main/java/com/merge/api/ats/types/RoleEnum.java new file mode 100644 index 000000000..c0193425e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RoleEnum { + ADMIN("ADMIN"), + + DEVELOPER("DEVELOPER"), + + MEMBER("MEMBER"), + + API("API"), + + SYSTEM("SYSTEM"), + + MERGE_TEAM("MERGE_TEAM"); + + private final String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterview.java b/src/main/java/com/merge/api/ats/types/ScheduledInterview.java similarity index 97% rename from src/main/java/com/merge/api/resources/ats/types/ScheduledInterview.java rename to src/main/java/com/merge/api/ats/types/ScheduledInterview.java index eea16eba9..1c2c1d0e3 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterview.java +++ b/src/main/java/com/merge/api/ats/types/ScheduledInterview.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -49,7 +49,7 @@ public final class ScheduledInterview { private final Optional remoteUpdatedAt; - private final Optional status; + private final Optional status; private final Optional remoteWasDeleted; @@ -73,7 +73,7 @@ private ScheduledInterview( Optional endAt, Optional remoteCreatedAt, Optional remoteUpdatedAt, - Optional status, + Optional status, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -208,7 +208,7 @@ public Optional getRemoteUpdatedAt() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -320,7 +320,7 @@ public static final class Builder { private Optional remoteUpdatedAt = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -498,12 +498,12 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(ScheduledInterviewStatus status) { + public Builder status(ScheduledInterviewStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewApplication.java b/src/main/java/com/merge/api/ats/types/ScheduledInterviewApplication.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewApplication.java rename to src/main/java/com/merge/api/ats/types/ScheduledInterviewApplication.java index 7395af595..097b71ce5 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewApplication.java +++ b/src/main/java/com/merge/api/ats/types/ScheduledInterviewApplication.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer endAt; - private final Optional status; + private final Optional status; private final Optional> integrationParams; @@ -53,7 +53,7 @@ private ScheduledInterviewRequest( Optional location, Optional startAt, Optional endAt, - Optional status, + Optional status, Optional> integrationParams, Optional> linkedAccountParams, Map additionalProperties) { @@ -135,7 +135,7 @@ public Optional getEndAt() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -213,7 +213,7 @@ public static final class Builder { private Optional endAt = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -316,12 +316,12 @@ public Builder endAt(OffsetDateTime endAt) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(ScheduledInterviewRequestStatus status) { + public Builder status(ScheduledInterviewStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewRequestApplication.java b/src/main/java/com/merge/api/ats/types/ScheduledInterviewRequestApplication.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewRequestApplication.java rename to src/main/java/com/merge/api/ats/types/ScheduledInterviewRequestApplication.java index b3494ecc0..e9f9aad05 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewRequestApplication.java +++ b/src/main/java/com/merge/api/ats/types/ScheduledInterviewRequestApplication.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer submittedAt; - private final Optional overallRecommendation; + private final Optional overallRecommendation; private final Optional remoteWasDeleted; @@ -61,7 +61,7 @@ private Scorecard( Optional interviewer, Optional remoteCreatedAt, Optional submittedAt, - Optional overallRecommendation, + Optional overallRecommendation, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -162,7 +162,7 @@ public Optional getSubmittedAt() { * */ @JsonProperty("overall_recommendation") - public Optional getOverallRecommendation() { + public Optional getOverallRecommendation() { return overallRecommendation; } @@ -258,7 +258,7 @@ public static final class Builder { private Optional submittedAt = Optional.empty(); - private Optional overallRecommendation = Optional.empty(); + private Optional overallRecommendation = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -388,12 +388,12 @@ public Builder submittedAt(OffsetDateTime submittedAt) { } @JsonSetter(value = "overall_recommendation", nulls = Nulls.SKIP) - public Builder overallRecommendation(Optional overallRecommendation) { + public Builder overallRecommendation(Optional overallRecommendation) { this.overallRecommendation = overallRecommendation; return this; } - public Builder overallRecommendation(ScorecardOverallRecommendation overallRecommendation) { + public Builder overallRecommendation(OverallRecommendationEnum overallRecommendation) { this.overallRecommendation = Optional.ofNullable(overallRecommendation); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/ScorecardApplication.java b/src/main/java/com/merge/api/ats/types/ScorecardApplication.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ScorecardApplication.java rename to src/main/java/com/merge/api/ats/types/ScorecardApplication.java index 1c6529a27..f7306b5ba 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScorecardApplication.java +++ b/src/main/java/com/merge/api/ats/types/ScorecardApplication.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ScorecardApplication deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ScorecardApplication deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ScorecardInterview.java b/src/main/java/com/merge/api/ats/types/ScorecardInterview.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/ScorecardInterview.java rename to src/main/java/com/merge/api/ats/types/ScorecardInterview.java index a6aa1cabb..43e081756 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScorecardInterview.java +++ b/src/main/java/com/merge/api/ats/types/ScorecardInterview.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ScorecardInterview deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ScorecardInterview deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ScorecardInterviewer.java b/src/main/java/com/merge/api/ats/types/ScorecardInterviewer.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/types/ScorecardInterviewer.java rename to src/main/java/com/merge/api/ats/types/ScorecardInterviewer.java index f798cda8a..b08328355 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScorecardInterviewer.java +++ b/src/main/java/com/merge/api/ats/types/ScorecardInterviewer.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ScorecardInterviewer deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ScorecardInterviewer deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/scorecards/requests/ScorecardsListRequest.java b/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/ats/scorecards/requests/ScorecardsListRequest.java rename to src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java index 1fad8955e..4eb0e3bb4 100644 --- a/src/main/java/com/merge/api/resources/ats/scorecards/requests/ScorecardsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.scorecards.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.scorecards.types.ScorecardsListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ScorecardsListRequest.Builder.class) public final class ScorecardsListRequest { + private final Optional> expand; + private final Optional applicationId; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class ScorecardsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -57,11 +58,11 @@ public final class ScorecardsListRequest { private final Map additionalProperties; private ScorecardsListRequest( + Optional> expand, Optional applicationId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -74,11 +75,11 @@ private ScorecardsListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.applicationId = applicationId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -93,6 +94,14 @@ private ScorecardsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return scorecards for this application. */ @@ -125,14 +134,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -233,11 +234,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(ScorecardsListRequest other) { - return applicationId.equals(other.applicationId) + return expand.equals(other.expand) + && applicationId.equals(other.applicationId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -254,11 +255,11 @@ private boolean equalTo(ScorecardsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.applicationId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -283,6 +284,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional applicationId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -291,8 +294,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -321,11 +322,11 @@ public static final class Builder { private Builder() {} public Builder from(ScorecardsListRequest other) { + expand(other.getExpand()); applicationId(other.getApplicationId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -340,6 +341,22 @@ public Builder from(ScorecardsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ScorecardsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "application_id", nulls = Nulls.SKIP) public Builder applicationId(Optional applicationId) { this.applicationId = applicationId; @@ -384,17 +401,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ScorecardsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -518,11 +524,11 @@ public Builder showEnumOrigins(String showEnumOrigins) { public ScorecardsListRequest build() { return new ScorecardsListRequest( + expand, applicationId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/ScorecardsListRequestExpandItem.java new file mode 100644 index 000000000..96550ae0a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScorecardsListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ScorecardsListRequestExpandItem { + APPLICATION("application"), + + INTERVIEW("interview"), + + INTERVIEWER("interviewer"); + + private final String value; + + ScorecardsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequest.java new file mode 100644 index 000000000..b011805ce --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScorecardsRetrieveRequest.Builder.class) +public final class ScorecardsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private ScorecardsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScorecardsRetrieveRequest && equalTo((ScorecardsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScorecardsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ScorecardsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ScorecardsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public ScorecardsRetrieveRequest build() { + return new ScorecardsRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..86ddb339e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ScorecardsRetrieveRequestExpandItem { + APPLICATION("application"), + + INTERVIEW("interview"), + + INTERVIEWER("interviewer"); + + private final String value; + + ScorecardsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestion.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/ScreeningQuestion.java rename to src/main/java/com/merge/api/ats/types/ScreeningQuestion.java index 2cd291d1f..1a16baf8f 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestion.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,7 +37,7 @@ public final class ScreeningQuestion { private final Optional title; - private final Optional type; + private final Optional type; private final Optional required; @@ -55,7 +55,7 @@ private ScreeningQuestion( Optional job, Optional description, Optional title, - Optional type, + Optional type, Optional required, Optional> options, Optional remoteWasDeleted, @@ -141,7 +141,7 @@ public Optional getTitle() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -232,7 +232,7 @@ public static final class Builder { private Optional title = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional required = Optional.empty(); @@ -338,12 +338,12 @@ public Builder title(String title) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(ScreeningQuestionType type) { + public Builder type(ScreeningQuestionTypeEnum type) { this.type = Optional.ofNullable(type); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionAnswer.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswer.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionAnswer.java rename to src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswer.java index 3f9725df1..570692942 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionAnswer.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswer.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionAnswerQuestion.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswerQuestion.java similarity index 96% rename from src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionAnswerQuestion.java rename to src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswerQuestion.java index aa24d5a2e..5e8a3c67d 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionAnswerQuestion.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswerQuestion.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -79,7 +80,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ScreeningQuestionJob deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ScreeningQuestionJob deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionOption.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionOption.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionOption.java rename to src/main/java/com/merge/api/ats/types/ScreeningQuestionOption.java index 9aff784ca..d6288f79c 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionOption.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionOption.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionTypeEnum.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionTypeEnum.java similarity index 93% rename from src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionTypeEnum.java rename to src/main/java/com/merge/api/ats/types/ScreeningQuestionTypeEnum.java index f6b1a3d89..30ad5ad70 100644 --- a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionTypeEnum.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/ats/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..22a435b9c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SelectiveSyncConfigurationsUsageEnum { + IN_NEXT_SYNC("IN_NEXT_SYNC"), + + IN_LAST_SYNC("IN_LAST_SYNC"); + + private final String value; + + SelectiveSyncConfigurationsUsageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/StatusFd5Enum.java b/src/main/java/com/merge/api/ats/types/StatusFd5Enum.java new file mode 100644 index 000000000..605a618e7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/StatusFd5Enum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum StatusFd5Enum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + StatusFd5Enum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ats/types/SyncStatus.java b/src/main/java/com/merge/api/ats/types/SyncStatus.java new file mode 100644 index 000000000..386878307 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final StatusFd5Enum status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + StatusFd5Enum status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public StatusFd5Enum getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull StatusFd5Enum status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private StatusFd5Enum status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull StatusFd5Enum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/ats/types/SyncStatusListRequest.java new file mode 100644 index 000000000..ec23b632b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/SyncStatusListRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/Tag.java b/src/main/java/com/merge/api/ats/types/Tag.java new file mode 100644 index 000000000..75a7bca5e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/Tag.java @@ -0,0 +1,274 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Tag.Builder.class) +public final class Tag { + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional>>> remoteData; + + private final Map additionalProperties; + + private Tag( + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional>>> remoteData, + Map additionalProperties) { + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The tag's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional>>> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Tag && equalTo((Tag) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Tag other) { + return remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional>>> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Tag other) { + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional>>> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List>> remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Tag build() { + return new Tag( + remoteId, + createdAt, + modifiedAt, + name, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/TagsListRequest.java b/src/main/java/com/merge/api/ats/types/TagsListRequest.java new file mode 100644 index 000000000..db5f04315 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/TagsListRequest.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TagsListRequest.Builder.class) +public final class TagsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private TagsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TagsListRequest && equalTo((TagsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TagsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TagsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public TagsListRequest build() { + return new TagsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/applications/requests/UpdateApplicationStageRequest.java b/src/main/java/com/merge/api/ats/types/UpdateApplicationStageRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ats/applications/requests/UpdateApplicationStageRequest.java rename to src/main/java/com/merge/api/ats/types/UpdateApplicationStageRequest.java index 33a51f4d2..7430fc157 100644 --- a/src/main/java/com/merge/api/resources/ats/applications/requests/UpdateApplicationStageRequest.java +++ b/src/main/java/com/merge/api/ats/types/UpdateApplicationStageRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.applications.requests; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ats/types/Url.java b/src/main/java/com/merge/api/ats/types/Url.java similarity index 94% rename from src/main/java/com/merge/api/resources/ats/types/Url.java rename to src/main/java/com/merge/api/ats/types/Url.java index bea0053c6..90eac4536 100644 --- a/src/main/java/com/merge/api/resources/ats/types/Url.java +++ b/src/main/java/com/merge/api/ats/types/Url.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -27,7 +27,7 @@ public final class Url { private final Optional value; - private final Optional urlType; + private final Optional urlType; private final Optional remoteWasDeleted; @@ -37,7 +37,7 @@ private Url( Optional createdAt, Optional modifiedAt, Optional value, - Optional urlType, + Optional urlType, Optional remoteWasDeleted, Map additionalProperties) { this.createdAt = createdAt; @@ -85,7 +85,7 @@ public Optional getValue() { * */ @JsonProperty("url_type") - public Optional getUrlType() { + public Optional getUrlType() { return urlType; } @@ -138,7 +138,7 @@ public static final class Builder { private Optional value = Optional.empty(); - private Optional urlType = Optional.empty(); + private Optional urlType = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -190,12 +190,12 @@ public Builder value(String value) { } @JsonSetter(value = "url_type", nulls = Nulls.SKIP) - public Builder urlType(Optional urlType) { + public Builder urlType(Optional urlType) { this.urlType = urlType; return this; } - public Builder urlType(UrlUrlType urlType) { + public Builder urlType(UrlTypeEnum urlType) { this.urlType = Optional.ofNullable(urlType); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/UrlRequest.java b/src/main/java/com/merge/api/ats/types/UrlRequest.java similarity index 93% rename from src/main/java/com/merge/api/resources/ats/types/UrlRequest.java rename to src/main/java/com/merge/api/ats/types/UrlRequest.java index ac99f53ed..443403e68 100644 --- a/src/main/java/com/merge/api/resources/ats/types/UrlRequest.java +++ b/src/main/java/com/merge/api/ats/types/UrlRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -23,7 +23,7 @@ public final class UrlRequest { private final Optional value; - private final Optional urlType; + private final Optional urlType; private final Optional> integrationParams; @@ -33,7 +33,7 @@ public final class UrlRequest { private UrlRequest( Optional value, - Optional urlType, + Optional urlType, Optional> integrationParams, Optional> linkedAccountParams, Map additionalProperties) { @@ -65,7 +65,7 @@ public Optional getValue() { * */ @JsonProperty("url_type") - public Optional getUrlType() { + public Optional getUrlType() { return urlType; } @@ -115,7 +115,7 @@ public static Builder builder() { public static final class Builder { private Optional value = Optional.empty(); - private Optional urlType = Optional.empty(); + private Optional urlType = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -146,12 +146,12 @@ public Builder value(String value) { } @JsonSetter(value = "url_type", nulls = Nulls.SKIP) - public Builder urlType(Optional urlType) { + public Builder urlType(Optional urlType) { this.urlType = urlType; return this; } - public Builder urlType(UrlRequestUrlType urlType) { + public Builder urlType(UrlTypeEnum urlType) { this.urlType = Optional.ofNullable(urlType); return this; } diff --git a/src/main/java/com/merge/api/resources/ats/types/UrlTypeEnum.java b/src/main/java/com/merge/api/ats/types/UrlTypeEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/ats/types/UrlTypeEnum.java rename to src/main/java/com/merge/api/ats/types/UrlTypeEnum.java index 6e36d5a0a..8f535a42e 100644 --- a/src/main/java/com/merge/api/resources/ats/types/UrlTypeEnum.java +++ b/src/main/java/com/merge/api/ats/types/UrlTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/UsersListRequest.java b/src/main/java/com/merge/api/ats/types/UsersListRequest.java new file mode 100644 index 000000000..1e3bf2a1c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/UsersListRequest.java @@ -0,0 +1,452 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersListRequest.Builder.class) +public final class UsersListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional email; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private UsersListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional email, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.email = email; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return remote users with the given email address + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListRequest && equalTo((UsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && email.equals(other.email) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.email, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + email(other.getEmail()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public UsersListRequest build() { + return new UsersListRequest( + createdAfter, + createdBefore, + cursor, + email, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/UsersRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequest.java new file mode 100644 index 000000000..13f850c3c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequest.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) +public final class UsersRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private UsersRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public UsersRetrieveRequest build() { + return new UsersRetrieveRequest( + includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/ValidationProblemSource.java b/src/main/java/com/merge/api/ats/types/ValidationProblemSource.java new file mode 100644 index 000000000..ef6fd6201 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ValidationProblemSource.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ValidationProblemSource.Builder.class) +public final class ValidationProblemSource { + private final String pointer; + + private final Map additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ats/types/VeteranStatusEnum.java b/src/main/java/com/merge/api/ats/types/VeteranStatusEnum.java similarity index 93% rename from src/main/java/com/merge/api/resources/ats/types/VeteranStatusEnum.java rename to src/main/java/com/merge/api/ats/types/VeteranStatusEnum.java index a66e0d774..803a8b273 100644 --- a/src/main/java/com/merge/api/resources/ats/types/VeteranStatusEnum.java +++ b/src/main/java/com/merge/api/ats/types/VeteranStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ats/types/VisibilityEnum.java b/src/main/java/com/merge/api/ats/types/VisibilityEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/ats/types/VisibilityEnum.java rename to src/main/java/com/merge/api/ats/types/VisibilityEnum.java index 05ebada6c..5654b8ebf 100644 --- a/src/main/java/com/merge/api/resources/ats/types/VisibilityEnum.java +++ b/src/main/java/com/merge/api/ats/types/VisibilityEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ats.types; +package com.merge.api.ats.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ats/types/WarningValidationProblem.java b/src/main/java/com/merge/api/ats/types/WarningValidationProblem.java new file mode 100644 index 000000000..1c479c7f6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/WarningValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/WebhookReceiver.java b/src/main/java/com/merge/api/ats/types/WebhookReceiver.java new file mode 100644 index 000000000..72900e503 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/ats/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..86416c50d --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/core/ApiError.java b/src/main/java/com/merge/api/core/ApiError.java index f3c2fd4a6..355ccf22a 100644 --- a/src/main/java/com/merge/api/core/ApiError.java +++ b/src/main/java/com/merge/api/core/ApiError.java @@ -3,6 +3,12 @@ */ package com.merge.api.core; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.Response; + /** * This exception type will be thrown for any non-2XX API responses. */ @@ -17,10 +23,25 @@ public class ApiError extends MergeException { */ private final Object body; + private final Map> headers; + public ApiError(String message, int statusCode, Object body) { super(message); this.statusCode = statusCode; this.body = body; + this.headers = new HashMap<>(); + } + + public ApiError(String message, int statusCode, Object body, Response rawResponse) { + super(message); + this.statusCode = statusCode; + this.body = body; + this.headers = new HashMap<>(); + rawResponse.headers().forEach(header -> { + String key = header.component1(); + String value = header.component2(); + this.headers.computeIfAbsent(key, _str -> new ArrayList<>()).add(value); + }); } /** @@ -37,6 +58,13 @@ public Object body() { return this.body; } + /** + * @return the headers + */ + public Map> headers() { + return this.headers; + } + @java.lang.Override public String toString() { return "ApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}"; diff --git a/src/main/java/com/merge/api/core/BasePage.java b/src/main/java/com/merge/api/core/BasePage.java new file mode 100644 index 000000000..2cbc98940 --- /dev/null +++ b/src/main/java/com/merge/api/core/BasePage.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.util.List; + +public abstract class BasePage { + private final boolean hasNext; + private final List items; + + public BasePage(boolean hasNext, List items) { + this.hasNext = hasNext; + this.items = items; + } + + public boolean hasNext() { + return !items.isEmpty() && hasNext; + } + + public List getItems() { + return items; + } +} diff --git a/src/main/java/com/merge/api/core/ClientOptions.java b/src/main/java/com/merge/api/core/ClientOptions.java index e200130e0..448cbf418 100644 --- a/src/main/java/com/merge/api/core/ClientOptions.java +++ b/src/main/java/com/merge/api/core/ClientOptions.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import okhttp3.OkHttpClient; @@ -31,9 +32,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { + put("User-Agent", "dev.merge:merge-java-client/2.0.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.merge.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.1.1"); + put("X-Fern-SDK-Version", "2.0.0"); } }); this.headerSuppliers = headerSuppliers; @@ -56,6 +58,13 @@ public Map headers(RequestOptions requestOptions) { return values; } + public int timeout(RequestOptions requestOptions) { + if (requestOptions == null) { + return this.timeout; + } + return requestOptions.getTimeout().orElse(this.timeout); + } + public OkHttpClient httpClient() { return this.httpClient; } @@ -84,7 +93,11 @@ public static final class Builder { private final Map> headerSuppliers = new HashMap<>(); - private int timeout = 60; + private int maxRetries = 2; + + private Optional timeout = Optional.empty(); + + private OkHttpClient httpClient = null; public Builder environment(Environment environment) { this.environment = environment; @@ -105,16 +118,54 @@ public Builder addHeader(String key, Supplier value) { * Override the timeout in seconds. Defaults to 60 seconds. */ public Builder timeout(int timeout) { + this.timeout = Optional.of(timeout); + return this; + } + + /** + * Override the timeout in seconds. Defaults to 60 seconds. + */ + public Builder timeout(Optional timeout) { this.timeout = timeout; return this; } + /** + * Override the maximum number of retries. Defaults to 2 retries. + */ + public Builder maxRetries(int maxRetries) { + this.maxRetries = maxRetries; + return this; + } + + public Builder httpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + public ClientOptions build() { - OkHttpClient okhttpClient = new OkHttpClient.Builder() - .addInterceptor(new RetryInterceptor(3)) - .callTimeout(this.timeout, TimeUnit.SECONDS) - .build(); - return new ClientOptions(environment, headers, headerSuppliers, okhttpClient, this.timeout); + OkHttpClient.Builder httpClientBuilder = + this.httpClient != null ? this.httpClient.newBuilder() : new OkHttpClient.Builder(); + + if (this.httpClient != null) { + timeout.ifPresent(timeout -> httpClientBuilder + .callTimeout(timeout, TimeUnit.SECONDS) + .connectTimeout(0, TimeUnit.SECONDS) + .writeTimeout(0, TimeUnit.SECONDS) + .readTimeout(0, TimeUnit.SECONDS)); + } else { + httpClientBuilder + .callTimeout(this.timeout.orElse(60), TimeUnit.SECONDS) + .connectTimeout(0, TimeUnit.SECONDS) + .writeTimeout(0, TimeUnit.SECONDS) + .readTimeout(0, TimeUnit.SECONDS) + .addInterceptor(new RetryInterceptor(this.maxRetries)); + } + + this.httpClient = httpClientBuilder.build(); + this.timeout = Optional.of(httpClient.callTimeoutMillis() / 1000); + + return new ClientOptions(environment, headers, headerSuppliers, httpClient, this.timeout.get()); } } } diff --git a/src/main/java/com/merge/api/core/Environment.java b/src/main/java/com/merge/api/core/Environment.java index 4c341119a..f5fd7e618 100644 --- a/src/main/java/com/merge/api/core/Environment.java +++ b/src/main/java/com/merge/api/core/Environment.java @@ -6,21 +6,13 @@ public final class Environment { public static final Environment PRODUCTION = new Environment("https://api.merge.dev/api"); - public static final Environment SANDBOX = new Environment("https://api-sandbox.merge.dev/api"); + private final String api; - public static final Environment PRODUCTION_EU = new Environment("https://api-eu.merge.dev/api"); - - private final String url; - - private Environment(String url) { - this.url = url; - } - - public String getUrl() { - return this.url; + Environment(String api) { + this.api = api; } - public static Environment custom(String url) { - return new Environment(url); + public String getApiURL() { + return this.api; } } diff --git a/src/main/java/com/merge/api/core/MergeApiHttpResponse.java b/src/main/java/com/merge/api/core/MergeApiHttpResponse.java new file mode 100644 index 000000000..bab13617e --- /dev/null +++ b/src/main/java/com/merge/api/core/MergeApiHttpResponse.java @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.Response; + +public final class MergeApiHttpResponse { + + private final T body; + + private final Map> headers; + + public MergeApiHttpResponse(T body, Response rawResponse) { + this.body = body; + + Map> headers = new HashMap<>(); + rawResponse.headers().forEach(header -> { + String key = header.component1(); + String value = header.component2(); + headers.computeIfAbsent(key, _str -> new ArrayList<>()).add(value); + }); + this.headers = headers; + } + + public T body() { + return this.body; + } + + public Map> headers() { + return headers; + } +} diff --git a/src/main/java/com/merge/api/core/Nullable.java b/src/main/java/com/merge/api/core/Nullable.java new file mode 100644 index 000000000..1a9724c30 --- /dev/null +++ b/src/main/java/com/merge/api/core/Nullable.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.util.Optional; +import java.util.function.Function; + +public final class Nullable { + + private final Either, Null> value; + + private Nullable() { + this.value = Either.left(Optional.empty()); + } + + private Nullable(T value) { + if (value == null) { + this.value = Either.right(Null.INSTANCE); + } else { + this.value = Either.left(Optional.of(value)); + } + } + + public static Nullable ofNull() { + return new Nullable<>(null); + } + + public static Nullable of(T value) { + return new Nullable<>(value); + } + + public static Nullable empty() { + return new Nullable<>(); + } + + public static Nullable ofOptional(Optional value) { + if (value.isPresent()) { + return of(value.get()); + } else { + return empty(); + } + } + + public boolean isNull() { + return this.value.isRight(); + } + + public boolean isEmpty() { + return this.value.isLeft() && !this.value.getLeft().isPresent(); + } + + public T get() { + if (this.isNull()) { + return null; + } + + return this.value.getLeft().get(); + } + + public Nullable map(Function mapper) { + if (this.isNull()) { + return Nullable.ofNull(); + } + + return Nullable.ofOptional(this.value.getLeft().map(mapper)); + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof Nullable)) { + return false; + } + + if (((Nullable) other).isNull() && this.isNull()) { + return true; + } + + return this.value.getLeft().equals(((Nullable) other).value.getLeft()); + } + + private static final class Either { + private L left = null; + private R right = null; + + private Either(L left, R right) { + if (left != null && right != null) { + throw new IllegalArgumentException("Left and right argument cannot both be non-null."); + } + + if (left == null && right == null) { + throw new IllegalArgumentException("Left and right argument cannot both be null."); + } + + if (left != null) { + this.left = left; + } + + if (right != null) { + this.right = right; + } + } + + public static Either left(L left) { + return new Either<>(left, null); + } + + public static Either right(R right) { + return new Either<>(null, right); + } + + public boolean isLeft() { + return this.left != null; + } + + public boolean isRight() { + return this.right != null; + } + + public L getLeft() { + if (!this.isLeft()) { + throw new IllegalArgumentException("Cannot get left from right Either."); + } + return this.left; + } + + public R getRight() { + if (!this.isRight()) { + throw new IllegalArgumentException("Cannot get right from left Either."); + } + return this.right; + } + } + + private static final class Null { + private static final Null INSTANCE = new Null(); + + private Null() {} + } +} diff --git a/src/main/java/com/merge/api/core/NullableNonemptyFilter.java b/src/main/java/com/merge/api/core/NullableNonemptyFilter.java new file mode 100644 index 000000000..493a1abee --- /dev/null +++ b/src/main/java/com/merge/api/core/NullableNonemptyFilter.java @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.util.Optional; + +public final class NullableNonemptyFilter { + @Override + public boolean equals(Object o) { + boolean isOptionalEmpty = isOptionalEmpty(o); + + return isOptionalEmpty; + } + + private boolean isOptionalEmpty(Object o) { + return o instanceof Optional && !((Optional) o).isPresent(); + } +} diff --git a/src/main/java/com/merge/api/core/QueryStringMapper.java b/src/main/java/com/merge/api/core/QueryStringMapper.java new file mode 100644 index 000000000..090176d1f --- /dev/null +++ b/src/main/java/com/merge/api/core/QueryStringMapper.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import okhttp3.HttpUrl; +import okhttp3.MultipartBody; + +public class QueryStringMapper { + + private static final ObjectMapper MAPPER = ObjectMappers.JSON_MAPPER; + + public static void addQueryParameter(HttpUrl.Builder httpUrl, String key, Object value, boolean arraysAsRepeats) { + JsonNode valueNode = MAPPER.valueToTree(value); + + // In cases where valueNode is a list of strings, we want to return a comma separated string + if (key.equals("expand")) { + String commaSeparatedQueryParams = ""; + + if (valueNode.isArray()) { + List values = new ArrayList<>(); + for (JsonNode node : valueNode) { + values.add(node.asText()); + } + commaSeparatedQueryParams = String.join(",", values); + } else if (value instanceof String) { + String text = ((String) value).trim(); + if (text.startsWith("[") && text.endsWith("]")) { + commaSeparatedQueryParams = text.replace("[", "").replace("]", "").replace(", ", ","); + } + } + + if (commaSeparatedQueryParams.length() > 0) { + httpUrl.addQueryParameter(key, commaSeparatedQueryParams); + return; + } + } + + List> flat; + if (valueNode.isObject()) { + flat = flattenObject((ObjectNode) valueNode, arraysAsRepeats); + } else if (valueNode.isArray()) { + flat = flattenArray((ArrayNode) valueNode, "", arraysAsRepeats); + } else { + if (valueNode.isTextual()) { + httpUrl.addQueryParameter(key, valueNode.textValue()); + } else { + httpUrl.addQueryParameter(key, valueNode.toString()); + } + return; + } + + for (Map.Entry field : flat) { + if (field.getValue().isTextual()) { + httpUrl.addQueryParameter(key + field.getKey(), field.getValue().textValue()); + } else { + httpUrl.addQueryParameter(key + field.getKey(), field.getValue().toString()); + } + } + } + + public static void addFormDataPart( + MultipartBody.Builder multipartBody, String key, Object value, boolean arraysAsRepeats) { + JsonNode valueNode = MAPPER.valueToTree(value); + + List> flat; + if (valueNode.isObject()) { + flat = flattenObject((ObjectNode) valueNode, arraysAsRepeats); + } else if (valueNode.isArray()) { + flat = flattenArray((ArrayNode) valueNode, "", arraysAsRepeats); + } else { + if (valueNode.isTextual()) { + multipartBody.addFormDataPart(key, valueNode.textValue()); + } else { + multipartBody.addFormDataPart(key, valueNode.toString()); + } + return; + } + + for (Map.Entry field : flat) { + if (field.getValue().isTextual()) { + multipartBody.addFormDataPart( + key + field.getKey(), field.getValue().textValue()); + } else { + multipartBody.addFormDataPart( + key + field.getKey(), field.getValue().toString()); + } + } + } + + public static List> flattenObject(ObjectNode object, boolean arraysAsRepeats) { + List> flat = new ArrayList<>(); + + Iterator> fields = object.fields(); + while (fields.hasNext()) { + Map.Entry field = fields.next(); + + String key = "[" + field.getKey() + "]"; + + if (field.getValue().isObject()) { + List> flatField = + flattenObject((ObjectNode) field.getValue(), arraysAsRepeats); + addAll(flat, flatField, key); + } else if (field.getValue().isArray()) { + List> flatField = + flattenArray((ArrayNode) field.getValue(), key, arraysAsRepeats); + addAll(flat, flatField, ""); + } else { + flat.add(new AbstractMap.SimpleEntry<>(key, field.getValue())); + } + } + + return flat; + } + + private static List> flattenArray( + ArrayNode array, String key, boolean arraysAsRepeats) { + List> flat = new ArrayList<>(); + + Iterator elements = array.elements(); + + int index = 0; + while (elements.hasNext()) { + JsonNode element = elements.next(); + + String indexKey = key + "[" + index + "]"; + + if (arraysAsRepeats) { + indexKey = key; + } + + if (element.isObject()) { + List> flatField = flattenObject((ObjectNode) element, arraysAsRepeats); + addAll(flat, flatField, indexKey); + } else if (element.isArray()) { + List> flatField = flattenArray((ArrayNode) element, "", arraysAsRepeats); + addAll(flat, flatField, indexKey); + } else { + flat.add(new AbstractMap.SimpleEntry<>(indexKey, element)); + } + + index++; + } + + return flat; + } + + private static void addAll( + List> target, List> source, String prefix) { + for (Map.Entry entry : source) { + Map.Entry entryToAdd = + new AbstractMap.SimpleEntry<>(prefix + entry.getKey(), entry.getValue()); + target.add(entryToAdd); + } + } +} diff --git a/src/main/java/com/merge/api/core/RequestOptions.java b/src/main/java/com/merge/api/core/RequestOptions.java index 69b3a07f7..d75805313 100644 --- a/src/main/java/com/merge/api/core/RequestOptions.java +++ b/src/main/java/com/merge/api/core/RequestOptions.java @@ -7,6 +7,7 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; public final class RequestOptions { private final String apiKey; @@ -17,11 +18,23 @@ public final class RequestOptions { private final TimeUnit timeoutTimeUnit; - private RequestOptions(String apiKey, String accountToken, Optional timeout, TimeUnit timeoutTimeUnit) { + private final Map headers; + + private final Map> headerSuppliers; + + private RequestOptions( + String apiKey, + String accountToken, + Optional timeout, + TimeUnit timeoutTimeUnit, + Map headers, + Map> headerSuppliers) { this.apiKey = apiKey; this.accountToken = accountToken; this.timeout = timeout; this.timeoutTimeUnit = timeoutTimeUnit; + this.headers = headers; + this.headerSuppliers = headerSuppliers; } public Optional getTimeout() { @@ -40,6 +53,10 @@ public Map getHeaders() { if (this.accountToken != null) { headers.put("X-Account-Token", this.accountToken); } + headers.putAll(this.headers); + this.headerSuppliers.forEach((key, supplier) -> { + headers.put(key, supplier.get()); + }); return headers; } @@ -56,6 +73,10 @@ public static final class Builder { private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS; + private final Map headers = new HashMap<>(); + + private final Map> headerSuppliers = new HashMap<>(); + public Builder apiKey(String apiKey) { this.apiKey = apiKey; return this; @@ -77,8 +98,18 @@ public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) { return this; } + public Builder addHeader(String key, String value) { + this.headers.put(key, value); + return this; + } + + public Builder addHeader(String key, Supplier value) { + this.headerSuppliers.put(key, value); + return this; + } + public RequestOptions build() { - return new RequestOptions(apiKey, accountToken, timeout, timeoutTimeUnit); + return new RequestOptions(apiKey, accountToken, timeout, timeoutTimeUnit, headers, headerSuppliers); } } } diff --git a/src/main/java/com/merge/api/core/RetryInterceptor.java b/src/main/java/com/merge/api/core/RetryInterceptor.java index ce04332a5..fa040d5a2 100644 --- a/src/main/java/com/merge/api/core/RetryInterceptor.java +++ b/src/main/java/com/merge/api/core/RetryInterceptor.java @@ -52,7 +52,7 @@ private Response retryChain(Response response, Chain chain) throws IOException { } private static boolean shouldRetry(int statusCode) { - return statusCode == 408 || statusCode == 409 || statusCode == 429 || statusCode >= 500; + return statusCode == 408 || statusCode == 429 || statusCode >= 500; } private final class ExponentialBackoff { diff --git a/src/main/java/com/merge/api/core/Stream.java b/src/main/java/com/merge/api/core/Stream.java index d8c5e8661..40f7cc47b 100644 --- a/src/main/java/com/merge/api/core/Stream.java +++ b/src/main/java/com/merge/api/core/Stream.java @@ -9,7 +9,7 @@ import java.util.Scanner; /** - * The {@code Stream} class implmenets {@link Iterable} to provide a simple mechanism for reading and parsing + * The {@code Stream} class implements {@link Iterable} to provide a simple mechanism for reading and parsing * objects of a given type from data streamed via a {@link Reader} using a specified delimiter. *

* {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a @@ -23,7 +23,7 @@ public final class Stream implements Iterable { */ private final Class valueType; /** - * The {@link Scanner} used for reading from the input stream and blocking when neede during iteration. + * The {@link Scanner} used for reading from the input stream and blocking when needed during iteration. */ private final Scanner scanner; diff --git a/src/main/java/com/merge/api/core/SyncPage.java b/src/main/java/com/merge/api/core/SyncPage.java new file mode 100644 index 000000000..cedb44331 --- /dev/null +++ b/src/main/java/com/merge/api/core/SyncPage.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.util.List; +import java.util.NoSuchElementException; +import java.util.function.Supplier; + +public class SyncPage extends BasePage { + protected final Supplier> nextSupplier; + + public SyncPage(boolean hasNext, List items, Supplier> nextSupplier) { + super(hasNext, items); + this.nextSupplier = nextSupplier; + } + + public SyncPage nextPage() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + return nextSupplier.get(); + } +} diff --git a/src/main/java/com/merge/api/core/SyncPagingIterable.java b/src/main/java/com/merge/api/core/SyncPagingIterable.java new file mode 100644 index 000000000..0726d13a2 --- /dev/null +++ b/src/main/java/com/merge/api/core/SyncPagingIterable.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Optional; +import java.util.function.Supplier; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +public class SyncPagingIterable extends SyncPage implements Iterable { + + public SyncPagingIterable(boolean hasNext, List items, Supplier> getNext) { + super(hasNext, items, getNext); + } + + public SyncPagingIterable(boolean hasNext, Optional> items, Supplier> getNext) { + super(hasNext, items.orElse(new ArrayList<>()), getNext); + } + + public Stream streamItems() { + return StreamSupport.stream(this.spliterator(), false); + } + + @Override + public Iterator iterator() { + return new Iterator() { + private Iterator itemsIterator = getItems().iterator(); + private SyncPage currentPage = SyncPagingIterable.this; + + @Override + public boolean hasNext() { + if (itemsIterator.hasNext()) { + return true; + } + if (currentPage.hasNext()) { + advancePage(); + return itemsIterator.hasNext(); + } + return false; + } + + @Override + public T next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + return itemsIterator.next(); + } + + private void advancePage() { + currentPage = currentPage.nextPage(); + itemsIterator = currentPage.getItems().iterator(); + } + }; + } +} diff --git a/src/main/java/com/merge/api/crm/AccountDetailsClient.java b/src/main/java/com/merge/api/crm/AccountDetailsClient.java new file mode 100644 index 000000000..ef4570fb4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountDetails; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/AccountTokenClient.java b/src/main/java/com/merge/api/crm/AccountTokenClient.java new file mode 100644 index 000000000..5cea85424 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AccountTokenClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountToken; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/AccountsClient.java b/src/main/java/com/merge/api/crm/AccountsClient.java new file mode 100644 index 000000000..ab6fb96cb --- /dev/null +++ b/src/main/java/com/merge/api/crm/AccountsClient.java @@ -0,0 +1,156 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Account; +import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.AccountsRetrieveRequest; +import com.merge.api.crm.types.CrmAccountEndpointRequest; +import com.merge.api.crm.types.CrmAccountResponse; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedCrmAccountEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; + +public class AccountsClient { + protected final ClientOptions clientOptions; + + private final RawAccountsClient rawClient; + + public AccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list(AccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list(AccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Account object with the given values. + */ + public CrmAccountResponse create(CrmAccountEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Account object with the given values. + */ + public CrmAccountResponse create(CrmAccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id, AccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates an Account object with the given id. + */ + public CrmAccountResponse partialUpdate(String id, PatchedCrmAccountEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates an Account object with the given id. + */ + public CrmAccountResponse partialUpdate( + String id, PatchedCrmAccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(AccountsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/AssociationTypesClient.java b/src/main/java/com/merge/api/crm/AssociationTypesClient.java new file mode 100644 index 000000000..99855ca2f --- /dev/null +++ b/src/main/java/com/merge/api/crm/AssociationTypesClient.java @@ -0,0 +1,134 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AssociationType; +import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; +import com.merge.api.crm.types.CrmAssociationTypeResponse; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; + +public class AssociationTypesClient { + protected final ClientOptions clientOptions; + + private final RawAssociationTypesClient rawClient; + + public AssociationTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAssociationTypesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAssociationTypesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of AssociationType objects. + */ + public SyncPagingIterable customObjectClassesAssociationTypesList(String customObjectClassId) { + return this.rawClient + .customObjectClassesAssociationTypesList(customObjectClassId) + .body(); + } + + /** + * Returns a list of AssociationType objects. + */ + public SyncPagingIterable customObjectClassesAssociationTypesList( + String customObjectClassId, CustomObjectClassesAssociationTypesListRequest request) { + return this.rawClient + .customObjectClassesAssociationTypesList(customObjectClassId, request) + .body(); + } + + /** + * Returns a list of AssociationType objects. + */ + public SyncPagingIterable customObjectClassesAssociationTypesList( + String customObjectClassId, + CustomObjectClassesAssociationTypesListRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesList(customObjectClassId, request, requestOptions) + .body(); + } + + /** + * Creates an AssociationType object with the given values. + */ + public CrmAssociationTypeResponse customObjectClassesAssociationTypesCreate( + String customObjectClassId, CrmAssociationTypeEndpointRequest request) { + return this.rawClient + .customObjectClassesAssociationTypesCreate(customObjectClassId, request) + .body(); + } + + /** + * Creates an AssociationType object with the given values. + */ + public CrmAssociationTypeResponse customObjectClassesAssociationTypesCreate( + String customObjectClassId, CrmAssociationTypeEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesCreate(customObjectClassId, request, requestOptions) + .body(); + } + + /** + * Returns an AssociationType object with the given id. + */ + public AssociationType customObjectClassesAssociationTypesRetrieve(String customObjectClassId, String id) { + return this.rawClient + .customObjectClassesAssociationTypesRetrieve(customObjectClassId, id) + .body(); + } + + /** + * Returns an AssociationType object with the given id. + */ + public AssociationType customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, String id, CustomObjectClassesAssociationTypesRetrieveRequest request) { + return this.rawClient + .customObjectClassesAssociationTypesRetrieve(customObjectClassId, id, request) + .body(); + } + + /** + * Returns an AssociationType object with the given id. + */ + public AssociationType customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesAssociationTypesRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesRetrieve(customObjectClassId, id, request, requestOptions) + .body(); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public MetaResponse customObjectClassesAssociationTypesMetaPostRetrieve(String customObjectClassId) { + return this.rawClient + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId) + .body(); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public MetaResponse customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, requestOptions) + .body(); + } +} diff --git a/src/main/java/com/merge/api/crm/AssociationsClient.java b/src/main/java/com/merge/api/crm/AssociationsClient.java new file mode 100644 index 000000000..6ceb556db --- /dev/null +++ b/src/main/java/com/merge/api/crm/AssociationsClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Association; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsUpdateRequest; + +public class AssociationsClient { + protected final ClientOptions clientOptions; + + private final RawAssociationsClient rawClient; + + public AssociationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAssociationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAssociationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Association objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, String objectId) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsList(customObjectClassId, objectId) + .body(); + } + + /** + * Returns a list of Association objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsList(customObjectClassId, objectId, request) + .body(); + } + + /** + * Returns a list of Association objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsList( + customObjectClassId, objectId, request, requestOptions) + .body(); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public Association customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId) + .body(); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public Association customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId, request) + .body(); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public Association customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, + sourceClassId, + sourceObjectId, + targetClassId, + targetObjectId, + request, + requestOptions) + .body(); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/crm/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..b0bbda257 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountDetails; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/crm/AsyncAccountTokenClient.java new file mode 100644 index 000000000..e257c7cfb --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAccountTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAccountsClient.java b/src/main/java/com/merge/api/crm/AsyncAccountsClient.java new file mode 100644 index 000000000..e5d64a216 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAccountsClient.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Account; +import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.AccountsRetrieveRequest; +import com.merge.api.crm.types.CrmAccountEndpointRequest; +import com.merge.api.crm.types.CrmAccountResponse; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedCrmAccountEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountsClient rawClient; + + public AsyncAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list(AccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list( + AccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture create(CrmAccountEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture create( + CrmAccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve(String id, AccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates an Account object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedCrmAccountEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates an Account object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedCrmAccountEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAssociationTypesClient.java b/src/main/java/com/merge/api/crm/AsyncAssociationTypesClient.java new file mode 100644 index 000000000..ba12a82e0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAssociationTypesClient.java @@ -0,0 +1,138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AssociationType; +import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; +import com.merge.api.crm.types.CrmAssociationTypeResponse; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncAssociationTypesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAssociationTypesClient rawClient; + + public AsyncAssociationTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAssociationTypesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAssociationTypesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of AssociationType objects. + */ + public CompletableFuture> customObjectClassesAssociationTypesList( + String customObjectClassId) { + return this.rawClient + .customObjectClassesAssociationTypesList(customObjectClassId) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of AssociationType objects. + */ + public CompletableFuture> customObjectClassesAssociationTypesList( + String customObjectClassId, CustomObjectClassesAssociationTypesListRequest request) { + return this.rawClient + .customObjectClassesAssociationTypesList(customObjectClassId, request) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of AssociationType objects. + */ + public CompletableFuture> customObjectClassesAssociationTypesList( + String customObjectClassId, + CustomObjectClassesAssociationTypesListRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesList(customObjectClassId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Creates an AssociationType object with the given values. + */ + public CompletableFuture customObjectClassesAssociationTypesCreate( + String customObjectClassId, CrmAssociationTypeEndpointRequest request) { + return this.rawClient + .customObjectClassesAssociationTypesCreate(customObjectClassId, request) + .thenApply(response -> response.body()); + } + + /** + * Creates an AssociationType object with the given values. + */ + public CompletableFuture customObjectClassesAssociationTypesCreate( + String customObjectClassId, CrmAssociationTypeEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesCreate(customObjectClassId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns an AssociationType object with the given id. + */ + public CompletableFuture customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, String id) { + return this.rawClient + .customObjectClassesAssociationTypesRetrieve(customObjectClassId, id) + .thenApply(response -> response.body()); + } + + /** + * Returns an AssociationType object with the given id. + */ + public CompletableFuture customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, String id, CustomObjectClassesAssociationTypesRetrieveRequest request) { + return this.rawClient + .customObjectClassesAssociationTypesRetrieve(customObjectClassId, id, request) + .thenApply(response -> response.body()); + } + + /** + * Returns an AssociationType object with the given id. + */ + public CompletableFuture customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesAssociationTypesRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesRetrieve(customObjectClassId, id, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public CompletableFuture customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId) { + return this.rawClient + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public CompletableFuture customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAssociationsClient.java b/src/main/java/com/merge/api/crm/AsyncAssociationsClient.java new file mode 100644 index 000000000..ceb5aacab --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAssociationsClient.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Association; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsUpdateRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAssociationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAssociationsClient rawClient; + + public AsyncAssociationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAssociationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAssociationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Association objects. + */ + public CompletableFuture> customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, String objectId) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsList(customObjectClassId, objectId) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of Association objects. + */ + public CompletableFuture> customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsList(customObjectClassId, objectId, request) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of Association objects. + */ + public CompletableFuture> customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsList( + customObjectClassId, objectId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public CompletableFuture customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId) + .thenApply(response -> response.body()); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public CompletableFuture customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId, request) + .thenApply(response -> response.body()); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public CompletableFuture customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, + sourceClassId, + sourceObjectId, + targetClassId, + targetObjectId, + request, + requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/crm/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..256a0598a --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AsyncPassthroughReciept; +import com.merge.api.crm.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.crm.types.DataPassthroughRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/crm/AsyncAuditTrailClient.java new file mode 100644 index 000000000..3677b6917 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AuditLogEvent; +import com.merge.api.crm.types.AuditTrailListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/crm/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..d7b46fb7e --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AvailableActions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncContactsClient.java b/src/main/java/com/merge/api/crm/AsyncContactsClient.java new file mode 100644 index 000000000..78874c8df --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncContactsClient.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.ContactsRetrieveRequest; +import com.merge.api.crm.types.CrmContactEndpointRequest; +import com.merge.api.crm.types.CrmContactResponse; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedCrmContactEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncContactsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawContactsClient rawClient; + + public AsyncContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawContactsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawContactsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list(ContactsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list( + ContactsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture create(CrmContactEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture create( + CrmContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve(String id, ContactsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedCrmContactEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedCrmContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncCrmClient.java b/src/main/java/com/merge/api/crm/AsyncCrmClient.java new file mode 100644 index 000000000..619c07c61 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncCrmClient.java @@ -0,0 +1,233 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncCrmClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier accountsClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier contactsClient; + + protected final Supplier customObjectClassesClient; + + protected final Supplier associationTypesClient; + + protected final Supplier customObjectsClient; + + protected final Supplier associationsClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier engagementTypesClient; + + protected final Supplier engagementsClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier issuesClient; + + protected final Supplier leadsClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier notesClient; + + protected final Supplier opportunitiesClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier stagesClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier tasksClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public AsyncCrmClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.accountsClient = Suppliers.memoize(() -> new AsyncAccountsClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.contactsClient = Suppliers.memoize(() -> new AsyncContactsClient(clientOptions)); + this.customObjectClassesClient = Suppliers.memoize(() -> new AsyncCustomObjectClassesClient(clientOptions)); + this.associationTypesClient = Suppliers.memoize(() -> new AsyncAssociationTypesClient(clientOptions)); + this.customObjectsClient = Suppliers.memoize(() -> new AsyncCustomObjectsClient(clientOptions)); + this.associationsClient = Suppliers.memoize(() -> new AsyncAssociationsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.engagementTypesClient = Suppliers.memoize(() -> new AsyncEngagementTypesClient(clientOptions)); + this.engagementsClient = Suppliers.memoize(() -> new AsyncEngagementsClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.leadsClient = Suppliers.memoize(() -> new AsyncLeadsClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.notesClient = Suppliers.memoize(() -> new AsyncNotesClient(clientOptions)); + this.opportunitiesClient = Suppliers.memoize(() -> new AsyncOpportunitiesClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.stagesClient = Suppliers.memoize(() -> new AsyncStagesClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.tasksClient = Suppliers.memoize(() -> new AsyncTasksClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncAccountsClient accounts() { + return this.accountsClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncContactsClient contacts() { + return this.contactsClient.get(); + } + + public AsyncCustomObjectClassesClient customObjectClasses() { + return this.customObjectClassesClient.get(); + } + + public AsyncAssociationTypesClient associationTypes() { + return this.associationTypesClient.get(); + } + + public AsyncCustomObjectsClient customObjects() { + return this.customObjectsClient.get(); + } + + public AsyncAssociationsClient associations() { + return this.associationsClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncEngagementTypesClient engagementTypes() { + return this.engagementTypesClient.get(); + } + + public AsyncEngagementsClient engagements() { + return this.engagementsClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncLeadsClient leads() { + return this.leadsClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncNotesClient notes() { + return this.notesClient.get(); + } + + public AsyncOpportunitiesClient opportunities() { + return this.opportunitiesClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncStagesClient stages() { + return this.stagesClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncTasksClient tasks() { + return this.tasksClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncCustomObjectClassesClient.java b/src/main/java/com/merge/api/crm/AsyncCustomObjectClassesClient.java new file mode 100644 index 000000000..c5629d632 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncCustomObjectClassesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CustomObjectClass; +import com.merge.api.crm.types.CustomObjectClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncCustomObjectClassesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCustomObjectClassesClient rawClient; + + public AsyncCustomObjectClassesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCustomObjectClassesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCustomObjectClassesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public CompletableFuture> list(CustomObjectClassesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public CompletableFuture> list( + CustomObjectClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CompletableFuture retrieve(String id, CustomObjectClassesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CompletableFuture retrieve( + String id, CustomObjectClassesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncCustomObjectsClient.java b/src/main/java/com/merge/api/crm/AsyncCustomObjectsClient.java new file mode 100644 index 000000000..a8548dcfa --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncCustomObjectsClient.java @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CrmCustomObjectEndpointRequest; +import com.merge.api.crm.types.CrmCustomObjectResponse; +import com.merge.api.crm.types.CustomObject; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncCustomObjectsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCustomObjectsClient rawClient; + + public AsyncCustomObjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCustomObjectsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCustomObjectsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CustomObject objects. + */ + public CompletableFuture> customObjectClassesCustomObjectsList( + String customObjectClassId) { + return this.rawClient + .customObjectClassesCustomObjectsList(customObjectClassId) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of CustomObject objects. + */ + public CompletableFuture> customObjectClassesCustomObjectsList( + String customObjectClassId, CustomObjectClassesCustomObjectsListRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsList(customObjectClassId, request) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of CustomObject objects. + */ + public CompletableFuture> customObjectClassesCustomObjectsList( + String customObjectClassId, + CustomObjectClassesCustomObjectsListRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsList(customObjectClassId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Creates a CustomObject object with the given values. + */ + public CompletableFuture customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsCreate(customObjectClassId, request) + .thenApply(response -> response.body()); + } + + /** + * Creates a CustomObject object with the given values. + */ + public CompletableFuture customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsCreate(customObjectClassId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CompletableFuture customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, String id) { + return this.rawClient + .customObjectClassesCustomObjectsRetrieve(customObjectClassId, id) + .thenApply(response -> response.body()); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CompletableFuture customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, String id, CustomObjectClassesCustomObjectsRetrieveRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsRetrieve(customObjectClassId, id, request) + .thenApply(response -> response.body()); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CompletableFuture customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesCustomObjectsRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsRetrieve(customObjectClassId, id, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public CompletableFuture customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId) { + return this.rawClient + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public CompletableFuture customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> + customObjectClassesCustomObjectsRemoteFieldClassesList() { + return this.rawClient + .customObjectClassesCustomObjectsRemoteFieldClassesList() + .thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> + customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsRemoteFieldClassesList(request) + .thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> + customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/crm/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..b9793c747 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncEngagementTypesClient.java b/src/main/java/com/merge/api/crm/AsyncEngagementTypesClient.java new file mode 100644 index 000000000..f576955d8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncEngagementTypesClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.EngagementType; +import com.merge.api.crm.types.EngagementTypesListRequest; +import com.merge.api.crm.types.EngagementTypesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementTypesRetrieveRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncEngagementTypesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEngagementTypesClient rawClient; + + public AsyncEngagementTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEngagementTypesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEngagementTypesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EngagementType objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of EngagementType objects. + */ + public CompletableFuture> list(EngagementTypesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of EngagementType objects. + */ + public CompletableFuture> list( + EngagementTypesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an EngagementType object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an EngagementType object with the given id. + */ + public CompletableFuture retrieve(String id, EngagementTypesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an EngagementType object with the given id. + */ + public CompletableFuture retrieve( + String id, EngagementTypesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncEngagementsClient.java b/src/main/java/com/merge/api/crm/AsyncEngagementsClient.java new file mode 100644 index 000000000..0f07c3c92 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncEngagementsClient.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Engagement; +import com.merge.api.crm.types.EngagementEndpointRequest; +import com.merge.api.crm.types.EngagementResponse; +import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedEngagementEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncEngagementsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEngagementsClient rawClient; + + public AsyncEngagementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEngagementsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEngagementsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Engagement objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Engagement objects. + */ + public CompletableFuture> list(EngagementsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Engagement objects. + */ + public CompletableFuture> list( + EngagementsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Engagement object with the given values. + */ + public CompletableFuture create(EngagementEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Engagement object with the given values. + */ + public CompletableFuture create( + EngagementEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Engagement object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Engagement object with the given id. + */ + public CompletableFuture retrieve(String id, EngagementsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Engagement object with the given id. + */ + public CompletableFuture retrieve( + String id, EngagementsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates an Engagement object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedEngagementEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates an Engagement object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedEngagementEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Engagement POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Engagement POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/crm/AsyncFieldMappingClient.java new file mode 100644 index 000000000..6d404b531 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncFieldMappingClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CreateFieldMappingRequest; +import com.merge.api.crm.types.ExternalTargetFieldApiResponse; +import com.merge.api.crm.types.FieldMappingApiInstanceResponse; +import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsRetrieveRequest; +import com.merge.api.crm.types.PatchedEditFieldMappingRequest; +import com.merge.api.crm.types.RemoteFieldApiResponse; +import com.merge.api.crm.types.RemoteFieldsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncForceResyncClient.java b/src/main/java/com/merge/api/crm/AsyncForceResyncClient.java new file mode 100644 index 000000000..1552c597d --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.SyncStatus; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/crm/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..ab380ffd8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.GenerateRemoteKeyRequest; +import com.merge.api.crm.types.RemoteKey; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncIssuesClient.java b/src/main/java/com/merge/api/crm/AsyncIssuesClient.java new file mode 100644 index 000000000..0c206f458 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Issue; +import com.merge.api.crm.types.IssuesListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncLeadsClient.java b/src/main/java/com/merge/api/crm/AsyncLeadsClient.java new file mode 100644 index 000000000..912a27a2b --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncLeadsClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Lead; +import com.merge.api.crm.types.LeadEndpointRequest; +import com.merge.api.crm.types.LeadResponse; +import com.merge.api.crm.types.LeadsListRequest; +import com.merge.api.crm.types.LeadsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.LeadsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncLeadsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLeadsClient rawClient; + + public AsyncLeadsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLeadsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLeadsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Lead objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Lead objects. + */ + public CompletableFuture> list(LeadsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Lead objects. + */ + public CompletableFuture> list(LeadsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Lead object with the given values. + */ + public CompletableFuture create(LeadEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Lead object with the given values. + */ + public CompletableFuture create(LeadEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Lead object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Lead object with the given id. + */ + public CompletableFuture retrieve(String id, LeadsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Lead object with the given id. + */ + public CompletableFuture retrieve(String id, LeadsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Lead POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Lead POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/crm/AsyncLinkTokenClient.java new file mode 100644 index 000000000..e9ca67c7a --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.EndUserDetailsRequest; +import com.merge.api.crm.types.LinkToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/crm/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..1a2f742e0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AccountDetailsAndActions; +import com.merge.api.crm.types.LinkedAccountsListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncNotesClient.java b/src/main/java/com/merge/api/crm/AsyncNotesClient.java new file mode 100644 index 000000000..1b51548e7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncNotesClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.Note; +import com.merge.api.crm.types.NoteEndpointRequest; +import com.merge.api.crm.types.NoteResponse; +import com.merge.api.crm.types.NotesListRequest; +import com.merge.api.crm.types.NotesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.NotesRetrieveRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncNotesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawNotesClient rawClient; + + public AsyncNotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawNotesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawNotesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Note objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Note objects. + */ + public CompletableFuture> list(NotesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Note objects. + */ + public CompletableFuture> list(NotesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Note object with the given values. + */ + public CompletableFuture create(NoteEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Note object with the given values. + */ + public CompletableFuture create(NoteEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Note object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Note object with the given id. + */ + public CompletableFuture retrieve(String id, NotesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Note object with the given id. + */ + public CompletableFuture retrieve(String id, NotesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Note POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Note POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + NotesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + NotesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncOpportunitiesClient.java b/src/main/java/com/merge/api/crm/AsyncOpportunitiesClient.java new file mode 100644 index 000000000..2b3c9a895 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncOpportunitiesClient.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.OpportunitiesRetrieveRequest; +import com.merge.api.crm.types.Opportunity; +import com.merge.api.crm.types.OpportunityEndpointRequest; +import com.merge.api.crm.types.OpportunityResponse; +import com.merge.api.crm.types.PatchedOpportunityEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.util.concurrent.CompletableFuture; + +public class AsyncOpportunitiesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawOpportunitiesClient rawClient; + + public AsyncOpportunitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawOpportunitiesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawOpportunitiesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Opportunity objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Opportunity objects. + */ + public CompletableFuture> list(OpportunitiesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Opportunity objects. + */ + public CompletableFuture> list( + OpportunitiesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Opportunity object with the given values. + */ + public CompletableFuture create(OpportunityEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Opportunity object with the given values. + */ + public CompletableFuture create( + OpportunityEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Opportunity object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Opportunity object with the given id. + */ + public CompletableFuture retrieve(String id, OpportunitiesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Opportunity object with the given id. + */ + public CompletableFuture retrieve( + String id, OpportunitiesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates an Opportunity object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedOpportunityEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates an Opportunity object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedOpportunityEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncPassthroughClient.java b/src/main/java/com/merge/api/crm/AsyncPassthroughClient.java new file mode 100644 index 000000000..100f30872 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.DataPassthroughRequest; +import com.merge.api.crm.types.RemoteResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..5ef83e046 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAccountDetailsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountDetails; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/crm/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..eaa5df9b0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAccountTokenClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java new file mode 100644 index 000000000..845868147 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java @@ -0,0 +1,685 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Account; +import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.AccountsRetrieveRequest; +import com.merge.api.crm.types.CrmAccountEndpointRequest; +import com.merge.api.crm.types.CrmAccountResponse; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedAccountList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedCrmAccountEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list() { + return list(AccountsListRequest.builder().build()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list(AccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list( + AccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsListRequest nextRequest = AccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture> create(CrmAccountEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Account object with the given values. + */ + public CompletableFuture> create( + CrmAccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AccountsRetrieveRequest.builder().build()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve(String id, AccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates an Account object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCrmAccountEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Account object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCrmAccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsRemoteFieldClassesListRequest nextRequest = + AccountsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java b/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java new file mode 100644 index 000000000..a2a6d3d50 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java @@ -0,0 +1,432 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AssociationType; +import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; +import com.merge.api.crm.types.CrmAssociationTypeResponse; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedAssociationTypeList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAssociationTypesClient { + protected final ClientOptions clientOptions; + + public AsyncRawAssociationTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of AssociationType objects. + */ + public CompletableFuture>> + customObjectClassesAssociationTypesList(String customObjectClassId) { + return customObjectClassesAssociationTypesList( + customObjectClassId, + CustomObjectClassesAssociationTypesListRequest.builder().build()); + } + + /** + * Returns a list of AssociationType objects. + */ + public CompletableFuture>> + customObjectClassesAssociationTypesList( + String customObjectClassId, CustomObjectClassesAssociationTypesListRequest request) { + return customObjectClassesAssociationTypesList(customObjectClassId, request, null); + } + + /** + * Returns a list of AssociationType objects. + */ + public CompletableFuture>> + customObjectClassesAssociationTypesList( + String customObjectClassId, + CustomObjectClassesAssociationTypesListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAssociationTypeList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAssociationTypeList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesAssociationTypesListRequest nextRequest = + CustomObjectClassesAssociationTypesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return customObjectClassesAssociationTypesList( + customObjectClassId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an AssociationType object with the given values. + */ + public CompletableFuture> + customObjectClassesAssociationTypesCreate( + String customObjectClassId, CrmAssociationTypeEndpointRequest request) { + return customObjectClassesAssociationTypesCreate(customObjectClassId, request, null); + } + + /** + * Creates an AssociationType object with the given values. + */ + public CompletableFuture> + customObjectClassesAssociationTypesCreate( + String customObjectClassId, + CrmAssociationTypeEndpointRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), CrmAssociationTypeResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an AssociationType object with the given id. + */ + public CompletableFuture> customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, String id) { + return customObjectClassesAssociationTypesRetrieve( + customObjectClassId, + id, + CustomObjectClassesAssociationTypesRetrieveRequest.builder().build()); + } + + /** + * Returns an AssociationType object with the given id. + */ + public CompletableFuture> customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, String id, CustomObjectClassesAssociationTypesRetrieveRequest request) { + return customObjectClassesAssociationTypesRetrieve(customObjectClassId, id, request, null); + } + + /** + * Returns an AssociationType object with the given id. + */ + public CompletableFuture> customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesAssociationTypesRetrieveRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AssociationType.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public CompletableFuture> customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId) { + return customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, null); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public CompletableFuture> customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java new file mode 100644 index 000000000..5054c1b72 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java @@ -0,0 +1,307 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Association; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsUpdateRequest; +import com.merge.api.crm.types.PaginatedAssociationList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAssociationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAssociationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Association objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsAssociationsList(String customObjectClassId, String objectId) { + return customObjectClassesCustomObjectsAssociationsList( + customObjectClassId, + objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest.builder() + .build()); + } + + /** + * Returns a list of Association objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request) { + return customObjectClassesCustomObjectsAssociationsList(customObjectClassId, objectId, request, null); + } + + /** + * Returns a list of Association objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects") + .addPathSegment(objectId) + .addPathSegments("associations"); + if (request.getAssociationTypeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "association_type_id", + request.getAssociationTypeId().get(), + false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAssociationList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAssociationList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesCustomObjectsAssociationsListRequest nextRequest = + CustomObjectClassesCustomObjectsAssociationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return customObjectClassesCustomObjectsAssociationsList( + customObjectClassId, objectId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public CompletableFuture> customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId) { + return customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, + sourceClassId, + sourceObjectId, + targetClassId, + targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest.builder() + .build()); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public CompletableFuture> customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request) { + return customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId, request, null); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public CompletableFuture> customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(sourceClassId) + .addPathSegments("custom-objects") + .addPathSegment(sourceObjectId) + .addPathSegments("associations") + .addPathSegment(targetClassId) + .addPathSegment(targetObjectId) + .addPathSegment(associationTypeId); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PUT", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Association.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..e2913bd32 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AsyncPassthroughReciept; +import com.merge.api.crm.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.crm.types.DataPassthroughRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughReciept.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..0282d2352 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AuditLogEvent; +import com.merge.api.crm.types.AuditTrailListRequest; +import com.merge.api.crm.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..9cb339768 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawAvailableActionsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AvailableActions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java b/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java new file mode 100644 index 000000000..80725ee02 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java @@ -0,0 +1,755 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.ContactsRetrieveRequest; +import com.merge.api.crm.types.CrmContactEndpointRequest; +import com.merge.api.crm.types.CrmContactResponse; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedContactList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedCrmContactEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawContactsClient { + protected final ClientOptions clientOptions; + + public AsyncRawContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list() { + return list(ContactsListRequest.builder().build()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list(ContactsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list( + ContactsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddresses().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_addresses", request.getEmailAddresses().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPhoneNumbers().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "phone_numbers", request.getPhoneNumbers().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedContactList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsListRequest nextRequest = ContactsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture> create(CrmContactEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture> create( + CrmContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ContactsRetrieveRequest.builder().build()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve(String id, ContactsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCrmContactEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCrmContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsRemoteFieldClassesListRequest nextRequest = + ContactsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java new file mode 100644 index 000000000..39bcfe8a4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java @@ -0,0 +1,263 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CustomObjectClass; +import com.merge.api.crm.types.CustomObjectClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesRetrieveRequest; +import com.merge.api.crm.types.PaginatedCustomObjectClassList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCustomObjectClassesClient { + protected final ClientOptions clientOptions; + + public AsyncRawCustomObjectClassesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public CompletableFuture>> list() { + return list(CustomObjectClassesListRequest.builder().build()); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public CompletableFuture>> list( + CustomObjectClassesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public CompletableFuture>> list( + CustomObjectClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCustomObjectClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCustomObjectClassList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesListRequest nextRequest = CustomObjectClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CustomObjectClassesRetrieveRequest.builder().build()); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CompletableFuture> retrieve( + String id, CustomObjectClassesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CompletableFuture> retrieve( + String id, CustomObjectClassesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObjectClass.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java new file mode 100644 index 000000000..aab5b23e5 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CrmCustomObjectEndpointRequest; +import com.merge.api.crm.types.CrmCustomObjectResponse; +import com.merge.api.crm.types.CustomObject; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedCustomObjectList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCustomObjectsClient { + protected final ClientOptions clientOptions; + + public AsyncRawCustomObjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CustomObject objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsList(String customObjectClassId) { + return customObjectClassesCustomObjectsList( + customObjectClassId, + CustomObjectClassesCustomObjectsListRequest.builder().build()); + } + + /** + * Returns a list of CustomObject objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsList( + String customObjectClassId, CustomObjectClassesCustomObjectsListRequest request) { + return customObjectClassesCustomObjectsList(customObjectClassId, request, null); + } + + /** + * Returns a list of CustomObject objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsList( + String customObjectClassId, + CustomObjectClassesCustomObjectsListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCustomObjectList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCustomObjectList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesCustomObjectsListRequest nextRequest = + CustomObjectClassesCustomObjectsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return customObjectClassesCustomObjectsList( + customObjectClassId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a CustomObject object with the given values. + */ + public CompletableFuture> customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request) { + return customObjectClassesCustomObjectsCreate(customObjectClassId, request, null); + } + + /** + * Creates a CustomObject object with the given values. + */ + public CompletableFuture> customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), CrmCustomObjectResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a CustomObject object with the given id. + */ + public CompletableFuture> customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, String id) { + return customObjectClassesCustomObjectsRetrieve( + customObjectClassId, + id, + CustomObjectClassesCustomObjectsRetrieveRequest.builder().build()); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CompletableFuture> customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, String id, CustomObjectClassesCustomObjectsRetrieveRequest request) { + return customObjectClassesCustomObjectsRetrieve(customObjectClassId, id, request, null); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CompletableFuture> customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesCustomObjectsRetrieveRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObject.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public CompletableFuture> customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId) { + return customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, null); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public CompletableFuture> customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsRemoteFieldClassesList() { + return customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() + .build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request) { + return customObjectClassesCustomObjectsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> + customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes/custom-objects/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest nextRequest = + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return customObjectClassesCustomObjectsRemoteFieldClassesList( + nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/crm/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..beb18761e --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawDeleteAccountClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java b/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java new file mode 100644 index 000000000..9b86e01ef --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java @@ -0,0 +1,399 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.EngagementType; +import com.merge.api.crm.types.EngagementTypesListRequest; +import com.merge.api.crm.types.EngagementTypesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementTypesRetrieveRequest; +import com.merge.api.crm.types.PaginatedEngagementTypeList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEngagementTypesClient { + protected final ClientOptions clientOptions; + + public AsyncRawEngagementTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EngagementType objects. + */ + public CompletableFuture>> list() { + return list(EngagementTypesListRequest.builder().build()); + } + + /** + * Returns a list of EngagementType objects. + */ + public CompletableFuture>> list( + EngagementTypesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EngagementType objects. + */ + public CompletableFuture>> list( + EngagementTypesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagement-types"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEngagementTypeList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedEngagementTypeList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementTypesListRequest nextRequest = EngagementTypesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an EngagementType object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EngagementTypesRetrieveRequest.builder().build()); + } + + /** + * Returns an EngagementType object with the given id. + */ + public CompletableFuture> retrieve( + String id, EngagementTypesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EngagementType object with the given id. + */ + public CompletableFuture> retrieve( + String id, EngagementTypesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagement-types") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementType.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagement-types/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementTypesRemoteFieldClassesListRequest nextRequest = + EngagementTypesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java b/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java new file mode 100644 index 000000000..05032e3cd --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java @@ -0,0 +1,687 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Engagement; +import com.merge.api.crm.types.EngagementEndpointRequest; +import com.merge.api.crm.types.EngagementResponse; +import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedEngagementList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedEngagementEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEngagementsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEngagementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Engagement objects. + */ + public CompletableFuture>> list() { + return list(EngagementsListRequest.builder().build()); + } + + /** + * Returns a list of Engagement objects. + */ + public CompletableFuture>> list( + EngagementsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Engagement objects. + */ + public CompletableFuture>> list( + EngagementsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEngagementList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedEngagementList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementsListRequest nextRequest = EngagementsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Engagement object with the given values. + */ + public CompletableFuture> create(EngagementEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Engagement object with the given values. + */ + public CompletableFuture> create( + EngagementEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Engagement object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EngagementsRetrieveRequest.builder().build()); + } + + /** + * Returns an Engagement object with the given id. + */ + public CompletableFuture> retrieve(String id, EngagementsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Engagement object with the given id. + */ + public CompletableFuture> retrieve( + String id, EngagementsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Engagement.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates an Engagement object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedEngagementEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Engagement object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedEngagementEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Engagement POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Engagement POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementsRemoteFieldClassesListRequest nextRequest = + EngagementsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..640110b9f --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CreateFieldMappingRequest; +import com.merge.api.crm.types.ExternalTargetFieldApiResponse; +import com.merge.api.crm.types.FieldMappingApiInstanceResponse; +import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsRetrieveRequest; +import com.merge.api.crm.types.PatchedEditFieldMappingRequest; +import com.merge.api.crm.types.RemoteFieldApiResponse; +import com.merge.api.crm.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), RemoteFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/crm/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..51b4e6b26 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawForceResyncClient.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/crm/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..4075504d5 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawGenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.GenerateRemoteKeyRequest; +import com.merge.api.crm.types.RemoteKey; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java new file mode 100644 index 000000000..8a36959e2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Issue; +import com.merge.api.crm.types.IssuesListRequest; +import com.merge.api.crm.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java b/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java new file mode 100644 index 000000000..c650749ef --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java @@ -0,0 +1,566 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Lead; +import com.merge.api.crm.types.LeadEndpointRequest; +import com.merge.api.crm.types.LeadResponse; +import com.merge.api.crm.types.LeadsListRequest; +import com.merge.api.crm.types.LeadsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.LeadsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedLeadList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLeadsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLeadsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Lead objects. + */ + public CompletableFuture>> list() { + return list(LeadsListRequest.builder().build()); + } + + /** + * Returns a list of Lead objects. + */ + public CompletableFuture>> list(LeadsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Lead objects. + */ + public CompletableFuture>> list( + LeadsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads"); + if (request.getConvertedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "converted_account_id", + request.getConvertedAccountId().get(), + false); + } + if (request.getConvertedContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "converted_contact_id", + request.getConvertedContactId().get(), + false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddresses().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_addresses", request.getEmailAddresses().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPhoneNumbers().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "phone_numbers", request.getPhoneNumbers().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedLeadList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLeadList.class); + Optional startingAfter = parsedResponse.getNext(); + LeadsListRequest nextRequest = LeadsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Lead object with the given values. + */ + public CompletableFuture> create(LeadEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Lead object with the given values. + */ + public CompletableFuture> create( + LeadEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LeadResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Lead object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, LeadsRetrieveRequest.builder().build()); + } + + /** + * Returns a Lead object with the given id. + */ + public CompletableFuture> retrieve(String id, LeadsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Lead object with the given id. + */ + public CompletableFuture> retrieve( + String id, LeadsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Lead.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Lead POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Lead POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + LeadsRemoteFieldClassesListRequest nextRequest = LeadsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..524924478 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.EndUserDetailsRequest; +import com.merge.api.crm.types.LinkToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..915e38261 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AccountDetailsAndActions; +import com.merge.api.crm.types.LinkedAccountsListRequest; +import com.merge.api.crm.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java b/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java new file mode 100644 index 000000000..bca8aceda --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java @@ -0,0 +1,556 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.Note; +import com.merge.api.crm.types.NoteEndpointRequest; +import com.merge.api.crm.types.NoteResponse; +import com.merge.api.crm.types.NotesListRequest; +import com.merge.api.crm.types.NotesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.NotesRetrieveRequest; +import com.merge.api.crm.types.PaginatedNoteList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawNotesClient { + protected final ClientOptions clientOptions; + + public AsyncRawNotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Note objects. + */ + public CompletableFuture>> list() { + return list(NotesListRequest.builder().build()); + } + + /** + * Returns a list of Note objects. + */ + public CompletableFuture>> list(NotesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Note objects. + */ + public CompletableFuture>> list( + NotesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOpportunityId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "opportunity_id", request.getOpportunityId().get(), false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedNoteList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedNoteList.class); + Optional startingAfter = parsedResponse.getNext(); + NotesListRequest nextRequest = NotesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Note object with the given values. + */ + public CompletableFuture> create(NoteEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Note object with the given values. + */ + public CompletableFuture> create( + NoteEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Note object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, NotesRetrieveRequest.builder().build()); + } + + /** + * Returns a Note object with the given id. + */ + public CompletableFuture> retrieve(String id, NotesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Note object with the given id. + */ + public CompletableFuture> retrieve( + String id, NotesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Note.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Note POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Note POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + NotesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + NotesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + NotesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + NotesRemoteFieldClassesListRequest nextRequest = NotesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java b/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java new file mode 100644 index 000000000..e45073579 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java @@ -0,0 +1,719 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.OpportunitiesRetrieveRequest; +import com.merge.api.crm.types.Opportunity; +import com.merge.api.crm.types.OpportunityEndpointRequest; +import com.merge.api.crm.types.OpportunityResponse; +import com.merge.api.crm.types.PaginatedOpportunityList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedOpportunityEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawOpportunitiesClient { + protected final ClientOptions clientOptions; + + public AsyncRawOpportunitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Opportunity objects. + */ + public CompletableFuture>> list() { + return list(OpportunitiesListRequest.builder().build()); + } + + /** + * Returns a list of Opportunity objects. + */ + public CompletableFuture>> list( + OpportunitiesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Opportunity objects. + */ + public CompletableFuture>> list( + OpportunitiesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStageId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "stage_id", request.getStageId().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedOpportunityList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedOpportunityList.class); + Optional startingAfter = parsedResponse.getNext(); + OpportunitiesListRequest nextRequest = OpportunitiesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Opportunity object with the given values. + */ + public CompletableFuture> create(OpportunityEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Opportunity object with the given values. + */ + public CompletableFuture> create( + OpportunityEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Opportunity object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, OpportunitiesRetrieveRequest.builder().build()); + } + + /** + * Returns an Opportunity object with the given id. + */ + public CompletableFuture> retrieve( + String id, OpportunitiesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Opportunity object with the given id. + */ + public CompletableFuture> retrieve( + String id, OpportunitiesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Opportunity.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates an Opportunity object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedOpportunityEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Opportunity object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedOpportunityEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + OpportunitiesRemoteFieldClassesListRequest nextRequest = + OpportunitiesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/crm/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..63f02a0d7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawPassthroughClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.DataPassthroughRequest; +import com.merge.api.crm.types.RemoteResponse; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/crm/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..2ab6bcb86 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.RemoteKey; +import com.merge.api.crm.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawScopesClient.java b/src/main/java/com/merge/api/crm/AsyncRawScopesClient.java new file mode 100644 index 000000000..e84b6b1ed --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawScopesClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CommonModelScopeApi; +import com.merge.api.crm.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java b/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java new file mode 100644 index 000000000..2c67e19b8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java @@ -0,0 +1,394 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PaginatedStageList; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Stage; +import com.merge.api.crm.types.StagesListRequest; +import com.merge.api.crm.types.StagesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.StagesRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawStagesClient { + protected final ClientOptions clientOptions; + + public AsyncRawStagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Stage objects. + */ + public CompletableFuture>> list() { + return list(StagesListRequest.builder().build()); + } + + /** + * Returns a list of Stage objects. + */ + public CompletableFuture>> list(StagesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Stage objects. + */ + public CompletableFuture>> list( + StagesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/stages"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedStageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedStageList.class); + Optional startingAfter = parsedResponse.getNext(); + StagesListRequest nextRequest = StagesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Stage object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, StagesRetrieveRequest.builder().build()); + } + + /** + * Returns a Stage object with the given id. + */ + public CompletableFuture> retrieve(String id, StagesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Stage object with the given id. + */ + public CompletableFuture> retrieve( + String id, StagesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/stages") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Stage.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + StagesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + StagesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + StagesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/stages/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + StagesRemoteFieldClassesListRequest nextRequest = StagesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..a0f43fa7e --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.PaginatedSyncStatusList; +import com.merge.api.crm.types.SyncStatus; +import com.merge.api.crm.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java b/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java new file mode 100644 index 000000000..84de0cf94 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java @@ -0,0 +1,676 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PaginatedTaskList; +import com.merge.api.crm.types.PatchedTaskEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Task; +import com.merge.api.crm.types.TaskEndpointRequest; +import com.merge.api.crm.types.TaskResponse; +import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; +import com.merge.api.crm.types.TasksRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTasksClient { + protected final ClientOptions clientOptions; + + public AsyncRawTasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Task objects. + */ + public CompletableFuture>> list() { + return list(TasksListRequest.builder().build()); + } + + /** + * Returns a list of Task objects. + */ + public CompletableFuture>> list(TasksListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Task objects. + */ + public CompletableFuture>> list( + TasksListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTaskList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaskList.class); + Optional startingAfter = parsedResponse.getNext(); + TasksListRequest nextRequest = TasksListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Task object with the given values. + */ + public CompletableFuture> create(TaskEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Task object with the given values. + */ + public CompletableFuture> create( + TaskEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Task object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TasksRetrieveRequest.builder().build()); + } + + /** + * Returns a Task object with the given id. + */ + public CompletableFuture> retrieve(String id, TasksRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Task object with the given id. + */ + public CompletableFuture> retrieve( + String id, TasksRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Task.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a Task object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedTaskEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Task object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedTaskEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Task PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Task PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Task POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Task POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + TasksRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + TasksRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + TasksRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + TasksRemoteFieldClassesListRequest nextRequest = TasksRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java b/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java new file mode 100644 index 000000000..e3151fb4e --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java @@ -0,0 +1,466 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PaginatedUserList; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersListRequest; +import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; +import com.merge.api.crm.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email", request.getEmail().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + UsersRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + UsersRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + UsersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersRemoteFieldClassesListRequest nextRequest = UsersRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/crm/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..ba090e57e --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.WebhookReceiver; +import com.merge.api.crm.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/crm/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..4efea1596 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.RemoteKey; +import com.merge.api.crm.types.RemoteKeyForRegenerationRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncScopesClient.java b/src/main/java/com/merge/api/crm/AsyncScopesClient.java new file mode 100644 index 000000000..878888ba9 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CommonModelScopeApi; +import com.merge.api.crm.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncStagesClient.java b/src/main/java/com/merge/api/crm/AsyncStagesClient.java new file mode 100644 index 000000000..d0af772b8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncStagesClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Stage; +import com.merge.api.crm.types.StagesListRequest; +import com.merge.api.crm.types.StagesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.StagesRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncStagesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawStagesClient rawClient; + + public AsyncStagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawStagesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawStagesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Stage objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Stage objects. + */ + public CompletableFuture> list(StagesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Stage objects. + */ + public CompletableFuture> list(StagesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Stage object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Stage object with the given id. + */ + public CompletableFuture retrieve(String id, StagesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Stage object with the given id. + */ + public CompletableFuture retrieve(String id, StagesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + StagesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + StagesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/crm/AsyncSyncStatusClient.java new file mode 100644 index 000000000..14b5ff7e8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.SyncStatus; +import com.merge.api.crm.types.SyncStatusListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncTasksClient.java b/src/main/java/com/merge/api/crm/AsyncTasksClient.java new file mode 100644 index 000000000..2b096606f --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncTasksClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedTaskEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Task; +import com.merge.api.crm.types.TaskEndpointRequest; +import com.merge.api.crm.types.TaskResponse; +import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; +import com.merge.api.crm.types.TasksRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncTasksClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTasksClient rawClient; + + public AsyncTasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTasksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTasksClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Task objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Task objects. + */ + public CompletableFuture> list(TasksListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Task objects. + */ + public CompletableFuture> list(TasksListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Task object with the given values. + */ + public CompletableFuture create(TaskEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Task object with the given values. + */ + public CompletableFuture create(TaskEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Task object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Task object with the given id. + */ + public CompletableFuture retrieve(String id, TasksRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Task object with the given id. + */ + public CompletableFuture retrieve(String id, TasksRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates a Task object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedTaskEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a Task object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedTaskEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Task PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Task PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Task POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Task POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + TasksRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + TasksRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncUsersClient.java b/src/main/java/com/merge/api/crm/AsyncUsersClient.java new file mode 100644 index 000000000..87c1983e4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncUsersClient.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersListRequest; +import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; +import com.merge.api.crm.types.UsersRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + UsersRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + UsersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/crm/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..c7908faef --- /dev/null +++ b/src/main/java/com/merge/api/crm/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.WebhookReceiver; +import com.merge.api.crm.types.WebhookReceiverRequest; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/crm/AuditTrailClient.java b/src/main/java/com/merge/api/crm/AuditTrailClient.java new file mode 100644 index 000000000..1b3fb1724 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AuditLogEvent; +import com.merge.api.crm.types.AuditTrailListRequest; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/AvailableActionsClient.java b/src/main/java/com/merge/api/crm/AvailableActionsClient.java new file mode 100644 index 000000000..c109505d8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AvailableActions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/ContactsClient.java b/src/main/java/com/merge/api/crm/ContactsClient.java new file mode 100644 index 000000000..531d5adb6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/ContactsClient.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.ContactsRetrieveRequest; +import com.merge.api.crm.types.CrmContactEndpointRequest; +import com.merge.api.crm.types.CrmContactResponse; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedCrmContactEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; + +public class ContactsClient { + protected final ClientOptions clientOptions; + + private final RawContactsClient rawClient; + + public ContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawContactsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawContactsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list(ContactsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list(ContactsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Contact object with the given values. + */ + public CrmContactResponse create(CrmContactEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Contact object with the given values. + */ + public CrmContactResponse create(CrmContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id, ContactsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates a Contact object with the given id. + */ + public CrmContactResponse partialUpdate(String id, PatchedCrmContactEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a Contact object with the given id. + */ + public CrmContactResponse partialUpdate( + String id, PatchedCrmContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + this.rawClient.ignoreCreate(modelId, request).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(ContactsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/resources/crm/CrmClient.java b/src/main/java/com/merge/api/crm/CrmClient.java similarity index 80% rename from src/main/java/com/merge/api/resources/crm/CrmClient.java rename to src/main/java/com/merge/api/crm/CrmClient.java index d492b14cb..be1d96631 100644 --- a/src/main/java/com/merge/api/resources/crm/CrmClient.java +++ b/src/main/java/com/merge/api/crm/CrmClient.java @@ -1,41 +1,10 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm; +package com.merge.api.crm; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; -import com.merge.api.resources.crm.accountdetails.AccountDetailsClient; -import com.merge.api.resources.crm.accounts.AccountsClient; -import com.merge.api.resources.crm.accounttoken.AccountTokenClient; -import com.merge.api.resources.crm.associations.AssociationsClient; -import com.merge.api.resources.crm.associationtypes.AssociationTypesClient; -import com.merge.api.resources.crm.asyncpassthrough.AsyncPassthroughClient; -import com.merge.api.resources.crm.audittrail.AuditTrailClient; -import com.merge.api.resources.crm.availableactions.AvailableActionsClient; -import com.merge.api.resources.crm.contacts.ContactsClient; -import com.merge.api.resources.crm.customobjectclasses.CustomObjectClassesClient; -import com.merge.api.resources.crm.customobjects.CustomObjectsClient; -import com.merge.api.resources.crm.deleteaccount.DeleteAccountClient; -import com.merge.api.resources.crm.engagements.EngagementsClient; -import com.merge.api.resources.crm.engagementtypes.EngagementTypesClient; -import com.merge.api.resources.crm.fieldmapping.FieldMappingClient; -import com.merge.api.resources.crm.forceresync.ForceResyncClient; -import com.merge.api.resources.crm.generatekey.GenerateKeyClient; -import com.merge.api.resources.crm.issues.IssuesClient; -import com.merge.api.resources.crm.leads.LeadsClient; -import com.merge.api.resources.crm.linkedaccounts.LinkedAccountsClient; -import com.merge.api.resources.crm.linktoken.LinkTokenClient; -import com.merge.api.resources.crm.notes.NotesClient; -import com.merge.api.resources.crm.opportunities.OpportunitiesClient; -import com.merge.api.resources.crm.passthrough.PassthroughClient; -import com.merge.api.resources.crm.regeneratekey.RegenerateKeyClient; -import com.merge.api.resources.crm.scopes.ScopesClient; -import com.merge.api.resources.crm.stages.StagesClient; -import com.merge.api.resources.crm.syncstatus.SyncStatusClient; -import com.merge.api.resources.crm.tasks.TasksClient; -import com.merge.api.resources.crm.users.UsersClient; -import com.merge.api.resources.crm.webhookreceivers.WebhookReceiversClient; import java.util.function.Supplier; public class CrmClient { diff --git a/src/main/java/com/merge/api/crm/CustomObjectClassesClient.java b/src/main/java/com/merge/api/crm/CustomObjectClassesClient.java new file mode 100644 index 000000000..5bdf5711e --- /dev/null +++ b/src/main/java/com/merge/api/crm/CustomObjectClassesClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CustomObjectClass; +import com.merge.api.crm.types.CustomObjectClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesRetrieveRequest; + +public class CustomObjectClassesClient { + protected final ClientOptions clientOptions; + + private final RawCustomObjectClassesClient rawClient; + + public CustomObjectClassesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCustomObjectClassesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCustomObjectClassesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public SyncPagingIterable list(CustomObjectClassesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public SyncPagingIterable list( + CustomObjectClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CustomObjectClass retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CustomObjectClass retrieve(String id, CustomObjectClassesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public CustomObjectClass retrieve( + String id, CustomObjectClassesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/CustomObjectsClient.java b/src/main/java/com/merge/api/crm/CustomObjectsClient.java new file mode 100644 index 000000000..25974887f --- /dev/null +++ b/src/main/java/com/merge/api/crm/CustomObjectsClient.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CrmCustomObjectEndpointRequest; +import com.merge.api.crm.types.CrmCustomObjectResponse; +import com.merge.api.crm.types.CustomObject; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.RemoteFieldClass; + +public class CustomObjectsClient { + protected final ClientOptions clientOptions; + + private final RawCustomObjectsClient rawClient; + + public CustomObjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCustomObjectsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCustomObjectsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of CustomObject objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsList(String customObjectClassId) { + return this.rawClient + .customObjectClassesCustomObjectsList(customObjectClassId) + .body(); + } + + /** + * Returns a list of CustomObject objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsList( + String customObjectClassId, CustomObjectClassesCustomObjectsListRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsList(customObjectClassId, request) + .body(); + } + + /** + * Returns a list of CustomObject objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsList( + String customObjectClassId, + CustomObjectClassesCustomObjectsListRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsList(customObjectClassId, request, requestOptions) + .body(); + } + + /** + * Creates a CustomObject object with the given values. + */ + public CrmCustomObjectResponse customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsCreate(customObjectClassId, request) + .body(); + } + + /** + * Creates a CustomObject object with the given values. + */ + public CrmCustomObjectResponse customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsCreate(customObjectClassId, request, requestOptions) + .body(); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CustomObject customObjectClassesCustomObjectsRetrieve(String customObjectClassId, String id) { + return this.rawClient + .customObjectClassesCustomObjectsRetrieve(customObjectClassId, id) + .body(); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CustomObject customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, String id, CustomObjectClassesCustomObjectsRetrieveRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsRetrieve(customObjectClassId, id, request) + .body(); + } + + /** + * Returns a CustomObject object with the given id. + */ + public CustomObject customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesCustomObjectsRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsRetrieve(customObjectClassId, id, request, requestOptions) + .body(); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public MetaResponse customObjectClassesCustomObjectsMetaPostRetrieve(String customObjectClassId) { + return this.rawClient + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId) + .body(); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public MetaResponse customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, requestOptions) + .body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsRemoteFieldClassesList() { + return this.rawClient + .customObjectClassesCustomObjectsRemoteFieldClassesList() + .body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request) { + return this.rawClient + .customObjectClassesCustomObjectsRemoteFieldClassesList(request) + .body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsRemoteFieldClassesList(request, requestOptions) + .body(); + } +} diff --git a/src/main/java/com/merge/api/crm/DeleteAccountClient.java b/src/main/java/com/merge/api/crm/DeleteAccountClient.java new file mode 100644 index 000000000..a5f43b826 --- /dev/null +++ b/src/main/java/com/merge/api/crm/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/EngagementTypesClient.java b/src/main/java/com/merge/api/crm/EngagementTypesClient.java new file mode 100644 index 000000000..74075dcc6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/EngagementTypesClient.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.EngagementType; +import com.merge.api.crm.types.EngagementTypesListRequest; +import com.merge.api.crm.types.EngagementTypesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementTypesRetrieveRequest; +import com.merge.api.crm.types.RemoteFieldClass; + +public class EngagementTypesClient { + protected final ClientOptions clientOptions; + + private final RawEngagementTypesClient rawClient; + + public EngagementTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEngagementTypesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEngagementTypesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EngagementType objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of EngagementType objects. + */ + public SyncPagingIterable list(EngagementTypesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of EngagementType objects. + */ + public SyncPagingIterable list(EngagementTypesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an EngagementType object with the given id. + */ + public EngagementType retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an EngagementType object with the given id. + */ + public EngagementType retrieve(String id, EngagementTypesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an EngagementType object with the given id. + */ + public EngagementType retrieve(String id, EngagementTypesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/EngagementsClient.java b/src/main/java/com/merge/api/crm/EngagementsClient.java new file mode 100644 index 000000000..1fb3b7472 --- /dev/null +++ b/src/main/java/com/merge/api/crm/EngagementsClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Engagement; +import com.merge.api.crm.types.EngagementEndpointRequest; +import com.merge.api.crm.types.EngagementResponse; +import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedEngagementEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; + +public class EngagementsClient { + protected final ClientOptions clientOptions; + + private final RawEngagementsClient rawClient; + + public EngagementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEngagementsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEngagementsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Engagement objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Engagement objects. + */ + public SyncPagingIterable list(EngagementsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Engagement objects. + */ + public SyncPagingIterable list(EngagementsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Engagement object with the given values. + */ + public EngagementResponse create(EngagementEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Engagement object with the given values. + */ + public EngagementResponse create(EngagementEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Engagement object with the given id. + */ + public Engagement retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Engagement object with the given id. + */ + public Engagement retrieve(String id, EngagementsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Engagement object with the given id. + */ + public Engagement retrieve(String id, EngagementsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates an Engagement object with the given id. + */ + public EngagementResponse partialUpdate(String id, PatchedEngagementEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates an Engagement object with the given id. + */ + public EngagementResponse partialUpdate( + String id, PatchedEngagementEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for Engagement POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Engagement POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/FieldMappingClient.java b/src/main/java/com/merge/api/crm/FieldMappingClient.java new file mode 100644 index 000000000..f03b639db --- /dev/null +++ b/src/main/java/com/merge/api/crm/FieldMappingClient.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CreateFieldMappingRequest; +import com.merge.api.crm.types.ExternalTargetFieldApiResponse; +import com.merge.api.crm.types.FieldMappingApiInstanceResponse; +import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsRetrieveRequest; +import com.merge.api.crm.types.PatchedEditFieldMappingRequest; +import com.merge.api.crm.types.RemoteFieldApiResponse; +import com.merge.api.crm.types.RemoteFieldsRetrieveRequest; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/ForceResyncClient.java b/src/main/java/com/merge/api/crm/ForceResyncClient.java new file mode 100644 index 000000000..bfda95d39 --- /dev/null +++ b/src/main/java/com/merge/api/crm/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.SyncStatus; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/GenerateKeyClient.java b/src/main/java/com/merge/api/crm/GenerateKeyClient.java new file mode 100644 index 000000000..ea3a1a7da --- /dev/null +++ b/src/main/java/com/merge/api/crm/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.GenerateRemoteKeyRequest; +import com.merge.api.crm.types.RemoteKey; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/IssuesClient.java b/src/main/java/com/merge/api/crm/IssuesClient.java new file mode 100644 index 000000000..f83ecea1f --- /dev/null +++ b/src/main/java/com/merge/api/crm/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Issue; +import com.merge.api.crm.types.IssuesListRequest; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/LeadsClient.java b/src/main/java/com/merge/api/crm/LeadsClient.java new file mode 100644 index 000000000..ffd1f2be1 --- /dev/null +++ b/src/main/java/com/merge/api/crm/LeadsClient.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Lead; +import com.merge.api.crm.types.LeadEndpointRequest; +import com.merge.api.crm.types.LeadResponse; +import com.merge.api.crm.types.LeadsListRequest; +import com.merge.api.crm.types.LeadsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.LeadsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.RemoteFieldClass; + +public class LeadsClient { + protected final ClientOptions clientOptions; + + private final RawLeadsClient rawClient; + + public LeadsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLeadsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLeadsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Lead objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Lead objects. + */ + public SyncPagingIterable list(LeadsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Lead objects. + */ + public SyncPagingIterable list(LeadsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Lead object with the given values. + */ + public LeadResponse create(LeadEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Lead object with the given values. + */ + public LeadResponse create(LeadEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Lead object with the given id. + */ + public Lead retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Lead object with the given id. + */ + public Lead retrieve(String id, LeadsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Lead object with the given id. + */ + public Lead retrieve(String id, LeadsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Lead POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Lead POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(LeadsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/LinkTokenClient.java b/src/main/java/com/merge/api/crm/LinkTokenClient.java new file mode 100644 index 000000000..d8eb036aa --- /dev/null +++ b/src/main/java/com/merge/api/crm/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.EndUserDetailsRequest; +import com.merge.api.crm.types.LinkToken; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/LinkedAccountsClient.java b/src/main/java/com/merge/api/crm/LinkedAccountsClient.java new file mode 100644 index 000000000..1cfc20eb4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AccountDetailsAndActions; +import com.merge.api.crm.types.LinkedAccountsListRequest; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/NotesClient.java b/src/main/java/com/merge/api/crm/NotesClient.java new file mode 100644 index 000000000..e9e5895ba --- /dev/null +++ b/src/main/java/com/merge/api/crm/NotesClient.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.Note; +import com.merge.api.crm.types.NoteEndpointRequest; +import com.merge.api.crm.types.NoteResponse; +import com.merge.api.crm.types.NotesListRequest; +import com.merge.api.crm.types.NotesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.NotesRetrieveRequest; +import com.merge.api.crm.types.RemoteFieldClass; + +public class NotesClient { + protected final ClientOptions clientOptions; + + private final RawNotesClient rawClient; + + public NotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawNotesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawNotesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Note objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Note objects. + */ + public SyncPagingIterable list(NotesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Note objects. + */ + public SyncPagingIterable list(NotesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Note object with the given values. + */ + public NoteResponse create(NoteEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Note object with the given values. + */ + public NoteResponse create(NoteEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Note object with the given id. + */ + public Note retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Note object with the given id. + */ + public Note retrieve(String id, NotesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Note object with the given id. + */ + public Note retrieve(String id, NotesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Note POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Note POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(NotesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + NotesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/OpportunitiesClient.java b/src/main/java/com/merge/api/crm/OpportunitiesClient.java new file mode 100644 index 000000000..fa961cca7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/OpportunitiesClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.OpportunitiesRetrieveRequest; +import com.merge.api.crm.types.Opportunity; +import com.merge.api.crm.types.OpportunityEndpointRequest; +import com.merge.api.crm.types.OpportunityResponse; +import com.merge.api.crm.types.PatchedOpportunityEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; + +public class OpportunitiesClient { + protected final ClientOptions clientOptions; + + private final RawOpportunitiesClient rawClient; + + public OpportunitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawOpportunitiesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawOpportunitiesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Opportunity objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Opportunity objects. + */ + public SyncPagingIterable list(OpportunitiesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Opportunity objects. + */ + public SyncPagingIterable list(OpportunitiesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Opportunity object with the given values. + */ + public OpportunityResponse create(OpportunityEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Opportunity object with the given values. + */ + public OpportunityResponse create(OpportunityEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Opportunity object with the given id. + */ + public Opportunity retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Opportunity object with the given id. + */ + public Opportunity retrieve(String id, OpportunitiesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Opportunity object with the given id. + */ + public Opportunity retrieve(String id, OpportunitiesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates an Opportunity object with the given id. + */ + public OpportunityResponse partialUpdate(String id, PatchedOpportunityEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates an Opportunity object with the given id. + */ + public OpportunityResponse partialUpdate( + String id, PatchedOpportunityEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/PassthroughClient.java b/src/main/java/com/merge/api/crm/PassthroughClient.java new file mode 100644 index 000000000..39aefb2d0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.DataPassthroughRequest; +import com.merge.api.crm.types.RemoteResponse; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/RawAccountDetailsClient.java b/src/main/java/com/merge/api/crm/RawAccountDetailsClient.java new file mode 100644 index 000000000..9e90dc88b --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAccountDetailsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountDetails; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawAccountTokenClient.java b/src/main/java/com/merge/api/crm/RawAccountTokenClient.java new file mode 100644 index 000000000..c88cb62da --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAccountTokenClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AccountToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawAccountsClient.java b/src/main/java/com/merge/api/crm/RawAccountsClient.java new file mode 100644 index 000000000..fdca534d2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAccountsClient.java @@ -0,0 +1,569 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Account; +import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.AccountsRetrieveRequest; +import com.merge.api.crm.types.CrmAccountEndpointRequest; +import com.merge.api.crm.types.CrmAccountResponse; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedAccountList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedCrmAccountEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountsClient { + protected final ClientOptions clientOptions; + + public RawAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list() { + return list(AccountsListRequest.builder().build()); + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list(AccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list( + AccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsListRequest nextRequest = AccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Account object with the given values. + */ + public MergeApiHttpResponse create(CrmAccountEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Account object with the given values. + */ + public MergeApiHttpResponse create( + CrmAccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AccountsRetrieveRequest.builder().build()); + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates an Account object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedCrmAccountEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Account object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedCrmAccountEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for CRMAccount POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + AccountsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/accounts/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsRemoteFieldClassesListRequest nextRequest = AccountsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java b/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java new file mode 100644 index 000000000..74c220809 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java @@ -0,0 +1,359 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AssociationType; +import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; +import com.merge.api.crm.types.CrmAssociationTypeResponse; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedAssociationTypeList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAssociationTypesClient { + protected final ClientOptions clientOptions; + + public RawAssociationTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of AssociationType objects. + */ + public MergeApiHttpResponse> customObjectClassesAssociationTypesList( + String customObjectClassId) { + return customObjectClassesAssociationTypesList( + customObjectClassId, + CustomObjectClassesAssociationTypesListRequest.builder().build()); + } + + /** + * Returns a list of AssociationType objects. + */ + public MergeApiHttpResponse> customObjectClassesAssociationTypesList( + String customObjectClassId, CustomObjectClassesAssociationTypesListRequest request) { + return customObjectClassesAssociationTypesList(customObjectClassId, request, null); + } + + /** + * Returns a list of AssociationType objects. + */ + public MergeApiHttpResponse> customObjectClassesAssociationTypesList( + String customObjectClassId, + CustomObjectClassesAssociationTypesListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAssociationTypeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAssociationTypeList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesAssociationTypesListRequest nextRequest = + CustomObjectClassesAssociationTypesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> customObjectClassesAssociationTypesList( + customObjectClassId, nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an AssociationType object with the given values. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesCreate( + String customObjectClassId, CrmAssociationTypeEndpointRequest request) { + return customObjectClassesAssociationTypesCreate(customObjectClassId, request, null); + } + + /** + * Creates an AssociationType object with the given values. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesCreate( + String customObjectClassId, CrmAssociationTypeEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAssociationTypeResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an AssociationType object with the given id. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, String id) { + return customObjectClassesAssociationTypesRetrieve( + customObjectClassId, + id, + CustomObjectClassesAssociationTypesRetrieveRequest.builder().build()); + } + + /** + * Returns an AssociationType object with the given id. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, String id, CustomObjectClassesAssociationTypesRetrieveRequest request) { + return customObjectClassesAssociationTypesRetrieve(customObjectClassId, id, request, null); + } + + /** + * Returns an AssociationType object with the given id. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesAssociationTypesRetrieveRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AssociationType.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId) { + return customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, null); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("association-types/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawAssociationsClient.java b/src/main/java/com/merge/api/crm/RawAssociationsClient.java new file mode 100644 index 000000000..2996319bc --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAssociationsClient.java @@ -0,0 +1,269 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Association; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsAssociationsUpdateRequest; +import com.merge.api.crm.types.PaginatedAssociationList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAssociationsClient { + protected final ClientOptions clientOptions; + + public RawAssociationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Association objects. + */ + public MergeApiHttpResponse> customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, String objectId) { + return customObjectClassesCustomObjectsAssociationsList( + customObjectClassId, + objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest.builder() + .build()); + } + + /** + * Returns a list of Association objects. + */ + public MergeApiHttpResponse> customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request) { + return customObjectClassesCustomObjectsAssociationsList(customObjectClassId, objectId, request, null); + } + + /** + * Returns a list of Association objects. + */ + public MergeApiHttpResponse> customObjectClassesCustomObjectsAssociationsList( + String customObjectClassId, + String objectId, + CustomObjectClassesCustomObjectsAssociationsListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects") + .addPathSegment(objectId) + .addPathSegments("associations"); + if (request.getAssociationTypeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "association_type_id", + request.getAssociationTypeId().get(), + false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAssociationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAssociationList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesCustomObjectsAssociationsListRequest nextRequest = + CustomObjectClassesCustomObjectsAssociationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), + result, + () -> customObjectClassesCustomObjectsAssociationsList( + customObjectClassId, objectId, nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId) { + return customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, + sourceClassId, + sourceObjectId, + targetClassId, + targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest.builder() + .build()); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request) { + return customObjectClassesCustomObjectsAssociationsUpdate( + associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId, request, null); + } + + /** + * Creates an Association between source_object_id and target_object_id of type association_type_id. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsAssociationsUpdate( + String associationTypeId, + String sourceClassId, + String sourceObjectId, + String targetClassId, + String targetObjectId, + CustomObjectClassesCustomObjectsAssociationsUpdateRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(sourceClassId) + .addPathSegments("custom-objects") + .addPathSegment(sourceObjectId) + .addPathSegments("associations") + .addPathSegment(targetClassId) + .addPathSegment(targetObjectId) + .addPathSegment(associationTypeId); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PUT", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Association.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..6d1288595 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AsyncPassthroughReciept; +import com.merge.api.crm.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.crm.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawAuditTrailClient.java b/src/main/java/com/merge/api/crm/RawAuditTrailClient.java new file mode 100644 index 000000000..3cf4a02b7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAuditTrailClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AuditLogEvent; +import com.merge.api.crm.types.AuditTrailListRequest; +import com.merge.api.crm.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawAvailableActionsClient.java b/src/main/java/com/merge/api/crm/RawAvailableActionsClient.java new file mode 100644 index 000000000..afbde58e3 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawAvailableActionsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.AvailableActions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawContactsClient.java b/src/main/java/com/merge/api/crm/RawContactsClient.java new file mode 100644 index 000000000..8ff1907ee --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawContactsClient.java @@ -0,0 +1,625 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.ContactsRetrieveRequest; +import com.merge.api.crm.types.CrmContactEndpointRequest; +import com.merge.api.crm.types.CrmContactResponse; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedContactList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedCrmContactEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawContactsClient { + protected final ClientOptions clientOptions; + + public RawContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list() { + return list(ContactsListRequest.builder().build()); + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list(ContactsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list( + ContactsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddresses().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_addresses", request.getEmailAddresses().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPhoneNumbers().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "phone_numbers", request.getPhoneNumbers().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedContactList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsListRequest nextRequest = ContactsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Contact object with the given values. + */ + public MergeApiHttpResponse create(CrmContactEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Contact object with the given values. + */ + public MergeApiHttpResponse create( + CrmContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ContactsRetrieveRequest.builder().build()); + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ContactsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a Contact object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedCrmContactEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Contact object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedCrmContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for CRMContact POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/contacts/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java b/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java new file mode 100644 index 000000000..f78efe5f6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CustomObjectClass; +import com.merge.api.crm.types.CustomObjectClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesRetrieveRequest; +import com.merge.api.crm.types.PaginatedCustomObjectClassList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCustomObjectClassesClient { + protected final ClientOptions clientOptions; + + public RawCustomObjectClassesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public MergeApiHttpResponse> list() { + return list(CustomObjectClassesListRequest.builder().build()); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public MergeApiHttpResponse> list(CustomObjectClassesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of CustomObjectClass objects. + */ + public MergeApiHttpResponse> list( + CustomObjectClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCustomObjectClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCustomObjectClassList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesListRequest nextRequest = CustomObjectClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CustomObjectClassesRetrieveRequest.builder().build()); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CustomObjectClassesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a CustomObjectClass object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CustomObjectClassesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObjectClass.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java b/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java new file mode 100644 index 000000000..23ed9fc93 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java @@ -0,0 +1,483 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.CrmCustomObjectEndpointRequest; +import com.merge.api.crm.types.CrmCustomObjectResponse; +import com.merge.api.crm.types.CustomObject; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedCustomObjectList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCustomObjectsClient { + protected final ClientOptions clientOptions; + + public RawCustomObjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of CustomObject objects. + */ + public MergeApiHttpResponse> customObjectClassesCustomObjectsList( + String customObjectClassId) { + return customObjectClassesCustomObjectsList( + customObjectClassId, + CustomObjectClassesCustomObjectsListRequest.builder().build()); + } + + /** + * Returns a list of CustomObject objects. + */ + public MergeApiHttpResponse> customObjectClassesCustomObjectsList( + String customObjectClassId, CustomObjectClassesCustomObjectsListRequest request) { + return customObjectClassesCustomObjectsList(customObjectClassId, request, null); + } + + /** + * Returns a list of CustomObject objects. + */ + public MergeApiHttpResponse> customObjectClassesCustomObjectsList( + String customObjectClassId, + CustomObjectClassesCustomObjectsListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCustomObjectList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCustomObjectList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesCustomObjectsListRequest nextRequest = + CustomObjectClassesCustomObjectsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> customObjectClassesCustomObjectsList( + customObjectClassId, nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a CustomObject object with the given values. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request) { + return customObjectClassesCustomObjectsCreate(customObjectClassId, request, null); + } + + /** + * Creates a CustomObject object with the given values. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsCreate( + String customObjectClassId, CrmCustomObjectEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmCustomObjectResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a CustomObject object with the given id. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, String id) { + return customObjectClassesCustomObjectsRetrieve( + customObjectClassId, + id, + CustomObjectClassesCustomObjectsRetrieveRequest.builder().build()); + } + + /** + * Returns a CustomObject object with the given id. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, String id, CustomObjectClassesCustomObjectsRetrieveRequest request) { + return customObjectClassesCustomObjectsRetrieve(customObjectClassId, id, request, null); + } + + /** + * Returns a CustomObject object with the given id. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsRetrieve( + String customObjectClassId, + String id, + CustomObjectClassesCustomObjectsRetrieveRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObject.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId) { + return customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, null); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes") + .addPathSegment(customObjectClassId) + .addPathSegments("custom-objects/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> + customObjectClassesCustomObjectsRemoteFieldClassesList() { + return customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() + .build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> + customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request) { + return customObjectClassesCustomObjectsRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> + customObjectClassesCustomObjectsRemoteFieldClassesList( + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/custom-object-classes/custom-objects/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest nextRequest = + CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), + result, + () -> customObjectClassesCustomObjectsRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawDeleteAccountClient.java b/src/main/java/com/merge/api/crm/RawDeleteAccountClient.java new file mode 100644 index 000000000..8fd7019a9 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawDeleteAccountClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java b/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java new file mode 100644 index 000000000..9e8b541ac --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.EngagementType; +import com.merge.api.crm.types.EngagementTypesListRequest; +import com.merge.api.crm.types.EngagementTypesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementTypesRetrieveRequest; +import com.merge.api.crm.types.PaginatedEngagementTypeList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEngagementTypesClient { + protected final ClientOptions clientOptions; + + public RawEngagementTypesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EngagementType objects. + */ + public MergeApiHttpResponse> list() { + return list(EngagementTypesListRequest.builder().build()); + } + + /** + * Returns a list of EngagementType objects. + */ + public MergeApiHttpResponse> list(EngagementTypesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EngagementType objects. + */ + public MergeApiHttpResponse> list( + EngagementTypesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagement-types"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEngagementTypeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEngagementTypeList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementTypesListRequest nextRequest = EngagementTypesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an EngagementType object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EngagementTypesRetrieveRequest.builder().build()); + } + + /** + * Returns an EngagementType object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EngagementTypesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EngagementType object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, EngagementTypesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagement-types") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementType.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + EngagementTypesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagement-types/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementTypesRemoteFieldClassesListRequest nextRequest = + EngagementTypesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawEngagementsClient.java b/src/main/java/com/merge/api/crm/RawEngagementsClient.java new file mode 100644 index 000000000..dd895ac1a --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawEngagementsClient.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Engagement; +import com.merge.api.crm.types.EngagementEndpointRequest; +import com.merge.api.crm.types.EngagementResponse; +import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.EngagementsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedEngagementList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedEngagementEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEngagementsClient { + protected final ClientOptions clientOptions; + + public RawEngagementsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Engagement objects. + */ + public MergeApiHttpResponse> list() { + return list(EngagementsListRequest.builder().build()); + } + + /** + * Returns a list of Engagement objects. + */ + public MergeApiHttpResponse> list(EngagementsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Engagement objects. + */ + public MergeApiHttpResponse> list( + EngagementsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEngagementList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEngagementList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementsListRequest nextRequest = EngagementsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Engagement object with the given values. + */ + public MergeApiHttpResponse create(EngagementEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Engagement object with the given values. + */ + public MergeApiHttpResponse create( + EngagementEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Engagement object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EngagementsRetrieveRequest.builder().build()); + } + + /** + * Returns an Engagement object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EngagementsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Engagement object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, EngagementsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Engagement.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates an Engagement object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedEngagementEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Engagement object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedEngagementEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Engagement POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Engagement POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + EngagementsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/engagements/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + EngagementsRemoteFieldClassesListRequest nextRequest = + EngagementsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawFieldMappingClient.java b/src/main/java/com/merge/api/crm/RawFieldMappingClient.java new file mode 100644 index 000000000..04c68a631 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawFieldMappingClient.java @@ -0,0 +1,380 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CreateFieldMappingRequest; +import com.merge.api.crm.types.ExternalTargetFieldApiResponse; +import com.merge.api.crm.types.FieldMappingApiInstanceResponse; +import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsRetrieveRequest; +import com.merge.api.crm.types.PatchedEditFieldMappingRequest; +import com.merge.api.crm.types.RemoteFieldApiResponse; +import com.merge.api.crm.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawForceResyncClient.java b/src/main/java/com/merge/api/crm/RawForceResyncClient.java new file mode 100644 index 000000000..3b49ff2d7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawForceResyncClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawGenerateKeyClient.java b/src/main/java/com/merge/api/crm/RawGenerateKeyClient.java new file mode 100644 index 000000000..5745b4486 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawGenerateKeyClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.GenerateRemoteKeyRequest; +import com.merge.api.crm.types.RemoteKey; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawIssuesClient.java b/src/main/java/com/merge/api/crm/RawIssuesClient.java new file mode 100644 index 000000000..d6b846c59 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawIssuesClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Issue; +import com.merge.api.crm.types.IssuesListRequest; +import com.merge.api.crm.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawLeadsClient.java b/src/main/java/com/merge/api/crm/RawLeadsClient.java new file mode 100644 index 000000000..65380154a --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawLeadsClient.java @@ -0,0 +1,479 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.Lead; +import com.merge.api.crm.types.LeadEndpointRequest; +import com.merge.api.crm.types.LeadResponse; +import com.merge.api.crm.types.LeadsListRequest; +import com.merge.api.crm.types.LeadsRemoteFieldClassesListRequest; +import com.merge.api.crm.types.LeadsRetrieveRequest; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedLeadList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLeadsClient { + protected final ClientOptions clientOptions; + + public RawLeadsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Lead objects. + */ + public MergeApiHttpResponse> list() { + return list(LeadsListRequest.builder().build()); + } + + /** + * Returns a list of Lead objects. + */ + public MergeApiHttpResponse> list(LeadsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Lead objects. + */ + public MergeApiHttpResponse> list( + LeadsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads"); + if (request.getConvertedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "converted_account_id", + request.getConvertedAccountId().get(), + false); + } + if (request.getConvertedContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "converted_contact_id", + request.getConvertedContactId().get(), + false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddresses().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_addresses", request.getEmailAddresses().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPhoneNumbers().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "phone_numbers", request.getPhoneNumbers().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedLeadList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLeadList.class); + Optional startingAfter = parsedResponse.getNext(); + LeadsListRequest nextRequest = LeadsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Lead object with the given values. + */ + public MergeApiHttpResponse create(LeadEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Lead object with the given values. + */ + public MergeApiHttpResponse create(LeadEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LeadResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Lead object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, LeadsRetrieveRequest.builder().build()); + } + + /** + * Returns a Lead object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, LeadsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Lead object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, LeadsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Lead.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Lead POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Lead POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + LeadsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/leads/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + LeadsRemoteFieldClassesListRequest nextRequest = LeadsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawLinkTokenClient.java b/src/main/java/com/merge/api/crm/RawLinkTokenClient.java new file mode 100644 index 000000000..96d1ba0e1 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawLinkTokenClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.EndUserDetailsRequest; +import com.merge.api.crm.types.LinkToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java new file mode 100644 index 000000000..2c4686ca3 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.AccountDetailsAndActions; +import com.merge.api.crm.types.LinkedAccountsListRequest; +import com.merge.api.crm.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawNotesClient.java b/src/main/java/com/merge/api/crm/RawNotesClient.java new file mode 100644 index 000000000..30a560670 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawNotesClient.java @@ -0,0 +1,469 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.Note; +import com.merge.api.crm.types.NoteEndpointRequest; +import com.merge.api.crm.types.NoteResponse; +import com.merge.api.crm.types.NotesListRequest; +import com.merge.api.crm.types.NotesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.NotesRetrieveRequest; +import com.merge.api.crm.types.PaginatedNoteList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawNotesClient { + protected final ClientOptions clientOptions; + + public RawNotesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Note objects. + */ + public MergeApiHttpResponse> list() { + return list(NotesListRequest.builder().build()); + } + + /** + * Returns a list of Note objects. + */ + public MergeApiHttpResponse> list(NotesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Note objects. + */ + public MergeApiHttpResponse> list( + NotesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOpportunityId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "opportunity_id", request.getOpportunityId().get(), false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedNoteList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedNoteList.class); + Optional startingAfter = parsedResponse.getNext(); + NotesListRequest nextRequest = NotesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Note object with the given values. + */ + public MergeApiHttpResponse create(NoteEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Note object with the given values. + */ + public MergeApiHttpResponse create(NoteEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Note object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, NotesRetrieveRequest.builder().build()); + } + + /** + * Returns a Note object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, NotesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Note object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, NotesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Note.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Note POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Note POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + NotesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + NotesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + NotesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/notes/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + NotesRemoteFieldClassesListRequest nextRequest = NotesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java b/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java new file mode 100644 index 000000000..c481bff19 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java @@ -0,0 +1,604 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.OpportunitiesRetrieveRequest; +import com.merge.api.crm.types.Opportunity; +import com.merge.api.crm.types.OpportunityEndpointRequest; +import com.merge.api.crm.types.OpportunityResponse; +import com.merge.api.crm.types.PaginatedOpportunityList; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PatchedOpportunityEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawOpportunitiesClient { + protected final ClientOptions clientOptions; + + public RawOpportunitiesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Opportunity objects. + */ + public MergeApiHttpResponse> list() { + return list(OpportunitiesListRequest.builder().build()); + } + + /** + * Returns a list of Opportunity objects. + */ + public MergeApiHttpResponse> list(OpportunitiesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Opportunity objects. + */ + public MergeApiHttpResponse> list( + OpportunitiesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOwnerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "owner_id", request.getOwnerId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStageId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "stage_id", request.getStageId().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedOpportunityList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOpportunityList.class); + Optional startingAfter = parsedResponse.getNext(); + OpportunitiesListRequest nextRequest = OpportunitiesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Opportunity object with the given values. + */ + public MergeApiHttpResponse create(OpportunityEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Opportunity object with the given values. + */ + public MergeApiHttpResponse create( + OpportunityEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Opportunity object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, OpportunitiesRetrieveRequest.builder().build()); + } + + /** + * Returns an Opportunity object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, OpportunitiesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Opportunity object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, OpportunitiesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Opportunity.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates an Opportunity object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedOpportunityEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates an Opportunity object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedOpportunityEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Opportunity POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + OpportunitiesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/opportunities/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + OpportunitiesRemoteFieldClassesListRequest nextRequest = + OpportunitiesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawPassthroughClient.java b/src/main/java/com/merge/api/crm/RawPassthroughClient.java new file mode 100644 index 000000000..9a16a2536 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawPassthroughClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.DataPassthroughRequest; +import com.merge.api.crm.types.RemoteResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/crm/RawRegenerateKeyClient.java new file mode 100644 index 000000000..f9233b2b9 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawRegenerateKeyClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.RemoteKey; +import com.merge.api.crm.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawScopesClient.java b/src/main/java/com/merge/api/crm/RawScopesClient.java new file mode 100644 index 000000000..1d44f8ae2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawScopesClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CommonModelScopeApi; +import com.merge.api.crm.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawStagesClient.java b/src/main/java/com/merge/api/crm/RawStagesClient.java new file mode 100644 index 000000000..f345b2bda --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawStagesClient.java @@ -0,0 +1,337 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PaginatedStageList; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Stage; +import com.merge.api.crm.types.StagesListRequest; +import com.merge.api.crm.types.StagesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.StagesRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawStagesClient { + protected final ClientOptions clientOptions; + + public RawStagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Stage objects. + */ + public MergeApiHttpResponse> list() { + return list(StagesListRequest.builder().build()); + } + + /** + * Returns a list of Stage objects. + */ + public MergeApiHttpResponse> list(StagesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Stage objects. + */ + public MergeApiHttpResponse> list( + StagesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/stages"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedStageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedStageList.class); + Optional startingAfter = parsedResponse.getNext(); + StagesListRequest nextRequest = StagesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Stage object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, StagesRetrieveRequest.builder().build()); + } + + /** + * Returns a Stage object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, StagesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Stage object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, StagesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/stages") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Stage.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + StagesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + StagesRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + StagesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/stages/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + StagesRemoteFieldClassesListRequest nextRequest = StagesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawSyncStatusClient.java b/src/main/java/com/merge/api/crm/RawSyncStatusClient.java new file mode 100644 index 000000000..389c6fc71 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawSyncStatusClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.PaginatedSyncStatusList; +import com.merge.api.crm.types.SyncStatus; +import com.merge.api.crm.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawTasksClient.java b/src/main/java/com/merge/api/crm/RawTasksClient.java new file mode 100644 index 000000000..a4470dbe6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawTasksClient.java @@ -0,0 +1,559 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PaginatedTaskList; +import com.merge.api.crm.types.PatchedTaskEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Task; +import com.merge.api.crm.types.TaskEndpointRequest; +import com.merge.api.crm.types.TaskResponse; +import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; +import com.merge.api.crm.types.TasksRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTasksClient { + protected final ClientOptions clientOptions; + + public RawTasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Task objects. + */ + public MergeApiHttpResponse> list() { + return list(TasksListRequest.builder().build()); + } + + /** + * Returns a list of Task objects. + */ + public MergeApiHttpResponse> list(TasksListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Task objects. + */ + public MergeApiHttpResponse> list( + TasksListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTaskList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaskList.class); + Optional startingAfter = parsedResponse.getNext(); + TasksListRequest nextRequest = TasksListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Task object with the given values. + */ + public MergeApiHttpResponse create(TaskEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Task object with the given values. + */ + public MergeApiHttpResponse create(TaskEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Task object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TasksRetrieveRequest.builder().build()); + } + + /** + * Returns a Task object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TasksRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Task object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TasksRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Task.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a Task object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedTaskEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Task object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedTaskEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Task PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Task PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Task POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Task POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + TasksRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + TasksRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + TasksRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/tasks/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + TasksRemoteFieldClassesListRequest nextRequest = TasksRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawUsersClient.java b/src/main/java/com/merge/api/crm/RawUsersClient.java new file mode 100644 index 000000000..9582d7f4a --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawUsersClient.java @@ -0,0 +1,394 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.PaginatedRemoteFieldClassList; +import com.merge.api.crm.types.PaginatedUserList; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersListRequest; +import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; +import com.merge.api.crm.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email", request.getEmail().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + UsersRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + UsersRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + UsersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/users/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersRemoteFieldClassesListRequest nextRequest = UsersRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/crm/RawWebhookReceiversClient.java new file mode 100644 index 000000000..4a6b8ef73 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RawWebhookReceiversClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.WebhookReceiver; +import com.merge.api.crm.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("crm/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/crm/RegenerateKeyClient.java b/src/main/java/com/merge/api/crm/RegenerateKeyClient.java new file mode 100644 index 000000000..dbd8fefc0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.RemoteKey; +import com.merge.api.crm.types.RemoteKeyForRegenerationRequest; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/ScopesClient.java b/src/main/java/com/merge/api/crm/ScopesClient.java new file mode 100644 index 000000000..dcebb9ead --- /dev/null +++ b/src/main/java/com/merge/api/crm/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.CommonModelScopeApi; +import com.merge.api.crm.types.LinkedAccountCommonModelScopeDeserializerRequest; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/StagesClient.java b/src/main/java/com/merge/api/crm/StagesClient.java new file mode 100644 index 000000000..178b07253 --- /dev/null +++ b/src/main/java/com/merge/api/crm/StagesClient.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Stage; +import com.merge.api.crm.types.StagesListRequest; +import com.merge.api.crm.types.StagesRemoteFieldClassesListRequest; +import com.merge.api.crm.types.StagesRetrieveRequest; + +public class StagesClient { + protected final ClientOptions clientOptions; + + private final RawStagesClient rawClient; + + public StagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawStagesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawStagesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Stage objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Stage objects. + */ + public SyncPagingIterable list(StagesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Stage objects. + */ + public SyncPagingIterable list(StagesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Stage object with the given id. + */ + public Stage retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Stage object with the given id. + */ + public Stage retrieve(String id, StagesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Stage object with the given id. + */ + public Stage retrieve(String id, StagesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(StagesRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + StagesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/SyncStatusClient.java b/src/main/java/com/merge/api/crm/SyncStatusClient.java new file mode 100644 index 000000000..ea2e83216 --- /dev/null +++ b/src/main/java/com/merge/api/crm/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.SyncStatus; +import com.merge.api.crm.types.SyncStatusListRequest; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/TasksClient.java b/src/main/java/com/merge/api/crm/TasksClient.java new file mode 100644 index 000000000..7b7f59ecb --- /dev/null +++ b/src/main/java/com/merge/api/crm/TasksClient.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.MetaResponse; +import com.merge.api.crm.types.PatchedTaskEndpointRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.Task; +import com.merge.api.crm.types.TaskEndpointRequest; +import com.merge.api.crm.types.TaskResponse; +import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; +import com.merge.api.crm.types.TasksRetrieveRequest; + +public class TasksClient { + protected final ClientOptions clientOptions; + + private final RawTasksClient rawClient; + + public TasksClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTasksClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTasksClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Task objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Task objects. + */ + public SyncPagingIterable list(TasksListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Task objects. + */ + public SyncPagingIterable list(TasksListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Task object with the given values. + */ + public TaskResponse create(TaskEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Task object with the given values. + */ + public TaskResponse create(TaskEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Task object with the given id. + */ + public Task retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Task object with the given id. + */ + public Task retrieve(String id, TasksRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Task object with the given id. + */ + public Task retrieve(String id, TasksRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates a Task object with the given id. + */ + public TaskResponse partialUpdate(String id, PatchedTaskEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a Task object with the given id. + */ + public TaskResponse partialUpdate(String id, PatchedTaskEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Task PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Task PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for Task POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Task POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(TasksRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + TasksRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/UsersClient.java b/src/main/java/com/merge/api/crm/UsersClient.java new file mode 100644 index 000000000..1afed99fb --- /dev/null +++ b/src/main/java/com/merge/api/crm/UsersClient.java @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.IgnoreCommonModelRequest; +import com.merge.api.crm.types.RemoteFieldClass; +import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersListRequest; +import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; +import com.merge.api.crm.types.UsersRetrieveRequest; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + this.rawClient.ignoreCreate(modelId, request).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(UsersRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + UsersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/WebhookReceiversClient.java b/src/main/java/com/merge/api/crm/WebhookReceiversClient.java new file mode 100644 index 000000000..111e83939 --- /dev/null +++ b/src/main/java/com/merge/api/crm/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.crm.types.WebhookReceiver; +import com.merge.api.crm.types.WebhookReceiverRequest; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/crm/types/Account.java b/src/main/java/com/merge/api/crm/types/Account.java new file mode 100644 index 000000000..0ddb03849 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/Account.java @@ -0,0 +1,610 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Account.Builder.class) +public final class Account { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional owner; + + private final Optional name; + + private final Optional description; + + private final Optional industry; + + private final Optional website; + + private final Optional numberOfEmployees; + + private final Optional> addresses; + + private final Optional> phoneNumbers; + + private final Optional lastActivityAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteCreatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Account( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional owner, + Optional name, + Optional description, + Optional industry, + Optional website, + Optional numberOfEmployees, + Optional> addresses, + Optional> phoneNumbers, + Optional lastActivityAt, + Optional remoteUpdatedAt, + Optional remoteCreatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.owner = owner; + this.name = name; + this.description = description; + this.industry = industry; + this.website = website; + this.numberOfEmployees = numberOfEmployees; + this.addresses = addresses; + this.phoneNumbers = phoneNumbers; + this.lastActivityAt = lastActivityAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The account's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The account's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The account's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The account's industry. + */ + @JsonProperty("industry") + public Optional getIndustry() { + return industry; + } + + /** + * @return The account's website. + */ + @JsonProperty("website") + public Optional getWebsite() { + return website; + } + + /** + * @return The account's number of employees. + */ + @JsonProperty("number_of_employees") + public Optional getNumberOfEmployees() { + return numberOfEmployees; + } + + @JsonProperty("addresses") + public Optional> getAddresses() { + return addresses; + } + + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + /** + * @return The last date (either most recent or furthest in the future) of when an activity occurs in an account. + */ + @JsonProperty("last_activity_at") + public Optional getLastActivityAt() { + return lastActivityAt; + } + + /** + * @return When the CRM system account data was last modified by a user with a login. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return When the third party's account was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Account && equalTo((Account) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Account other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && owner.equals(other.owner) + && name.equals(other.name) + && description.equals(other.description) + && industry.equals(other.industry) + && website.equals(other.website) + && numberOfEmployees.equals(other.numberOfEmployees) + && addresses.equals(other.addresses) + && phoneNumbers.equals(other.phoneNumbers) + && lastActivityAt.equals(other.lastActivityAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.owner, + this.name, + this.description, + this.industry, + this.website, + this.numberOfEmployees, + this.addresses, + this.phoneNumbers, + this.lastActivityAt, + this.remoteUpdatedAt, + this.remoteCreatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional industry = Optional.empty(); + + private Optional website = Optional.empty(); + + private Optional numberOfEmployees = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional lastActivityAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Account other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + owner(other.getOwner()); + name(other.getName()); + description(other.getDescription()); + industry(other.getIndustry()); + website(other.getWebsite()); + numberOfEmployees(other.getNumberOfEmployees()); + addresses(other.getAddresses()); + phoneNumbers(other.getPhoneNumbers()); + lastActivityAt(other.getLastActivityAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(AccountOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "industry", nulls = Nulls.SKIP) + public Builder industry(Optional industry) { + this.industry = industry; + return this; + } + + public Builder industry(String industry) { + this.industry = Optional.ofNullable(industry); + return this; + } + + @JsonSetter(value = "website", nulls = Nulls.SKIP) + public Builder website(Optional website) { + this.website = website; + return this; + } + + public Builder website(String website) { + this.website = Optional.ofNullable(website); + return this; + } + + @JsonSetter(value = "number_of_employees", nulls = Nulls.SKIP) + public Builder numberOfEmployees(Optional numberOfEmployees) { + this.numberOfEmployees = numberOfEmployees; + return this; + } + + public Builder numberOfEmployees(Integer numberOfEmployees) { + this.numberOfEmployees = Optional.ofNullable(numberOfEmployees); + return this; + } + + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) + public Builder addresses(Optional> addresses) { + this.addresses = addresses; + return this; + } + + public Builder addresses(List

addresses) { + this.addresses = Optional.ofNullable(addresses); + return this; + } + + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) + public Builder phoneNumbers(Optional> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder phoneNumbers(List phoneNumbers) { + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) + public Builder lastActivityAt(Optional lastActivityAt) { + this.lastActivityAt = lastActivityAt; + return this; + } + + public Builder lastActivityAt(OffsetDateTime lastActivityAt) { + this.lastActivityAt = Optional.ofNullable(lastActivityAt); + return this; + } + + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public Account build() { + return new Account( + id, + remoteId, + createdAt, + modifiedAt, + owner, + name, + description, + industry, + website, + numberOfEmployees, + addresses, + phoneNumbers, + lastActivityAt, + remoteUpdatedAt, + remoteCreatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AccountDetails.java b/src/main/java/com/merge/api/crm/types/AccountDetails.java new file mode 100644 index 000000000..56ce0b8a9 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountDetails.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..cb797e4a6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatusEnum status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatusEnum status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatusEnum getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(CategoryEnum category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatusEnum status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

The tenant or domain the customer has provided access to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..c7c9e8ef7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..9d3d2ec13 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountDetailsAndActionsStatusEnum { + COMPLETE("COMPLETE"), + + INCOMPLETE("INCOMPLETE"), + + RELINK_NEEDED("RELINK_NEEDED"), + + IDLE("IDLE"); + + private final String value; + + AccountDetailsAndActionsStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/AccountIntegration.java b/src/main/java/com/merge/api/crm/types/AccountIntegration.java new file mode 100644 index 000000000..18dbeaac2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountIntegration.java @@ -0,0 +1,463 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

Company name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

Category or categories this integration is in beta status for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

Company logo in square shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

Company logo in rectangular shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountOwner.java b/src/main/java/com/merge/api/crm/types/AccountOwner.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/AccountOwner.java rename to src/main/java/com/merge/api/crm/types/AccountOwner.java index 1fe54de3c..bd1f7727a 100644 --- a/src/main/java/com/merge/api/resources/crm/types/AccountOwner.java +++ b/src/main/java/com/merge/api/crm/types/AccountOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public AccountOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public AccountOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/crm/types/AccountRequest.java b/src/main/java/com/merge/api/crm/types/AccountRequest.java new file mode 100644 index 000000000..a9b2293b5 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountRequest.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountRequest.Builder.class) +public final class AccountRequest { + private final Optional owner; + + private final Optional name; + + private final Optional description; + + private final Optional industry; + + private final Optional website; + + private final Optional numberOfEmployees; + + private final Optional> addresses; + + private final Optional lastActivityAt; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private AccountRequest( + Optional owner, + Optional name, + Optional description, + Optional industry, + Optional website, + Optional numberOfEmployees, + Optional> addresses, + Optional lastActivityAt, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.owner = owner; + this.name = name; + this.description = description; + this.industry = industry; + this.website = website; + this.numberOfEmployees = numberOfEmployees; + this.addresses = addresses; + this.lastActivityAt = lastActivityAt; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The account's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + /** + * @return The account's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The account's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The account's industry. + */ + @JsonProperty("industry") + public Optional getIndustry() { + return industry; + } + + /** + * @return The account's website. + */ + @JsonProperty("website") + public Optional getWebsite() { + return website; + } + + /** + * @return The account's number of employees. + */ + @JsonProperty("number_of_employees") + public Optional getNumberOfEmployees() { + return numberOfEmployees; + } + + @JsonProperty("addresses") + public Optional> getAddresses() { + return addresses; + } + + /** + * @return The last date (either most recent or furthest in the future) of when an activity occurs in an account. + */ + @JsonProperty("last_activity_at") + public Optional getLastActivityAt() { + return lastActivityAt; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountRequest && equalTo((AccountRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountRequest other) { + return owner.equals(other.owner) + && name.equals(other.name) + && description.equals(other.description) + && industry.equals(other.industry) + && website.equals(other.website) + && numberOfEmployees.equals(other.numberOfEmployees) + && addresses.equals(other.addresses) + && lastActivityAt.equals(other.lastActivityAt) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.owner, + this.name, + this.description, + this.industry, + this.website, + this.numberOfEmployees, + this.addresses, + this.lastActivityAt, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional owner = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional industry = Optional.empty(); + + private Optional website = Optional.empty(); + + private Optional numberOfEmployees = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional lastActivityAt = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountRequest other) { + owner(other.getOwner()); + name(other.getName()); + description(other.getDescription()); + industry(other.getIndustry()); + website(other.getWebsite()); + numberOfEmployees(other.getNumberOfEmployees()); + addresses(other.getAddresses()); + lastActivityAt(other.getLastActivityAt()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(AccountRequestOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "industry", nulls = Nulls.SKIP) + public Builder industry(Optional industry) { + this.industry = industry; + return this; + } + + public Builder industry(String industry) { + this.industry = Optional.ofNullable(industry); + return this; + } + + @JsonSetter(value = "website", nulls = Nulls.SKIP) + public Builder website(Optional website) { + this.website = website; + return this; + } + + public Builder website(String website) { + this.website = Optional.ofNullable(website); + return this; + } + + @JsonSetter(value = "number_of_employees", nulls = Nulls.SKIP) + public Builder numberOfEmployees(Optional numberOfEmployees) { + this.numberOfEmployees = numberOfEmployees; + return this; + } + + public Builder numberOfEmployees(Integer numberOfEmployees) { + this.numberOfEmployees = Optional.ofNullable(numberOfEmployees); + return this; + } + + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) + public Builder addresses(Optional> addresses) { + this.addresses = addresses; + return this; + } + + public Builder addresses(List addresses) { + this.addresses = Optional.ofNullable(addresses); + return this; + } + + @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) + public Builder lastActivityAt(Optional lastActivityAt) { + this.lastActivityAt = lastActivityAt; + return this; + } + + public Builder lastActivityAt(OffsetDateTime lastActivityAt) { + this.lastActivityAt = Optional.ofNullable(lastActivityAt); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public AccountRequest build() { + return new AccountRequest( + owner, + name, + description, + industry, + website, + numberOfEmployees, + addresses, + lastActivityAt, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountRequestOwner.java b/src/main/java/com/merge/api/crm/types/AccountRequestOwner.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/AccountRequestOwner.java rename to src/main/java/com/merge/api/crm/types/AccountRequestOwner.java index ee85bde6b..e91dcf672 100644 --- a/src/main/java/com/merge/api/resources/crm/types/AccountRequestOwner.java +++ b/src/main/java/com/merge/api/crm/types/AccountRequestOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public AccountRequestOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public AccountRequestOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/crm/types/AccountToken.java b/src/main/java/com/merge/api/crm/types/AccountToken.java new file mode 100644 index 000000000..32ff22dd4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AccountsListRequest.java b/src/main/java/com/merge/api/crm/types/AccountsListRequest.java new file mode 100644 index 000000000..25aeeaf71 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountsListRequest.java @@ -0,0 +1,488 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountsListRequest.Builder.class) +public final class AccountsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional name; + + private final Optional ownerId; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private AccountsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional name, + Optional ownerId, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.name = name; + this.ownerId = ownerId; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return If provided, will only return accounts with this name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return If provided, will only return accounts with this owner. + */ + @JsonProperty("owner_id") + public Optional getOwnerId() { + return ownerId; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) + && ownerId.equals(other.ownerId) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.name, + this.ownerId, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional ownerId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + name(other.getName()); + ownerId(other.getOwnerId()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) + public Builder ownerId(Optional ownerId) { + this.ownerId = ownerId; + return this; + } + + public Builder ownerId(String ownerId) { + this.ownerId = Optional.ofNullable(ownerId); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public AccountsListRequest build() { + return new AccountsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + name, + ownerId, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java index a4bbc615f..f6c88086b 100644 --- a/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.accounts.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequest.java new file mode 100644 index 000000000..44011cda2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) +public final class AccountsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private AccountsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public AccountsRetrieveRequest build() { + return new AccountsRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ActivityTypeEnum.java b/src/main/java/com/merge/api/crm/types/ActivityTypeEnum.java new file mode 100644 index 000000000..e80491e19 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ActivityTypeEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ActivityTypeEnum { + CALL("CALL"), + + MEETING("MEETING"), + + EMAIL("EMAIL"); + + private final String value; + + ActivityTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/Address.java b/src/main/java/com/merge/api/crm/types/Address.java new file mode 100644 index 000000000..28a5c73b1 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/Address.java @@ -0,0 +1,591 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Address.Builder.class) +public final class Address { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional street1; + + private final Optional street2; + + private final Optional city; + + private final Optional state; + + private final Optional postalCode; + + private final Optional country; + + private final Optional addressType; + + private final Map additionalProperties; + + private Address( + Optional createdAt, + Optional modifiedAt, + Optional street1, + Optional street2, + Optional city, + Optional state, + Optional postalCode, + Optional country, + Optional addressType, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.street1 = street1; + this.street2 = street2; + this.city = city; + this.state = state; + this.postalCode = postalCode; + this.country = country; + this.addressType = addressType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return Line 1 of the address's street. + */ + @JsonProperty("street_1") + public Optional getStreet1() { + return street1; + } + + /** + * @return Line 2 of the address's street. + */ + @JsonProperty("street_2") + public Optional getStreet2() { + return street2; + } + + /** + * @return The address's city. + */ + @JsonProperty("city") + public Optional getCity() { + return city; + } + + /** + * @return The address's state. + */ + @JsonProperty("state") + public Optional getState() { + return state; + } + + /** + * @return The address's postal code. + */ + @JsonProperty("postal_code") + public Optional getPostalCode() { + return postalCode; + } + + /** + * @return The address's country. + *
    + *
  • AF - Afghanistan
  • + *
  • AX - Ã…land Islands
  • + *
  • AL - Albania
  • + *
  • DZ - Algeria
  • + *
  • AS - American Samoa
  • + *
  • AD - Andorra
  • + *
  • AO - Angola
  • + *
  • AI - Anguilla
  • + *
  • AQ - Antarctica
  • + *
  • AG - Antigua and Barbuda
  • + *
  • AR - Argentina
  • + *
  • AM - Armenia
  • + *
  • AW - Aruba
  • + *
  • AU - Australia
  • + *
  • AT - Austria
  • + *
  • AZ - Azerbaijan
  • + *
  • BS - Bahamas
  • + *
  • BH - Bahrain
  • + *
  • BD - Bangladesh
  • + *
  • BB - Barbados
  • + *
  • BY - Belarus
  • + *
  • BE - Belgium
  • + *
  • BZ - Belize
  • + *
  • BJ - Benin
  • + *
  • BM - Bermuda
  • + *
  • BT - Bhutan
  • + *
  • BO - Bolivia
  • + *
  • BQ - Bonaire, Sint Eustatius and Saba
  • + *
  • BA - Bosnia and Herzegovina
  • + *
  • BW - Botswana
  • + *
  • BV - Bouvet Island
  • + *
  • BR - Brazil
  • + *
  • IO - British Indian Ocean Territory
  • + *
  • BN - Brunei
  • + *
  • BG - Bulgaria
  • + *
  • BF - Burkina Faso
  • + *
  • BI - Burundi
  • + *
  • CV - Cabo Verde
  • + *
  • KH - Cambodia
  • + *
  • CM - Cameroon
  • + *
  • CA - Canada
  • + *
  • KY - Cayman Islands
  • + *
  • CF - Central African Republic
  • + *
  • TD - Chad
  • + *
  • CL - Chile
  • + *
  • CN - China
  • + *
  • CX - Christmas Island
  • + *
  • CC - Cocos (Keeling) Islands
  • + *
  • CO - Colombia
  • + *
  • KM - Comoros
  • + *
  • CG - Congo
  • + *
  • CD - Congo (the Democratic Republic of the)
  • + *
  • CK - Cook Islands
  • + *
  • CR - Costa Rica
  • + *
  • CI - Côte d'Ivoire
  • + *
  • HR - Croatia
  • + *
  • CU - Cuba
  • + *
  • CW - Curaçao
  • + *
  • CY - Cyprus
  • + *
  • CZ - Czechia
  • + *
  • DK - Denmark
  • + *
  • DJ - Djibouti
  • + *
  • DM - Dominica
  • + *
  • DO - Dominican Republic
  • + *
  • EC - Ecuador
  • + *
  • EG - Egypt
  • + *
  • SV - El Salvador
  • + *
  • GQ - Equatorial Guinea
  • + *
  • ER - Eritrea
  • + *
  • EE - Estonia
  • + *
  • SZ - Eswatini
  • + *
  • ET - Ethiopia
  • + *
  • FK - Falkland Islands (Malvinas)
  • + *
  • FO - Faroe Islands
  • + *
  • FJ - Fiji
  • + *
  • FI - Finland
  • + *
  • FR - France
  • + *
  • GF - French Guiana
  • + *
  • PF - French Polynesia
  • + *
  • TF - French Southern Territories
  • + *
  • GA - Gabon
  • + *
  • GM - Gambia
  • + *
  • GE - Georgia
  • + *
  • DE - Germany
  • + *
  • GH - Ghana
  • + *
  • GI - Gibraltar
  • + *
  • GR - Greece
  • + *
  • GL - Greenland
  • + *
  • GD - Grenada
  • + *
  • GP - Guadeloupe
  • + *
  • GU - Guam
  • + *
  • GT - Guatemala
  • + *
  • GG - Guernsey
  • + *
  • GN - Guinea
  • + *
  • GW - Guinea-Bissau
  • + *
  • GY - Guyana
  • + *
  • HT - Haiti
  • + *
  • HM - Heard Island and McDonald Islands
  • + *
  • VA - Holy See
  • + *
  • HN - Honduras
  • + *
  • HK - Hong Kong
  • + *
  • HU - Hungary
  • + *
  • IS - Iceland
  • + *
  • IN - India
  • + *
  • ID - Indonesia
  • + *
  • IR - Iran
  • + *
  • IQ - Iraq
  • + *
  • IE - Ireland
  • + *
  • IM - Isle of Man
  • + *
  • IL - Israel
  • + *
  • IT - Italy
  • + *
  • JM - Jamaica
  • + *
  • JP - Japan
  • + *
  • JE - Jersey
  • + *
  • JO - Jordan
  • + *
  • KZ - Kazakhstan
  • + *
  • KE - Kenya
  • + *
  • KI - Kiribati
  • + *
  • KW - Kuwait
  • + *
  • KG - Kyrgyzstan
  • + *
  • LA - Laos
  • + *
  • LV - Latvia
  • + *
  • LB - Lebanon
  • + *
  • LS - Lesotho
  • + *
  • LR - Liberia
  • + *
  • LY - Libya
  • + *
  • LI - Liechtenstein
  • + *
  • LT - Lithuania
  • + *
  • LU - Luxembourg
  • + *
  • MO - Macao
  • + *
  • MG - Madagascar
  • + *
  • MW - Malawi
  • + *
  • MY - Malaysia
  • + *
  • MV - Maldives
  • + *
  • ML - Mali
  • + *
  • MT - Malta
  • + *
  • MH - Marshall Islands
  • + *
  • MQ - Martinique
  • + *
  • MR - Mauritania
  • + *
  • MU - Mauritius
  • + *
  • YT - Mayotte
  • + *
  • MX - Mexico
  • + *
  • FM - Micronesia (Federated States of)
  • + *
  • MD - Moldova
  • + *
  • MC - Monaco
  • + *
  • MN - Mongolia
  • + *
  • ME - Montenegro
  • + *
  • MS - Montserrat
  • + *
  • MA - Morocco
  • + *
  • MZ - Mozambique
  • + *
  • MM - Myanmar
  • + *
  • NA - Namibia
  • + *
  • NR - Nauru
  • + *
  • NP - Nepal
  • + *
  • NL - Netherlands
  • + *
  • NC - New Caledonia
  • + *
  • NZ - New Zealand
  • + *
  • NI - Nicaragua
  • + *
  • NE - Niger
  • + *
  • NG - Nigeria
  • + *
  • NU - Niue
  • + *
  • NF - Norfolk Island
  • + *
  • KP - North Korea
  • + *
  • MK - North Macedonia
  • + *
  • MP - Northern Mariana Islands
  • + *
  • NO - Norway
  • + *
  • OM - Oman
  • + *
  • PK - Pakistan
  • + *
  • PW - Palau
  • + *
  • PS - Palestine, State of
  • + *
  • PA - Panama
  • + *
  • PG - Papua New Guinea
  • + *
  • PY - Paraguay
  • + *
  • PE - Peru
  • + *
  • PH - Philippines
  • + *
  • PN - Pitcairn
  • + *
  • PL - Poland
  • + *
  • PT - Portugal
  • + *
  • PR - Puerto Rico
  • + *
  • QA - Qatar
  • + *
  • RE - Réunion
  • + *
  • RO - Romania
  • + *
  • RU - Russia
  • + *
  • RW - Rwanda
  • + *
  • BL - Saint Barthélemy
  • + *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • + *
  • KN - Saint Kitts and Nevis
  • + *
  • LC - Saint Lucia
  • + *
  • MF - Saint Martin (French part)
  • + *
  • PM - Saint Pierre and Miquelon
  • + *
  • VC - Saint Vincent and the Grenadines
  • + *
  • WS - Samoa
  • + *
  • SM - San Marino
  • + *
  • ST - Sao Tome and Principe
  • + *
  • SA - Saudi Arabia
  • + *
  • SN - Senegal
  • + *
  • RS - Serbia
  • + *
  • SC - Seychelles
  • + *
  • SL - Sierra Leone
  • + *
  • SG - Singapore
  • + *
  • SX - Sint Maarten (Dutch part)
  • + *
  • SK - Slovakia
  • + *
  • SI - Slovenia
  • + *
  • SB - Solomon Islands
  • + *
  • SO - Somalia
  • + *
  • ZA - South Africa
  • + *
  • GS - South Georgia and the South Sandwich Islands
  • + *
  • KR - South Korea
  • + *
  • SS - South Sudan
  • + *
  • ES - Spain
  • + *
  • LK - Sri Lanka
  • + *
  • SD - Sudan
  • + *
  • SR - Suriname
  • + *
  • SJ - Svalbard and Jan Mayen
  • + *
  • SE - Sweden
  • + *
  • CH - Switzerland
  • + *
  • SY - Syria
  • + *
  • TW - Taiwan
  • + *
  • TJ - Tajikistan
  • + *
  • TZ - Tanzania
  • + *
  • TH - Thailand
  • + *
  • TL - Timor-Leste
  • + *
  • TG - Togo
  • + *
  • TK - Tokelau
  • + *
  • TO - Tonga
  • + *
  • TT - Trinidad and Tobago
  • + *
  • TN - Tunisia
  • + *
  • TR - Turkey
  • + *
  • TM - Turkmenistan
  • + *
  • TC - Turks and Caicos Islands
  • + *
  • TV - Tuvalu
  • + *
  • UG - Uganda
  • + *
  • UA - Ukraine
  • + *
  • AE - United Arab Emirates
  • + *
  • GB - United Kingdom
  • + *
  • UM - United States Minor Outlying Islands
  • + *
  • US - United States of America
  • + *
  • UY - Uruguay
  • + *
  • UZ - Uzbekistan
  • + *
  • VU - Vanuatu
  • + *
  • VE - Venezuela
  • + *
  • VN - Vietnam
  • + *
  • VG - Virgin Islands (British)
  • + *
  • VI - Virgin Islands (U.S.)
  • + *
  • WF - Wallis and Futuna
  • + *
  • EH - Western Sahara
  • + *
  • YE - Yemen
  • + *
  • ZM - Zambia
  • + *
  • ZW - Zimbabwe
  • + *
+ */ + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + /** + * @return The address type. + *
    + *
  • BILLING - BILLING
  • + *
  • SHIPPING - SHIPPING
  • + *
+ */ + @JsonProperty("address_type") + public Optional getAddressType() { + return addressType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Address && equalTo((Address) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Address other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && street1.equals(other.street1) + && street2.equals(other.street2) + && city.equals(other.city) + && state.equals(other.state) + && postalCode.equals(other.postalCode) + && country.equals(other.country) + && addressType.equals(other.addressType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAt, + this.modifiedAt, + this.street1, + this.street2, + this.city, + this.state, + this.postalCode, + this.country, + this.addressType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional street1 = Optional.empty(); + + private Optional street2 = Optional.empty(); + + private Optional city = Optional.empty(); + + private Optional state = Optional.empty(); + + private Optional postalCode = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional addressType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Address other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + street1(other.getStreet1()); + street2(other.getStreet2()); + city(other.getCity()); + state(other.getState()); + postalCode(other.getPostalCode()); + country(other.getCountry()); + addressType(other.getAddressType()); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "street_1", nulls = Nulls.SKIP) + public Builder street1(Optional street1) { + this.street1 = street1; + return this; + } + + public Builder street1(String street1) { + this.street1 = Optional.ofNullable(street1); + return this; + } + + @JsonSetter(value = "street_2", nulls = Nulls.SKIP) + public Builder street2(Optional street2) { + this.street2 = street2; + return this; + } + + public Builder street2(String street2) { + this.street2 = Optional.ofNullable(street2); + return this; + } + + @JsonSetter(value = "city", nulls = Nulls.SKIP) + public Builder city(Optional city) { + this.city = city; + return this; + } + + public Builder city(String city) { + this.city = Optional.ofNullable(city); + return this; + } + + @JsonSetter(value = "state", nulls = Nulls.SKIP) + public Builder state(Optional state) { + this.state = state; + return this; + } + + public Builder state(String state) { + this.state = Optional.ofNullable(state); + return this; + } + + @JsonSetter(value = "postal_code", nulls = Nulls.SKIP) + public Builder postalCode(Optional postalCode) { + this.postalCode = postalCode; + return this; + } + + public Builder postalCode(String postalCode) { + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(CountryEnum country) { + this.country = Optional.ofNullable(country); + return this; + } + + @JsonSetter(value = "address_type", nulls = Nulls.SKIP) + public Builder addressType(Optional addressType) { + this.addressType = addressType; + return this; + } + + public Builder addressType(AddressTypeEnum addressType) { + this.addressType = Optional.ofNullable(addressType); + return this; + } + + public Address build() { + return new Address( + createdAt, + modifiedAt, + street1, + street2, + city, + state, + postalCode, + country, + addressType, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AddressRequest.java b/src/main/java/com/merge/api/crm/types/AddressRequest.java new file mode 100644 index 000000000..622673cea --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AddressRequest.java @@ -0,0 +1,585 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AddressRequest.Builder.class) +public final class AddressRequest { + private final Optional street1; + + private final Optional street2; + + private final Optional city; + + private final Optional state; + + private final Optional postalCode; + + private final Optional country; + + private final Optional addressType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private AddressRequest( + Optional street1, + Optional street2, + Optional city, + Optional state, + Optional postalCode, + Optional country, + Optional addressType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.street1 = street1; + this.street2 = street2; + this.city = city; + this.state = state; + this.postalCode = postalCode; + this.country = country; + this.addressType = addressType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return Line 1 of the address's street. + */ + @JsonProperty("street_1") + public Optional getStreet1() { + return street1; + } + + /** + * @return Line 2 of the address's street. + */ + @JsonProperty("street_2") + public Optional getStreet2() { + return street2; + } + + /** + * @return The address's city. + */ + @JsonProperty("city") + public Optional getCity() { + return city; + } + + /** + * @return The address's state. + */ + @JsonProperty("state") + public Optional getState() { + return state; + } + + /** + * @return The address's postal code. + */ + @JsonProperty("postal_code") + public Optional getPostalCode() { + return postalCode; + } + + /** + * @return The address's country. + *
    + *
  • AF - Afghanistan
  • + *
  • AX - Ã…land Islands
  • + *
  • AL - Albania
  • + *
  • DZ - Algeria
  • + *
  • AS - American Samoa
  • + *
  • AD - Andorra
  • + *
  • AO - Angola
  • + *
  • AI - Anguilla
  • + *
  • AQ - Antarctica
  • + *
  • AG - Antigua and Barbuda
  • + *
  • AR - Argentina
  • + *
  • AM - Armenia
  • + *
  • AW - Aruba
  • + *
  • AU - Australia
  • + *
  • AT - Austria
  • + *
  • AZ - Azerbaijan
  • + *
  • BS - Bahamas
  • + *
  • BH - Bahrain
  • + *
  • BD - Bangladesh
  • + *
  • BB - Barbados
  • + *
  • BY - Belarus
  • + *
  • BE - Belgium
  • + *
  • BZ - Belize
  • + *
  • BJ - Benin
  • + *
  • BM - Bermuda
  • + *
  • BT - Bhutan
  • + *
  • BO - Bolivia
  • + *
  • BQ - Bonaire, Sint Eustatius and Saba
  • + *
  • BA - Bosnia and Herzegovina
  • + *
  • BW - Botswana
  • + *
  • BV - Bouvet Island
  • + *
  • BR - Brazil
  • + *
  • IO - British Indian Ocean Territory
  • + *
  • BN - Brunei
  • + *
  • BG - Bulgaria
  • + *
  • BF - Burkina Faso
  • + *
  • BI - Burundi
  • + *
  • CV - Cabo Verde
  • + *
  • KH - Cambodia
  • + *
  • CM - Cameroon
  • + *
  • CA - Canada
  • + *
  • KY - Cayman Islands
  • + *
  • CF - Central African Republic
  • + *
  • TD - Chad
  • + *
  • CL - Chile
  • + *
  • CN - China
  • + *
  • CX - Christmas Island
  • + *
  • CC - Cocos (Keeling) Islands
  • + *
  • CO - Colombia
  • + *
  • KM - Comoros
  • + *
  • CG - Congo
  • + *
  • CD - Congo (the Democratic Republic of the)
  • + *
  • CK - Cook Islands
  • + *
  • CR - Costa Rica
  • + *
  • CI - Côte d'Ivoire
  • + *
  • HR - Croatia
  • + *
  • CU - Cuba
  • + *
  • CW - Curaçao
  • + *
  • CY - Cyprus
  • + *
  • CZ - Czechia
  • + *
  • DK - Denmark
  • + *
  • DJ - Djibouti
  • + *
  • DM - Dominica
  • + *
  • DO - Dominican Republic
  • + *
  • EC - Ecuador
  • + *
  • EG - Egypt
  • + *
  • SV - El Salvador
  • + *
  • GQ - Equatorial Guinea
  • + *
  • ER - Eritrea
  • + *
  • EE - Estonia
  • + *
  • SZ - Eswatini
  • + *
  • ET - Ethiopia
  • + *
  • FK - Falkland Islands (Malvinas)
  • + *
  • FO - Faroe Islands
  • + *
  • FJ - Fiji
  • + *
  • FI - Finland
  • + *
  • FR - France
  • + *
  • GF - French Guiana
  • + *
  • PF - French Polynesia
  • + *
  • TF - French Southern Territories
  • + *
  • GA - Gabon
  • + *
  • GM - Gambia
  • + *
  • GE - Georgia
  • + *
  • DE - Germany
  • + *
  • GH - Ghana
  • + *
  • GI - Gibraltar
  • + *
  • GR - Greece
  • + *
  • GL - Greenland
  • + *
  • GD - Grenada
  • + *
  • GP - Guadeloupe
  • + *
  • GU - Guam
  • + *
  • GT - Guatemala
  • + *
  • GG - Guernsey
  • + *
  • GN - Guinea
  • + *
  • GW - Guinea-Bissau
  • + *
  • GY - Guyana
  • + *
  • HT - Haiti
  • + *
  • HM - Heard Island and McDonald Islands
  • + *
  • VA - Holy See
  • + *
  • HN - Honduras
  • + *
  • HK - Hong Kong
  • + *
  • HU - Hungary
  • + *
  • IS - Iceland
  • + *
  • IN - India
  • + *
  • ID - Indonesia
  • + *
  • IR - Iran
  • + *
  • IQ - Iraq
  • + *
  • IE - Ireland
  • + *
  • IM - Isle of Man
  • + *
  • IL - Israel
  • + *
  • IT - Italy
  • + *
  • JM - Jamaica
  • + *
  • JP - Japan
  • + *
  • JE - Jersey
  • + *
  • JO - Jordan
  • + *
  • KZ - Kazakhstan
  • + *
  • KE - Kenya
  • + *
  • KI - Kiribati
  • + *
  • KW - Kuwait
  • + *
  • KG - Kyrgyzstan
  • + *
  • LA - Laos
  • + *
  • LV - Latvia
  • + *
  • LB - Lebanon
  • + *
  • LS - Lesotho
  • + *
  • LR - Liberia
  • + *
  • LY - Libya
  • + *
  • LI - Liechtenstein
  • + *
  • LT - Lithuania
  • + *
  • LU - Luxembourg
  • + *
  • MO - Macao
  • + *
  • MG - Madagascar
  • + *
  • MW - Malawi
  • + *
  • MY - Malaysia
  • + *
  • MV - Maldives
  • + *
  • ML - Mali
  • + *
  • MT - Malta
  • + *
  • MH - Marshall Islands
  • + *
  • MQ - Martinique
  • + *
  • MR - Mauritania
  • + *
  • MU - Mauritius
  • + *
  • YT - Mayotte
  • + *
  • MX - Mexico
  • + *
  • FM - Micronesia (Federated States of)
  • + *
  • MD - Moldova
  • + *
  • MC - Monaco
  • + *
  • MN - Mongolia
  • + *
  • ME - Montenegro
  • + *
  • MS - Montserrat
  • + *
  • MA - Morocco
  • + *
  • MZ - Mozambique
  • + *
  • MM - Myanmar
  • + *
  • NA - Namibia
  • + *
  • NR - Nauru
  • + *
  • NP - Nepal
  • + *
  • NL - Netherlands
  • + *
  • NC - New Caledonia
  • + *
  • NZ - New Zealand
  • + *
  • NI - Nicaragua
  • + *
  • NE - Niger
  • + *
  • NG - Nigeria
  • + *
  • NU - Niue
  • + *
  • NF - Norfolk Island
  • + *
  • KP - North Korea
  • + *
  • MK - North Macedonia
  • + *
  • MP - Northern Mariana Islands
  • + *
  • NO - Norway
  • + *
  • OM - Oman
  • + *
  • PK - Pakistan
  • + *
  • PW - Palau
  • + *
  • PS - Palestine, State of
  • + *
  • PA - Panama
  • + *
  • PG - Papua New Guinea
  • + *
  • PY - Paraguay
  • + *
  • PE - Peru
  • + *
  • PH - Philippines
  • + *
  • PN - Pitcairn
  • + *
  • PL - Poland
  • + *
  • PT - Portugal
  • + *
  • PR - Puerto Rico
  • + *
  • QA - Qatar
  • + *
  • RE - Réunion
  • + *
  • RO - Romania
  • + *
  • RU - Russia
  • + *
  • RW - Rwanda
  • + *
  • BL - Saint Barthélemy
  • + *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • + *
  • KN - Saint Kitts and Nevis
  • + *
  • LC - Saint Lucia
  • + *
  • MF - Saint Martin (French part)
  • + *
  • PM - Saint Pierre and Miquelon
  • + *
  • VC - Saint Vincent and the Grenadines
  • + *
  • WS - Samoa
  • + *
  • SM - San Marino
  • + *
  • ST - Sao Tome and Principe
  • + *
  • SA - Saudi Arabia
  • + *
  • SN - Senegal
  • + *
  • RS - Serbia
  • + *
  • SC - Seychelles
  • + *
  • SL - Sierra Leone
  • + *
  • SG - Singapore
  • + *
  • SX - Sint Maarten (Dutch part)
  • + *
  • SK - Slovakia
  • + *
  • SI - Slovenia
  • + *
  • SB - Solomon Islands
  • + *
  • SO - Somalia
  • + *
  • ZA - South Africa
  • + *
  • GS - South Georgia and the South Sandwich Islands
  • + *
  • KR - South Korea
  • + *
  • SS - South Sudan
  • + *
  • ES - Spain
  • + *
  • LK - Sri Lanka
  • + *
  • SD - Sudan
  • + *
  • SR - Suriname
  • + *
  • SJ - Svalbard and Jan Mayen
  • + *
  • SE - Sweden
  • + *
  • CH - Switzerland
  • + *
  • SY - Syria
  • + *
  • TW - Taiwan
  • + *
  • TJ - Tajikistan
  • + *
  • TZ - Tanzania
  • + *
  • TH - Thailand
  • + *
  • TL - Timor-Leste
  • + *
  • TG - Togo
  • + *
  • TK - Tokelau
  • + *
  • TO - Tonga
  • + *
  • TT - Trinidad and Tobago
  • + *
  • TN - Tunisia
  • + *
  • TR - Turkey
  • + *
  • TM - Turkmenistan
  • + *
  • TC - Turks and Caicos Islands
  • + *
  • TV - Tuvalu
  • + *
  • UG - Uganda
  • + *
  • UA - Ukraine
  • + *
  • AE - United Arab Emirates
  • + *
  • GB - United Kingdom
  • + *
  • UM - United States Minor Outlying Islands
  • + *
  • US - United States of America
  • + *
  • UY - Uruguay
  • + *
  • UZ - Uzbekistan
  • + *
  • VU - Vanuatu
  • + *
  • VE - Venezuela
  • + *
  • VN - Vietnam
  • + *
  • VG - Virgin Islands (British)
  • + *
  • VI - Virgin Islands (U.S.)
  • + *
  • WF - Wallis and Futuna
  • + *
  • EH - Western Sahara
  • + *
  • YE - Yemen
  • + *
  • ZM - Zambia
  • + *
  • ZW - Zimbabwe
  • + *
+ */ + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + /** + * @return The address type. + *
    + *
  • BILLING - BILLING
  • + *
  • SHIPPING - SHIPPING
  • + *
+ */ + @JsonProperty("address_type") + public Optional getAddressType() { + return addressType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AddressRequest && equalTo((AddressRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AddressRequest other) { + return street1.equals(other.street1) + && street2.equals(other.street2) + && city.equals(other.city) + && state.equals(other.state) + && postalCode.equals(other.postalCode) + && country.equals(other.country) + && addressType.equals(other.addressType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.street1, + this.street2, + this.city, + this.state, + this.postalCode, + this.country, + this.addressType, + this.integrationParams, + this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional street1 = Optional.empty(); + + private Optional street2 = Optional.empty(); + + private Optional city = Optional.empty(); + + private Optional state = Optional.empty(); + + private Optional postalCode = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional addressType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AddressRequest other) { + street1(other.getStreet1()); + street2(other.getStreet2()); + city(other.getCity()); + state(other.getState()); + postalCode(other.getPostalCode()); + country(other.getCountry()); + addressType(other.getAddressType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "street_1", nulls = Nulls.SKIP) + public Builder street1(Optional street1) { + this.street1 = street1; + return this; + } + + public Builder street1(String street1) { + this.street1 = Optional.ofNullable(street1); + return this; + } + + @JsonSetter(value = "street_2", nulls = Nulls.SKIP) + public Builder street2(Optional street2) { + this.street2 = street2; + return this; + } + + public Builder street2(String street2) { + this.street2 = Optional.ofNullable(street2); + return this; + } + + @JsonSetter(value = "city", nulls = Nulls.SKIP) + public Builder city(Optional city) { + this.city = city; + return this; + } + + public Builder city(String city) { + this.city = Optional.ofNullable(city); + return this; + } + + @JsonSetter(value = "state", nulls = Nulls.SKIP) + public Builder state(Optional state) { + this.state = state; + return this; + } + + public Builder state(String state) { + this.state = Optional.ofNullable(state); + return this; + } + + @JsonSetter(value = "postal_code", nulls = Nulls.SKIP) + public Builder postalCode(Optional postalCode) { + this.postalCode = postalCode; + return this; + } + + public Builder postalCode(String postalCode) { + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(CountryEnum country) { + this.country = Optional.ofNullable(country); + return this; + } + + @JsonSetter(value = "address_type", nulls = Nulls.SKIP) + public Builder addressType(Optional addressType) { + this.addressType = addressType; + return this; + } + + public Builder addressType(AddressTypeEnum addressType) { + this.addressType = Optional.ofNullable(addressType); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public AddressRequest build() { + return new AddressRequest( + street1, + street2, + city, + state, + postalCode, + country, + addressType, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AddressTypeEnum.java b/src/main/java/com/merge/api/crm/types/AddressTypeEnum.java new file mode 100644 index 000000000..ec5720d46 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AddressTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AddressTypeEnum { + BILLING("BILLING"), + + SHIPPING("SHIPPING"); + + private final String value; + + AddressTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/AdvancedMetadata.java b/src/main/java/com/merge/api/crm/types/AdvancedMetadata.java new file mode 100644 index 000000000..69761ef56 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/Association.java b/src/main/java/com/merge/api/crm/types/Association.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/Association.java rename to src/main/java/com/merge/api/crm/types/Association.java index e6bc78676..9c42abfbb 100644 --- a/src/main/java/com/merge/api/resources/crm/types/Association.java +++ b/src/main/java/com/merge/api/crm/types/Association.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/AssociationAssociationType.java b/src/main/java/com/merge/api/crm/types/AssociationAssociationType.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/AssociationAssociationType.java rename to src/main/java/com/merge/api/crm/types/AssociationAssociationType.java index d9cff0de5..ebab89ae0 100644 --- a/src/main/java/com/merge/api/resources/crm/types/AssociationAssociationType.java +++ b/src/main/java/com/merge/api/crm/types/AssociationAssociationType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer displayName; - private final Optional cardinality; + private final Optional cardinality; private final Optional isRequired; @@ -54,7 +54,7 @@ private AssociationType( Optional> targetObjectClasses, Optional remoteKeyName, Optional displayName, - Optional cardinality, + Optional cardinality, Optional isRequired, Map additionalProperties) { this.id = id; @@ -123,7 +123,7 @@ public Optional getDisplayName() { } @JsonProperty("cardinality") - public Optional getCardinality() { + public Optional getCardinality() { return cardinality; } @@ -198,7 +198,7 @@ public static final class Builder { private Optional displayName = Optional.empty(); - private Optional cardinality = Optional.empty(); + private Optional cardinality = Optional.empty(); private Optional isRequired = Optional.empty(); @@ -310,12 +310,12 @@ public Builder displayName(String displayName) { } @JsonSetter(value = "cardinality", nulls = Nulls.SKIP) - public Builder cardinality(Optional cardinality) { + public Builder cardinality(Optional cardinality) { this.cardinality = cardinality; return this; } - public Builder cardinality(AssociationTypeCardinality cardinality) { + public Builder cardinality(CardinalityEnum cardinality) { this.cardinality = Optional.ofNullable(cardinality); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/AssociationTypeRequestRequest.java b/src/main/java/com/merge/api/crm/types/AssociationTypeRequestRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/AssociationTypeRequestRequest.java rename to src/main/java/com/merge/api/crm/types/AssociationTypeRequestRequest.java index 30f99b39d..6a3f013c8 100644 --- a/src/main/java/com/merge/api/resources/crm/types/AssociationTypeRequestRequest.java +++ b/src/main/java/com/merge/api/crm/types/AssociationTypeRequestRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/crm/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..e675dd250 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/crm/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..46bbf3dab --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AuditLogEvent.java b/src/main/java/com/merge/api/crm/types/AuditLogEvent.java new file mode 100644 index 000000000..1cd04d82e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AuditLogEvent.java @@ -0,0 +1,449 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final RoleEnum role; + + private final String ipAddress; + + private final EventTypeEnum eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + RoleEnum role, + String ipAddress, + EventTypeEnum eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ */ + @JsonProperty("role") + public RoleEnum getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ */ + @JsonProperty("event_type") + public EventTypeEnum getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + IpAddressStage role(@NotNull RoleEnum role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + EventDescriptionStage eventType(@NotNull EventTypeEnum eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private RoleEnum role; + + private String ipAddress; + + private EventTypeEnum eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

+ *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull RoleEnum role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

Designates the type of event that occurred.

+ *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull EventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The User's email at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

The User's full name at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/crm/types/AuditTrailListRequest.java new file mode 100644 index 000000000..6a6003aa8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AuditTrailListRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/AvailableActions.java b/src/main/java/com/merge/api/crm/types/AvailableActions.java new file mode 100644 index 000000000..dc1fd4d8f --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/CardinalityEnum.java b/src/main/java/com/merge/api/crm/types/CardinalityEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/crm/types/CardinalityEnum.java rename to src/main/java/com/merge/api/crm/types/CardinalityEnum.java index fd051b727..f5c96aa43 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CardinalityEnum.java +++ b/src/main/java/com/merge/api/crm/types/CardinalityEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/crm/types/CategoriesEnum.java b/src/main/java/com/merge/api/crm/types/CategoriesEnum.java new file mode 100644 index 000000000..78478ffb7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoriesEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoriesEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/CategoryEnum.java b/src/main/java/com/merge/api/crm/types/CategoryEnum.java new file mode 100644 index 000000000..5a3c414a4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoryEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/crm/types/CommonModelScopeApi.java new file mode 100644 index 000000000..202c3b928 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CommonModelScopeApi.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/crm/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..f9f6f72f7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/Contact.java b/src/main/java/com/merge/api/crm/types/Contact.java new file mode 100644 index 000000000..f8b171481 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/Contact.java @@ -0,0 +1,549 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Contact.Builder.class) +public final class Contact { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional firstName; + + private final Optional lastName; + + private final Optional account; + + private final Optional owner; + + private final Optional> addresses; + + private final Optional> emailAddresses; + + private final Optional> phoneNumbers; + + private final Optional lastActivityAt; + + private final Optional remoteCreatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private Contact( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional firstName, + Optional lastName, + Optional account, + Optional owner, + Optional> addresses, + Optional> emailAddresses, + Optional> phoneNumbers, + Optional lastActivityAt, + Optional remoteCreatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.firstName = firstName; + this.lastName = lastName; + this.account = account; + this.owner = owner; + this.addresses = addresses; + this.emailAddresses = emailAddresses; + this.phoneNumbers = phoneNumbers; + this.lastActivityAt = lastActivityAt; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The contact's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The contact's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The contact's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The contact's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + @JsonProperty("addresses") + public Optional> getAddresses() { + return addresses; + } + + @JsonProperty("email_addresses") + public Optional> getEmailAddresses() { + return emailAddresses; + } + + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + /** + * @return When the contact's last activity occurred. + */ + @JsonProperty("last_activity_at") + public Optional getLastActivityAt() { + return lastActivityAt; + } + + /** + * @return When the third party's contact was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Contact && equalTo((Contact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Contact other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && account.equals(other.account) + && owner.equals(other.owner) + && addresses.equals(other.addresses) + && emailAddresses.equals(other.emailAddresses) + && phoneNumbers.equals(other.phoneNumbers) + && lastActivityAt.equals(other.lastActivityAt) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.firstName, + this.lastName, + this.account, + this.owner, + this.addresses, + this.emailAddresses, + this.phoneNumbers, + this.lastActivityAt, + this.remoteCreatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional lastActivityAt = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Contact other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + account(other.getAccount()); + owner(other.getOwner()); + addresses(other.getAddresses()); + emailAddresses(other.getEmailAddresses()); + phoneNumbers(other.getPhoneNumbers()); + lastActivityAt(other.getLastActivityAt()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public Builder firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + public Builder firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @JsonSetter(value = "last_name", nulls = Nulls.SKIP) + public Builder lastName(Optional lastName) { + this.lastName = lastName; + return this; + } + + public Builder lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ContactAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(ContactOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) + public Builder addresses(Optional> addresses) { + this.addresses = addresses; + return this; + } + + public Builder addresses(List
addresses) { + this.addresses = Optional.ofNullable(addresses); + return this; + } + + @JsonSetter(value = "email_addresses", nulls = Nulls.SKIP) + public Builder emailAddresses(Optional> emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + public Builder emailAddresses(List emailAddresses) { + this.emailAddresses = Optional.ofNullable(emailAddresses); + return this; + } + + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) + public Builder phoneNumbers(Optional> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder phoneNumbers(List phoneNumbers) { + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) + public Builder lastActivityAt(Optional lastActivityAt) { + this.lastActivityAt = lastActivityAt; + return this; + } + + public Builder lastActivityAt(OffsetDateTime lastActivityAt) { + this.lastActivityAt = Optional.ofNullable(lastActivityAt); + return this; + } + + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public Contact build() { + return new Contact( + id, + remoteId, + createdAt, + modifiedAt, + firstName, + lastName, + account, + owner, + addresses, + emailAddresses, + phoneNumbers, + lastActivityAt, + remoteCreatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ContactAccount.java b/src/main/java/com/merge/api/crm/types/ContactAccount.java new file mode 100644 index 000000000..1074c339b --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactAccount.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactAccount.Deserializer.class) +public final class ContactAccount { + private final Object value; + + private final int type; + + private ContactAccount(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Account) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactAccount && equalTo((ContactAccount) other); + } + + private boolean equalTo(ContactAccount other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactAccount of(String value) { + return new ContactAccount(value, 0); + } + + public static ContactAccount of(Account value) { + return new ContactAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactAccount.class); + } + + @java.lang.Override + public ContactAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/ContactOwner.java b/src/main/java/com/merge/api/crm/types/ContactOwner.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/ContactOwner.java rename to src/main/java/com/merge/api/crm/types/ContactOwner.java index bf4dbe7da..2816ebc32 100644 --- a/src/main/java/com/merge/api/resources/crm/types/ContactOwner.java +++ b/src/main/java/com/merge/api/crm/types/ContactOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ContactOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ContactOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/crm/types/ContactRequest.java b/src/main/java/com/merge/api/crm/types/ContactRequest.java new file mode 100644 index 000000000..5c8aa608a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactRequest.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactRequest.Builder.class) +public final class ContactRequest { + private final Optional firstName; + + private final Optional lastName; + + private final Optional account; + + private final Optional owner; + + private final Optional> addresses; + + private final Optional> emailAddresses; + + private final Optional> phoneNumbers; + + private final Optional lastActivityAt; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ContactRequest( + Optional firstName, + Optional lastName, + Optional account, + Optional owner, + Optional> addresses, + Optional> emailAddresses, + Optional> phoneNumbers, + Optional lastActivityAt, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.firstName = firstName; + this.lastName = lastName; + this.account = account; + this.owner = owner; + this.addresses = addresses; + this.emailAddresses = emailAddresses; + this.phoneNumbers = phoneNumbers; + this.lastActivityAt = lastActivityAt; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The contact's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The contact's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The contact's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return The contact's owner. + */ + @JsonProperty("owner") + public Optional getOwner() { + return owner; + } + + @JsonProperty("addresses") + public Optional> getAddresses() { + return addresses; + } + + @JsonProperty("email_addresses") + public Optional> getEmailAddresses() { + return emailAddresses; + } + + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + /** + * @return When the contact's last activity occurred. + */ + @JsonProperty("last_activity_at") + public Optional getLastActivityAt() { + return lastActivityAt; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequest && equalTo((ContactRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactRequest other) { + return firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && account.equals(other.account) + && owner.equals(other.owner) + && addresses.equals(other.addresses) + && emailAddresses.equals(other.emailAddresses) + && phoneNumbers.equals(other.phoneNumbers) + && lastActivityAt.equals(other.lastActivityAt) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.firstName, + this.lastName, + this.account, + this.owner, + this.addresses, + this.emailAddresses, + this.phoneNumbers, + this.lastActivityAt, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional owner = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional> emailAddresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional lastActivityAt = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactRequest other) { + firstName(other.getFirstName()); + lastName(other.getLastName()); + account(other.getAccount()); + owner(other.getOwner()); + addresses(other.getAddresses()); + emailAddresses(other.getEmailAddresses()); + phoneNumbers(other.getPhoneNumbers()); + lastActivityAt(other.getLastActivityAt()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public Builder firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + public Builder firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @JsonSetter(value = "last_name", nulls = Nulls.SKIP) + public Builder lastName(Optional lastName) { + this.lastName = lastName; + return this; + } + + public Builder lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ContactRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "owner", nulls = Nulls.SKIP) + public Builder owner(Optional owner) { + this.owner = owner; + return this; + } + + public Builder owner(ContactRequestOwner owner) { + this.owner = Optional.ofNullable(owner); + return this; + } + + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) + public Builder addresses(Optional> addresses) { + this.addresses = addresses; + return this; + } + + public Builder addresses(List addresses) { + this.addresses = Optional.ofNullable(addresses); + return this; + } + + @JsonSetter(value = "email_addresses", nulls = Nulls.SKIP) + public Builder emailAddresses(Optional> emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + public Builder emailAddresses(List emailAddresses) { + this.emailAddresses = Optional.ofNullable(emailAddresses); + return this; + } + + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) + public Builder phoneNumbers(Optional> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder phoneNumbers(List phoneNumbers) { + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) + public Builder lastActivityAt(Optional lastActivityAt) { + this.lastActivityAt = lastActivityAt; + return this; + } + + public Builder lastActivityAt(OffsetDateTime lastActivityAt) { + this.lastActivityAt = Optional.ofNullable(lastActivityAt); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ContactRequest build() { + return new ContactRequest( + firstName, + lastName, + account, + owner, + addresses, + emailAddresses, + phoneNumbers, + lastActivityAt, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ContactRequestAccount.java b/src/main/java/com/merge/api/crm/types/ContactRequestAccount.java new file mode 100644 index 000000000..5a82a4e6e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactRequestAccount.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactRequestAccount.Deserializer.class) +public final class ContactRequestAccount { + private final Object value; + + private final int type; + + private ContactRequestAccount(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Account) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequestAccount && equalTo((ContactRequestAccount) other); + } + + private boolean equalTo(ContactRequestAccount other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactRequestAccount of(String value) { + return new ContactRequestAccount(value, 0); + } + + public static ContactRequestAccount of(Account value) { + return new ContactRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactRequestAccount.class); + } + + @java.lang.Override + public ContactRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/ContactRequestOwner.java b/src/main/java/com/merge/api/crm/types/ContactRequestOwner.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/ContactRequestOwner.java rename to src/main/java/com/merge/api/crm/types/ContactRequestOwner.java index 6a8d20dbb..74d921650 100644 --- a/src/main/java/com/merge/api/resources/crm/types/ContactRequestOwner.java +++ b/src/main/java/com/merge/api/crm/types/ContactRequestOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ContactRequestOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ContactRequestOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/crm/types/ContactsListRequest.java b/src/main/java/com/merge/api/crm/types/ContactsListRequest.java new file mode 100644 index 000000000..a784ed4ca --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactsListRequest.java @@ -0,0 +1,517 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsListRequest.Builder.class) +public final class ContactsListRequest { + private final Optional> expand; + + private final Optional accountId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional emailAddresses; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional phoneNumbers; + + private final Optional remoteId; + + private final Map additionalProperties; + + private ContactsListRequest( + Optional> expand, + Optional accountId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional emailAddresses, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional phoneNumbers, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.accountId = accountId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.emailAddresses = emailAddresses; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.phoneNumbers = phoneNumbers; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return contacts with this account. + */ + @JsonProperty("account_id") + public Optional getAccountId() { + return accountId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. + */ + @JsonProperty("email_addresses") + public Optional getEmailAddresses() { + return emailAddresses; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas. + */ + @JsonProperty("phone_numbers") + public Optional getPhoneNumbers() { + return phoneNumbers; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsListRequest && equalTo((ContactsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsListRequest other) { + return expand.equals(other.expand) + && accountId.equals(other.accountId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && emailAddresses.equals(other.emailAddresses) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && phoneNumbers.equals(other.phoneNumbers) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.accountId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.emailAddresses, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.phoneNumbers, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional accountId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional emailAddresses = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional phoneNumbers = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsListRequest other) { + expand(other.getExpand()); + accountId(other.getAccountId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + emailAddresses(other.getEmailAddresses()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + phoneNumbers(other.getPhoneNumbers()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ContactsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) + public Builder accountId(Optional accountId) { + this.accountId = accountId; + return this; + } + + public Builder accountId(String accountId) { + this.accountId = Optional.ofNullable(accountId); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "email_addresses", nulls = Nulls.SKIP) + public Builder emailAddresses(Optional emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + public Builder emailAddresses(String emailAddresses) { + this.emailAddresses = Optional.ofNullable(emailAddresses); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) + public Builder phoneNumbers(Optional phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder phoneNumbers(String phoneNumbers) { + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public ContactsListRequest build() { + return new ContactsListRequest( + expand, + accountId, + createdAfter, + createdBefore, + cursor, + emailAddresses, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + phoneNumbers, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ContactsListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/ContactsListRequestExpandItem.java new file mode 100644 index 000000000..8ea7e82a7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactsListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ContactsListRequestExpandItem { + ACCOUNT("account"), + + OWNER("owner"); + + private final String value; + + ContactsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..b582cd54a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java @@ -0,0 +1,278 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsRemoteFieldClassesListRequest.Builder.class) +public final class ContactsRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ContactsRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional isCommonModelField, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsRemoteFieldClassesListRequest + && equalTo((ContactsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.isCommonModelField, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ContactsRemoteFieldClassesListRequest build() { + return new ContactsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + isCommonModelField, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/ContactsRetrieveRequest.java new file mode 100644 index 000000000..4555f4558 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactsRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsRetrieveRequest.Builder.class) +public final class ContactsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ContactsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsRetrieveRequest && equalTo((ContactsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ContactsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ContactsRetrieveRequest build() { + return new ContactsRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ContactsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/ContactsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..6f9905633 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactsRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ContactsRetrieveRequestExpandItem { + ACCOUNT("account"), + + OWNER("owner"); + + private final String value; + + ContactsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/CountryEnum.java b/src/main/java/com/merge/api/crm/types/CountryEnum.java new file mode 100644 index 000000000..3a59fe1af --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CountryEnum.java @@ -0,0 +1,518 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CountryEnum { + AF("AF"), + + AX("AX"), + + AL("AL"), + + DZ("DZ"), + + AS("AS"), + + AD("AD"), + + AO("AO"), + + AI("AI"), + + AQ("AQ"), + + AG("AG"), + + AR("AR"), + + AM("AM"), + + AW("AW"), + + AU("AU"), + + AT("AT"), + + AZ("AZ"), + + BS("BS"), + + BH("BH"), + + BD("BD"), + + BB("BB"), + + BY("BY"), + + BE("BE"), + + BZ("BZ"), + + BJ("BJ"), + + BM("BM"), + + BT("BT"), + + BO("BO"), + + BQ("BQ"), + + BA("BA"), + + BW("BW"), + + BV("BV"), + + BR("BR"), + + IO("IO"), + + BN("BN"), + + BG("BG"), + + BF("BF"), + + BI("BI"), + + CV("CV"), + + KH("KH"), + + CM("CM"), + + CA("CA"), + + KY("KY"), + + CF("CF"), + + TD("TD"), + + CL("CL"), + + CN("CN"), + + CX("CX"), + + CC("CC"), + + CO("CO"), + + KM("KM"), + + CG("CG"), + + CD("CD"), + + CK("CK"), + + CR("CR"), + + CI("CI"), + + HR("HR"), + + CU("CU"), + + CW("CW"), + + CY("CY"), + + CZ("CZ"), + + DK("DK"), + + DJ("DJ"), + + DM("DM"), + + DO("DO"), + + EC("EC"), + + EG("EG"), + + SV("SV"), + + GQ("GQ"), + + ER("ER"), + + EE("EE"), + + SZ("SZ"), + + ET("ET"), + + FK("FK"), + + FO("FO"), + + FJ("FJ"), + + FI("FI"), + + FR("FR"), + + GF("GF"), + + PF("PF"), + + TF("TF"), + + GA("GA"), + + GM("GM"), + + GE("GE"), + + DE("DE"), + + GH("GH"), + + GI("GI"), + + GR("GR"), + + GL("GL"), + + GD("GD"), + + GP("GP"), + + GU("GU"), + + GT("GT"), + + GG("GG"), + + GN("GN"), + + GW("GW"), + + GY("GY"), + + HT("HT"), + + HM("HM"), + + VA("VA"), + + HN("HN"), + + HK("HK"), + + HU("HU"), + + IS("IS"), + + IN("IN"), + + ID("ID"), + + IR("IR"), + + IQ("IQ"), + + IE("IE"), + + IM("IM"), + + IL("IL"), + + IT("IT"), + + JM("JM"), + + JP("JP"), + + JE("JE"), + + JO("JO"), + + KZ("KZ"), + + KE("KE"), + + KI("KI"), + + KW("KW"), + + KG("KG"), + + LA("LA"), + + LV("LV"), + + LB("LB"), + + LS("LS"), + + LR("LR"), + + LY("LY"), + + LI("LI"), + + LT("LT"), + + LU("LU"), + + MO("MO"), + + MG("MG"), + + MW("MW"), + + MY("MY"), + + MV("MV"), + + ML("ML"), + + MT("MT"), + + MH("MH"), + + MQ("MQ"), + + MR("MR"), + + MU("MU"), + + YT("YT"), + + MX("MX"), + + FM("FM"), + + MD("MD"), + + MC("MC"), + + MN("MN"), + + ME("ME"), + + MS("MS"), + + MA("MA"), + + MZ("MZ"), + + MM("MM"), + + NA("NA"), + + NR("NR"), + + NP("NP"), + + NL("NL"), + + NC("NC"), + + NZ("NZ"), + + NI("NI"), + + NE("NE"), + + NG("NG"), + + NU("NU"), + + NF("NF"), + + KP("KP"), + + MK("MK"), + + MP("MP"), + + NO("NO"), + + OM("OM"), + + PK("PK"), + + PW("PW"), + + PS("PS"), + + PA("PA"), + + PG("PG"), + + PY("PY"), + + PE("PE"), + + PH("PH"), + + PN("PN"), + + PL("PL"), + + PT("PT"), + + PR("PR"), + + QA("QA"), + + RE("RE"), + + RO("RO"), + + RU("RU"), + + RW("RW"), + + BL("BL"), + + SH("SH"), + + KN("KN"), + + LC("LC"), + + MF("MF"), + + PM("PM"), + + VC("VC"), + + WS("WS"), + + SM("SM"), + + ST("ST"), + + SA("SA"), + + SN("SN"), + + RS("RS"), + + SC("SC"), + + SL("SL"), + + SG("SG"), + + SX("SX"), + + SK("SK"), + + SI("SI"), + + SB("SB"), + + SO("SO"), + + ZA("ZA"), + + GS("GS"), + + KR("KR"), + + SS("SS"), + + ES("ES"), + + LK("LK"), + + SD("SD"), + + SR("SR"), + + SJ("SJ"), + + SE("SE"), + + CH("CH"), + + SY("SY"), + + TW("TW"), + + TJ("TJ"), + + TZ("TZ"), + + TH("TH"), + + TL("TL"), + + TG("TG"), + + TK("TK"), + + TO("TO"), + + TT("TT"), + + TN("TN"), + + TR("TR"), + + TM("TM"), + + TC("TC"), + + TV("TV"), + + UG("UG"), + + UA("UA"), + + AE("AE"), + + GB("GB"), + + UM("UM"), + + US("US"), + + UY("UY"), + + UZ("UZ"), + + VU("VU"), + + VE("VE"), + + VN("VN"), + + VG("VG"), + + VI("VI"), + + WF("WF"), + + EH("EH"), + + YE("YE"), + + ZM("ZM"), + + ZW("ZW"); + + private final String value; + + CountryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/crm/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..671fe6356 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CreateFieldMappingRequest.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final String targetFieldName; + + private final String targetFieldDescription; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + String targetFieldName, + String targetFieldDescription, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return The name of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_name") + public String getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_description") + public String getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TargetFieldNameStage builder() { + return new Builder(); + } + + public interface TargetFieldNameStage { + TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); + + Builder from(CreateFieldMappingRequest other); + } + + public interface TargetFieldDescriptionStage { + RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); + } + + public interface RemoteMethodStage { + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + } + + public interface RemoteUrlPathStage { + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TargetFieldNameStage, + TargetFieldDescriptionStage, + RemoteMethodStage, + RemoteUrlPathStage, + CommonModelNameStage, + _FinalStage { + private String targetFieldName; + + private String targetFieldDescription; + + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + return this; + } + + /** + *

The name of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_name") + public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

The description of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_description") + public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

The method of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

The path of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

The name of the Common Model that the remote field corresponds to in a given category.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/accounts/requests/CrmAccountEndpointRequest.java b/src/main/java/com/merge/api/crm/types/CrmAccountEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/accounts/requests/CrmAccountEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/CrmAccountEndpointRequest.java index f51645821..bd4ba281d 100644 --- a/src/main/java/com/merge/api/resources/crm/accounts/requests/CrmAccountEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/CrmAccountEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.accounts.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.AccountRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/CrmAccountResponse.java b/src/main/java/com/merge/api/crm/types/CrmAccountResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/CrmAccountResponse.java rename to src/main/java/com/merge/api/crm/types/CrmAccountResponse.java index c1264c3e9..3de57f53d 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CrmAccountResponse.java +++ b/src/main/java/com/merge/api/crm/types/CrmAccountResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/associationtypes/requests/CrmAssociationTypeEndpointRequest.java b/src/main/java/com/merge/api/crm/types/CrmAssociationTypeEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/associationtypes/requests/CrmAssociationTypeEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/CrmAssociationTypeEndpointRequest.java index 75a677578..075633985 100644 --- a/src/main/java/com/merge/api/resources/crm/associationtypes/requests/CrmAssociationTypeEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/CrmAssociationTypeEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.associationtypes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.AssociationTypeRequestRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/CrmAssociationTypeResponse.java b/src/main/java/com/merge/api/crm/types/CrmAssociationTypeResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/CrmAssociationTypeResponse.java rename to src/main/java/com/merge/api/crm/types/CrmAssociationTypeResponse.java index a056321d1..ca111bd51 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CrmAssociationTypeResponse.java +++ b/src/main/java/com/merge/api/crm/types/CrmAssociationTypeResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/contacts/requests/CrmContactEndpointRequest.java b/src/main/java/com/merge/api/crm/types/CrmContactEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/contacts/requests/CrmContactEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/CrmContactEndpointRequest.java index d6266004b..aac4bb74e 100644 --- a/src/main/java/com/merge/api/resources/crm/contacts/requests/CrmContactEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/CrmContactEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.contacts.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.ContactRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/CrmContactResponse.java b/src/main/java/com/merge/api/crm/types/CrmContactResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/CrmContactResponse.java rename to src/main/java/com/merge/api/crm/types/CrmContactResponse.java index 16ebf5759..b9eadf788 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CrmContactResponse.java +++ b/src/main/java/com/merge/api/crm/types/CrmContactResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CrmCustomObjectEndpointRequest.java b/src/main/java/com/merge/api/crm/types/CrmCustomObjectEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/customobjects/requests/CrmCustomObjectEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/CrmCustomObjectEndpointRequest.java index 36f3bc159..c7584f5f5 100644 --- a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CrmCustomObjectEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/CrmCustomObjectEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.customobjects.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.CustomObjectRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/CrmCustomObjectResponse.java b/src/main/java/com/merge/api/crm/types/CrmCustomObjectResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/CrmCustomObjectResponse.java rename to src/main/java/com/merge/api/crm/types/CrmCustomObjectResponse.java index 751400b34..3e7866230 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CrmCustomObjectResponse.java +++ b/src/main/java/com/merge/api/crm/types/CrmCustomObjectResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/CustomObject.java b/src/main/java/com/merge/api/crm/types/CustomObject.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/CustomObject.java rename to src/main/java/com/merge/api/crm/types/CustomObject.java index 31d583081..0b4f604fb 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CustomObject.java +++ b/src/main/java/com/merge/api/crm/types/CustomObject.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/CustomObjectClass.java b/src/main/java/com/merge/api/crm/types/CustomObjectClass.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/CustomObjectClass.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClass.java index 2516086a9..a1b27ae7e 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CustomObjectClass.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClass.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesListRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java index 35d9653b4..330c509be 100644 --- a/src/main/java/com/merge/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.associationtypes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesAssociationTypesListRequest.Builder.class) public final class CustomObjectClassesAssociationTypesListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -46,10 +48,10 @@ public final class CustomObjectClassesAssociationTypesListRequest { private final Map additionalProperties; private CustomObjectClassesAssociationTypesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -58,10 +60,10 @@ private CustomObjectClassesAssociationTypesListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -72,6 +74,14 @@ private CustomObjectClassesAssociationTypesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -96,14 +106,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -173,10 +175,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(CustomObjectClassesAssociationTypesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -189,10 +191,10 @@ private boolean equalTo(CustomObjectClassesAssociationTypesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -213,14 +215,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -241,10 +243,10 @@ public static final class Builder { private Builder() {} public Builder from(CustomObjectClassesAssociationTypesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -255,6 +257,22 @@ public Builder from(CustomObjectClassesAssociationTypesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -288,17 +306,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -378,10 +385,10 @@ public Builder remoteId(String remoteId) { public CustomObjectClassesAssociationTypesListRequest build() { return new CustomObjectClassesAssociationTypesListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequest.java new file mode 100644 index 000000000..94d5c9b2e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomObjectClassesAssociationTypesRetrieveRequest.Builder.class) +public final class CustomObjectClassesAssociationTypesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private CustomObjectClassesAssociationTypesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesAssociationTypesRetrieveRequest + && equalTo((CustomObjectClassesAssociationTypesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesAssociationTypesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectClassesAssociationTypesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public CustomObjectClassesAssociationTypesRetrieveRequest build() { + return new CustomObjectClassesAssociationTypesRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsListRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java index afc25d34c..ce96d6534 100644 --- a/src/main/java/com/merge/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.associations.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesCustomObjectsAssociationsListRequest.Builder.class) public final class CustomObjectClassesCustomObjectsAssociationsListRequest { + private final Optional> expand; + private final Optional associationTypeId; private final Optional createdAfter; @@ -29,8 +33,6 @@ public final class CustomObjectClassesCustomObjectsAssociationsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -48,11 +50,11 @@ public final class CustomObjectClassesCustomObjectsAssociationsListRequest { private final Map additionalProperties; private CustomObjectClassesCustomObjectsAssociationsListRequest( + Optional> expand, Optional associationTypeId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,11 +63,11 @@ private CustomObjectClassesCustomObjectsAssociationsListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.associationTypeId = associationTypeId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -76,6 +78,14 @@ private CustomObjectClassesCustomObjectsAssociationsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return opportunities with this association_type. */ @@ -108,14 +118,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -185,11 +187,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(CustomObjectClassesCustomObjectsAssociationsListRequest other) { - return associationTypeId.equals(other.associationTypeId) + return expand.equals(other.expand) + && associationTypeId.equals(other.associationTypeId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -202,11 +204,11 @@ private boolean equalTo(CustomObjectClassesCustomObjectsAssociationsListRequest @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.associationTypeId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -227,6 +229,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional associationTypeId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -235,8 +239,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -257,11 +259,11 @@ public static final class Builder { private Builder() {} public Builder from(CustomObjectClassesCustomObjectsAssociationsListRequest other) { + expand(other.getExpand()); associationTypeId(other.getAssociationTypeId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -272,6 +274,22 @@ public Builder from(CustomObjectClassesCustomObjectsAssociationsListRequest othe return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "association_type_id", nulls = Nulls.SKIP) public Builder associationTypeId(Optional associationTypeId) { this.associationTypeId = associationTypeId; @@ -316,17 +334,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -406,11 +413,11 @@ public Builder remoteId(String remoteId) { public CustomObjectClassesCustomObjectsAssociationsListRequest build() { return new CustomObjectClassesCustomObjectsAssociationsListRequest( + expand, associationTypeId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java index a0909895f..ffeb773a4 100644 --- a/src/main/java/com/merge/api/resources/crm/associations/requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.associations.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsListRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java index 6843a694e..205e272e9 100644 --- a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.customobjects.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java index 35b70c2f1..b284a3814 100644 --- a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.customobjects.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRetrieveRequest.java similarity index 78% rename from src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRetrieveRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRetrieveRequest.java index 8578c2a2f..ba2af3615 100644 --- a/src/main/java/com/merge/api/resources/crm/customobjects/requests/CustomObjectClassesCustomObjectsRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.customobjects.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -24,14 +24,18 @@ public final class CustomObjectClassesCustomObjectsRetrieveRequest { private final Optional includeRemoteFields; + private final Optional includeShellData; + private final Map additionalProperties; private CustomObjectClassesCustomObjectsRetrieveRequest( Optional includeRemoteData, Optional includeRemoteFields, + Optional includeShellData, Map additionalProperties) { this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; this.additionalProperties = additionalProperties; } @@ -51,6 +55,14 @@ public Optional getIncludeRemoteFields() { return includeRemoteFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -65,12 +77,13 @@ public Map getAdditionalProperties() { private boolean equalTo(CustomObjectClassesCustomObjectsRetrieveRequest other) { return includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); } @java.lang.Override public int hashCode() { - return Objects.hash(this.includeRemoteData, this.includeRemoteFields); + return Objects.hash(this.includeRemoteData, this.includeRemoteFields, this.includeShellData); } @java.lang.Override @@ -88,6 +101,8 @@ public static final class Builder { private Optional includeRemoteFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -96,6 +111,7 @@ private Builder() {} public Builder from(CustomObjectClassesCustomObjectsRetrieveRequest other) { includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); return this; } @@ -121,9 +137,20 @@ public Builder includeRemoteFields(Boolean includeRemoteFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + public CustomObjectClassesCustomObjectsRetrieveRequest build() { return new CustomObjectClassesCustomObjectsRetrieveRequest( - includeRemoteData, includeRemoteFields, additionalProperties); + includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/crm/customobjectclasses/requests/CustomObjectClassesListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/customobjectclasses/requests/CustomObjectClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java index 145158f72..57bb9d210 100644 --- a/src/main/java/com/merge/api/resources/crm/customobjectclasses/requests/CustomObjectClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.customobjectclasses.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesListRequest.Builder.class) public final class CustomObjectClassesListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -46,10 +48,10 @@ public final class CustomObjectClassesListRequest { private final Map additionalProperties; private CustomObjectClassesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -58,10 +60,10 @@ private CustomObjectClassesListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -72,6 +74,14 @@ private CustomObjectClassesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -96,14 +106,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -172,10 +174,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(CustomObjectClassesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -188,10 +190,10 @@ private boolean equalTo(CustomObjectClassesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -212,14 +214,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -240,10 +242,10 @@ public static final class Builder { private Builder() {} public Builder from(CustomObjectClassesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -254,6 +256,22 @@ public Builder from(CustomObjectClassesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -287,17 +305,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -377,10 +384,10 @@ public Builder remoteId(String remoteId) { public CustomObjectClassesListRequest build() { return new CustomObjectClassesListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequest.java new file mode 100644 index 000000000..0eb44b9d2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomObjectClassesRetrieveRequest.Builder.class) +public final class CustomObjectClassesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private CustomObjectClassesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesRetrieveRequest + && equalTo((CustomObjectClassesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CustomObjectClassesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectClassesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public CustomObjectClassesRetrieveRequest build() { + return new CustomObjectClassesRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/CustomObjectRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/types/CustomObjectRequest.java rename to src/main/java/com/merge/api/crm/types/CustomObjectRequest.java index 34e483b3f..f58f32c73 100644 --- a/src/main/java/com/merge/api/resources/crm/types/CustomObjectRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/crm/types/DataPassthroughRequest.java new file mode 100644 index 000000000..4dfac8ab7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/DataPassthroughRequest.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final MethodEnum method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + MethodEnum method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public MethodEnum getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull MethodEnum method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + _FinalStage data(Optional data); + + _FinalStage data(String data); + + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(RequestFormatEnum requestFormat); + + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private MethodEnum method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull MethodEnum method) { + this.method = method; + return this; + } + + /** + *

The path of the request in the third party's platform.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

The data with the request. You must include a request_format parameter matching the data's format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

An optional override of the third party's base url for the request.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/DebugModeLog.java b/src/main/java/com/merge/api/crm/types/DebugModeLog.java new file mode 100644 index 000000000..ed88abefb --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/crm/types/DebugModelLogSummary.java new file mode 100644 index 000000000..34fa221a2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/DirectionEnum.java b/src/main/java/com/merge/api/crm/types/DirectionEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/crm/types/DirectionEnum.java rename to src/main/java/com/merge/api/crm/types/DirectionEnum.java index f20d5dc96..57ca7f15b 100644 --- a/src/main/java/com/merge/api/resources/crm/types/DirectionEnum.java +++ b/src/main/java/com/merge/api/crm/types/DirectionEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/crm/types/EmailAddress.java b/src/main/java/com/merge/api/crm/types/EmailAddress.java new file mode 100644 index 000000000..e8c4f5241 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EmailAddress.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailAddress.Builder.class) +public final class EmailAddress { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional emailAddress; + + private final Optional emailAddressType; + + private final Map additionalProperties; + + private EmailAddress( + Optional createdAt, + Optional modifiedAt, + Optional emailAddress, + Optional emailAddressType, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.emailAddress = emailAddress; + this.emailAddressType = emailAddressType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The email address's type. + */ + @JsonProperty("email_address_type") + public Optional getEmailAddressType() { + return emailAddressType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailAddress && equalTo((EmailAddress) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailAddress other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && emailAddress.equals(other.emailAddress) + && emailAddressType.equals(other.emailAddressType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.emailAddress, this.emailAddressType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional emailAddressType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailAddress other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + emailAddress(other.getEmailAddress()); + emailAddressType(other.getEmailAddressType()); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) + public Builder emailAddressType(Optional emailAddressType) { + this.emailAddressType = emailAddressType; + return this; + } + + public Builder emailAddressType(String emailAddressType) { + this.emailAddressType = Optional.ofNullable(emailAddressType); + return this; + } + + public EmailAddress build() { + return new EmailAddress(createdAt, modifiedAt, emailAddress, emailAddressType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/EmailAddressRequest.java b/src/main/java/com/merge/api/crm/types/EmailAddressRequest.java new file mode 100644 index 000000000..b04441886 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EmailAddressRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmailAddressRequest.Builder.class) +public final class EmailAddressRequest { + private final Optional emailAddress; + + private final Optional emailAddressType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private EmailAddressRequest( + Optional emailAddress, + Optional emailAddressType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.emailAddress = emailAddress; + this.emailAddressType = emailAddressType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The email address's type. + */ + @JsonProperty("email_address_type") + public Optional getEmailAddressType() { + return emailAddressType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmailAddressRequest && equalTo((EmailAddressRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmailAddressRequest other) { + return emailAddress.equals(other.emailAddress) + && emailAddressType.equals(other.emailAddressType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.emailAddress, this.emailAddressType, this.integrationParams, this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional emailAddress = Optional.empty(); + + private Optional emailAddressType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmailAddressRequest other) { + emailAddress(other.getEmailAddress()); + emailAddressType(other.getEmailAddressType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) + public Builder emailAddressType(Optional emailAddressType) { + this.emailAddressType = emailAddressType; + return this; + } + + public Builder emailAddressType(String emailAddressType) { + this.emailAddressType = Optional.ofNullable(emailAddressType); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public EmailAddressRequest build() { + return new EmailAddressRequest( + emailAddress, emailAddressType, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/crm/types/EnabledActionsEnum.java new file mode 100644 index 000000000..d30be3d90 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EnabledActionsEnum { + READ("READ"), + + WRITE("WRITE"); + + private final String value; + + EnabledActionsEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/EncodingEnum.java b/src/main/java/com/merge/api/crm/types/EncodingEnum.java new file mode 100644 index 000000000..2f74c1891 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EncodingEnum { + RAW("RAW"), + + BASE_64("BASE64"), + + GZIP_BASE_64("GZIP_BASE64"); + + private final String value; + + EncodingEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/crm/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..433d505f7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EndUserDetailsRequest.java @@ -0,0 +1,607 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + _FinalStage language(Optional language); + + _FinalStage language(LanguageEnum language); + + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + return this; + } + + /** + *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

Your end user's organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

A JSON object containing integration-specific configuration options.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

The following subset of IETF language tags can be used to configure localization.

+ *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/Engagement.java b/src/main/java/com/merge/api/crm/types/Engagement.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/types/Engagement.java rename to src/main/java/com/merge/api/crm/types/Engagement.java index 9f3e6429b..c9392c271 100644 --- a/src/main/java/com/merge/api/resources/crm/types/Engagement.java +++ b/src/main/java/com/merge/api/crm/types/Engagement.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,7 +37,7 @@ public final class Engagement { private final Optional subject; - private final Optional direction; + private final Optional direction; private final Optional engagementType; @@ -67,7 +67,7 @@ private Engagement( Optional owner, Optional content, Optional subject, - Optional direction, + Optional direction, Optional engagementType, Optional startTime, Optional endTime, @@ -159,7 +159,7 @@ public Optional getSubject() { * */ @JsonProperty("direction") - public Optional getDirection() { + public Optional getDirection() { return direction; } @@ -301,7 +301,7 @@ public static final class Builder { private Optional subject = Optional.empty(); - private Optional direction = Optional.empty(); + private Optional direction = Optional.empty(); private Optional engagementType = Optional.empty(); @@ -425,12 +425,12 @@ public Builder subject(String subject) { } @JsonSetter(value = "direction", nulls = Nulls.SKIP) - public Builder direction(Optional direction) { + public Builder direction(Optional direction) { this.direction = direction; return this; } - public Builder direction(EngagementDirection direction) { + public Builder direction(DirectionEnum direction) { this.direction = Optional.ofNullable(direction); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementAccount.java b/src/main/java/com/merge/api/crm/types/EngagementAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/EngagementAccount.java rename to src/main/java/com/merge/api/crm/types/EngagementAccount.java index 299373100..6d9f118f3 100644 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementAccount.java +++ b/src/main/java/com/merge/api/crm/types/EngagementAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EngagementAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EngagementAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementContactsItem.java b/src/main/java/com/merge/api/crm/types/EngagementContactsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/EngagementContactsItem.java rename to src/main/java/com/merge/api/crm/types/EngagementContactsItem.java index b1186833e..778f5c1de 100644 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementContactsItem.java +++ b/src/main/java/com/merge/api/crm/types/EngagementContactsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public EngagementContactsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EngagementContactsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementEndpointRequest.java b/src/main/java/com/merge/api/crm/types/EngagementEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/EngagementEndpointRequest.java index 6feac4586..1f8e10c38 100644 --- a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.engagements.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.EngagementRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementEngagementType.java b/src/main/java/com/merge/api/crm/types/EngagementEngagementType.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/EngagementEngagementType.java rename to src/main/java/com/merge/api/crm/types/EngagementEngagementType.java index 359909ca1..cb5880e92 100644 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementEngagementType.java +++ b/src/main/java/com/merge/api/crm/types/EngagementEngagementType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EngagementOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EngagementOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementRequest.java b/src/main/java/com/merge/api/crm/types/EngagementRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/EngagementRequest.java rename to src/main/java/com/merge/api/crm/types/EngagementRequest.java index dc757eaf1..b29e261a0 100644 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -29,7 +29,7 @@ public final class EngagementRequest { private final Optional subject; - private final Optional direction; + private final Optional direction; private final Optional engagementType; @@ -53,7 +53,7 @@ private EngagementRequest( Optional owner, Optional content, Optional subject, - Optional direction, + Optional direction, Optional engagementType, Optional startTime, Optional endTime, @@ -110,7 +110,7 @@ public Optional getSubject() { * */ @JsonProperty("direction") - public Optional getDirection() { + public Optional getDirection() { return direction; } @@ -226,7 +226,7 @@ public static final class Builder { private Optional subject = Optional.empty(); - private Optional direction = Optional.empty(); + private Optional direction = Optional.empty(); private Optional engagementType = Optional.empty(); @@ -299,12 +299,12 @@ public Builder subject(String subject) { } @JsonSetter(value = "direction", nulls = Nulls.SKIP) - public Builder direction(Optional direction) { + public Builder direction(Optional direction) { this.direction = direction; return this; } - public Builder direction(EngagementRequestDirection direction) { + public Builder direction(DirectionEnum direction) { this.direction = Optional.ofNullable(direction); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementRequestAccount.java b/src/main/java/com/merge/api/crm/types/EngagementRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/EngagementRequestAccount.java rename to src/main/java/com/merge/api/crm/types/EngagementRequestAccount.java index 4d6115b0c..1c04673ee 100644 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementRequestAccount.java +++ b/src/main/java/com/merge/api/crm/types/EngagementRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public EngagementRequestOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EngagementRequestOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementResponse.java b/src/main/java/com/merge/api/crm/types/EngagementResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/EngagementResponse.java rename to src/main/java/com/merge/api/crm/types/EngagementResponse.java index 6bb429fe5..da16dab9c 100644 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementResponse.java +++ b/src/main/java/com/merge/api/crm/types/EngagementResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementType.java b/src/main/java/com/merge/api/crm/types/EngagementType.java similarity index 94% rename from src/main/java/com/merge/api/resources/crm/types/EngagementType.java rename to src/main/java/com/merge/api/crm/types/EngagementType.java index 730b41a99..efb597bd6 100644 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementType.java +++ b/src/main/java/com/merge/api/crm/types/EngagementType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -30,7 +30,7 @@ public final class EngagementType { private final Optional modifiedAt; - private final Optional activityType; + private final Optional activityType; private final Optional name; @@ -43,7 +43,7 @@ private EngagementType( Optional remoteId, Optional createdAt, Optional modifiedAt, - Optional activityType, + Optional activityType, Optional name, Optional> remoteFields, Map additionalProperties) { @@ -95,7 +95,7 @@ public Optional getModifiedAt() { * */ @JsonProperty("activity_type") - public Optional getActivityType() { + public Optional getActivityType() { return activityType; } @@ -164,7 +164,7 @@ public static final class Builder { private Optional modifiedAt = Optional.empty(); - private Optional activityType = Optional.empty(); + private Optional activityType = Optional.empty(); private Optional name = Optional.empty(); @@ -231,12 +231,12 @@ public Builder modifiedAt(OffsetDateTime modifiedAt) { } @JsonSetter(value = "activity_type", nulls = Nulls.SKIP) - public Builder activityType(Optional activityType) { + public Builder activityType(Optional activityType) { this.activityType = activityType; return this; } - public Builder activityType(EngagementTypeActivityType activityType) { + public Builder activityType(ActivityTypeEnum activityType) { this.activityType = Optional.ofNullable(activityType); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesListRequest.java rename to src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java index 943c59513..6345a67e8 100644 --- a/src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.engagementtypes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java index 976cffed8..dc0c383cd 100644 --- a/src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.engagementtypes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/EngagementTypesRetrieveRequest.java similarity index 76% rename from src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesRetrieveRequest.java rename to src/main/java/com/merge/api/crm/types/EngagementTypesRetrieveRequest.java index 754172f27..236c93321 100644 --- a/src/main/java/com/merge/api/resources/crm/engagementtypes/requests/EngagementTypesRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementTypesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.engagementtypes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -24,14 +24,18 @@ public final class EngagementTypesRetrieveRequest { private final Optional includeRemoteFields; + private final Optional includeShellData; + private final Map additionalProperties; private EngagementTypesRetrieveRequest( Optional includeRemoteData, Optional includeRemoteFields, + Optional includeShellData, Map additionalProperties) { this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; this.additionalProperties = additionalProperties; } @@ -51,6 +55,14 @@ public Optional getIncludeRemoteFields() { return includeRemoteFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -64,12 +76,13 @@ public Map getAdditionalProperties() { private boolean equalTo(EngagementTypesRetrieveRequest other) { return includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); } @java.lang.Override public int hashCode() { - return Objects.hash(this.includeRemoteData, this.includeRemoteFields); + return Objects.hash(this.includeRemoteData, this.includeRemoteFields, this.includeShellData); } @java.lang.Override @@ -87,6 +100,8 @@ public static final class Builder { private Optional includeRemoteFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -95,6 +110,7 @@ private Builder() {} public Builder from(EngagementTypesRetrieveRequest other) { includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); return this; } @@ -120,8 +136,20 @@ public Builder includeRemoteFields(Boolean includeRemoteFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + public EngagementTypesRetrieveRequest build() { - return new EngagementTypesRetrieveRequest(includeRemoteData, includeRemoteFields, additionalProperties); + return new EngagementTypesRetrieveRequest( + includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsListRequest.java rename to src/main/java/com/merge/api/crm/types/EngagementsListRequest.java index 88b094dec..27adfbf7f 100644 --- a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.engagements.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.engagements.types.EngagementsListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EngagementsListRequest.Builder.class) public final class EngagementsListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -53,10 +54,10 @@ public final class EngagementsListRequest { private final Map additionalProperties; private EngagementsListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -68,10 +69,10 @@ private EngagementsListRequest( Optional startedAfter, Optional startedBefore, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -85,6 +86,14 @@ private EngagementsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -109,14 +118,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -209,10 +210,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(EngagementsListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -228,10 +229,10 @@ private boolean equalTo(EngagementsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -255,14 +256,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -289,10 +290,10 @@ public static final class Builder { private Builder() {} public Builder from(EngagementsListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -306,6 +307,22 @@ public Builder from(EngagementsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EngagementsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -339,17 +356,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EngagementsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -462,10 +468,10 @@ public Builder startedBefore(OffsetDateTime startedBefore) { public EngagementsListRequest build() { return new EngagementsListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/crm/types/EngagementsListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/EngagementsListRequestExpandItem.java new file mode 100644 index 000000000..80cd410ee --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EngagementsListRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EngagementsListRequestExpandItem { + ACCOUNT("account"), + + CONTACTS("contacts"), + + ENGAGEMENT_TYPE("engagement_type"), + + OWNER("owner"); + + private final String value; + + EngagementsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java index 520646632..f78f2d9af 100644 --- a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.engagements.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/EngagementsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/EngagementsRetrieveRequest.java new file mode 100644 index 000000000..66f8f8edf --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EngagementsRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EngagementsRetrieveRequest.Builder.class) +public final class EngagementsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private EngagementsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementsRetrieveRequest && equalTo((EngagementsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EngagementsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EngagementsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EngagementsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public EngagementsRetrieveRequest build() { + return new EngagementsRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/EngagementsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/EngagementsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..0c369c228 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EngagementsRetrieveRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EngagementsRetrieveRequestExpandItem { + ACCOUNT("account"), + + CONTACTS("contacts"), + + ENGAGEMENT_TYPE("engagement_type"), + + OWNER("owner"); + + private final String value; + + EngagementsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/crm/types/ErrorValidationProblem.java new file mode 100644 index 000000000..280186b53 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ErrorValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/EventTypeEnum.java b/src/main/java/com/merge/api/crm/types/EventTypeEnum.java new file mode 100644 index 000000000..bb0e53b73 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EventTypeEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EventTypeEnum { + CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), + + DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), + + CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), + + DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), + + REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), + + INVITED_USER("INVITED_USER"), + + TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), + + TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), + + DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), + + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT("DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"), + + CREATED_DESTINATION("CREATED_DESTINATION"), + + DELETED_DESTINATION("DELETED_DESTINATION"), + + CHANGED_DESTINATION("CHANGED_DESTINATION"), + + CHANGED_SCOPES("CHANGED_SCOPES"), + + CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), + + CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), + + ENABLED_INTEGRATION("ENABLED_INTEGRATION"), + + DISABLED_INTEGRATION("DISABLED_INTEGRATION"), + + ENABLED_CATEGORY("ENABLED_CATEGORY"), + + DISABLED_CATEGORY("DISABLED_CATEGORY"), + + CHANGED_PASSWORD("CHANGED_PASSWORD"), + + RESET_PASSWORD("RESET_PASSWORD"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), + + DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), + + DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), + + MUTED_ISSUE("MUTED_ISSUE"), + + GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), + + ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), + + DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), + + MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), + + END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); + + private final String value; + + EventTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..1b7617a11 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..b8e0d70c6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> account; + + private final Optional> contact; + + private final Optional> lead; + + private final Optional> note; + + private final Optional> opportunity; + + private final Optional> stage; + + private final Optional> user; + + private final Optional> task; + + private final Optional> engagement; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> account, + Optional> contact, + Optional> lead, + Optional> note, + Optional> opportunity, + Optional> stage, + Optional> user, + Optional> task, + Optional> engagement, + Map additionalProperties) { + this.account = account; + this.contact = contact; + this.lead = lead; + this.note = note; + this.opportunity = opportunity; + this.stage = stage; + this.user = user; + this.task = task; + this.engagement = engagement; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @JsonProperty("Lead") + public Optional> getLead() { + return lead; + } + + @JsonProperty("Note") + public Optional> getNote() { + return note; + } + + @JsonProperty("Opportunity") + public Optional> getOpportunity() { + return opportunity; + } + + @JsonProperty("Stage") + public Optional> getStage() { + return stage; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Task") + public Optional> getTask() { + return task; + } + + @JsonProperty("Engagement") + public Optional> getEngagement() { + return engagement; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return account.equals(other.account) + && contact.equals(other.contact) + && lead.equals(other.lead) + && note.equals(other.note) + && opportunity.equals(other.opportunity) + && stage.equals(other.stage) + && user.equals(other.user) + && task.equals(other.task) + && engagement.equals(other.engagement); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.account, + this.contact, + this.lead, + this.note, + this.opportunity, + this.stage, + this.user, + this.task, + this.engagement); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> account = Optional.empty(); + + private Optional> contact = Optional.empty(); + + private Optional> lead = Optional.empty(); + + private Optional> note = Optional.empty(); + + private Optional> opportunity = Optional.empty(); + + private Optional> stage = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> task = Optional.empty(); + + private Optional> engagement = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + account(other.getAccount()); + contact(other.getContact()); + lead(other.getLead()); + note(other.getNote()); + opportunity(other.getOpportunity()); + stage(other.getStage()); + user(other.getUser()); + task(other.getTask()); + engagement(other.getEngagement()); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "Lead", nulls = Nulls.SKIP) + public Builder lead(Optional> lead) { + this.lead = lead; + return this; + } + + public Builder lead(List lead) { + this.lead = Optional.ofNullable(lead); + return this; + } + + @JsonSetter(value = "Note", nulls = Nulls.SKIP) + public Builder note(Optional> note) { + this.note = note; + return this; + } + + public Builder note(List note) { + this.note = Optional.ofNullable(note); + return this; + } + + @JsonSetter(value = "Opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional> opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(List opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + return this; + } + + @JsonSetter(value = "Stage", nulls = Nulls.SKIP) + public Builder stage(Optional> stage) { + this.stage = stage; + return this; + } + + public Builder stage(List stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Task", nulls = Nulls.SKIP) + public Builder task(Optional> task) { + this.task = task; + return this; + } + + public Builder task(List task) { + this.task = Optional.ofNullable(task); + return this; + } + + @JsonSetter(value = "Engagement", nulls = Nulls.SKIP) + public Builder engagement(Optional> engagement) { + this.engagement = engagement; + return this; + } + + public Builder engagement(List engagement) { + this.engagement = Optional.ofNullable(engagement); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse( + account, contact, lead, note, opportunity, stage, user, task, engagement, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldFormatEnum.java b/src/main/java/com/merge/api/crm/types/FieldFormatEnum.java new file mode 100644 index 000000000..775e90160 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FieldFormatEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + FieldFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..516152862 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..5cc3f38cb --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..3dda3e9dc --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..7c1b76318 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> account; + + private final Optional> contact; + + private final Optional> lead; + + private final Optional> note; + + private final Optional> opportunity; + + private final Optional> stage; + + private final Optional> user; + + private final Optional> task; + + private final Optional> engagement; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> account, + Optional> contact, + Optional> lead, + Optional> note, + Optional> opportunity, + Optional> stage, + Optional> user, + Optional> task, + Optional> engagement, + Map additionalProperties) { + this.account = account; + this.contact = contact; + this.lead = lead; + this.note = note; + this.opportunity = opportunity; + this.stage = stage; + this.user = user; + this.task = task; + this.engagement = engagement; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @JsonProperty("Lead") + public Optional> getLead() { + return lead; + } + + @JsonProperty("Note") + public Optional> getNote() { + return note; + } + + @JsonProperty("Opportunity") + public Optional> getOpportunity() { + return opportunity; + } + + @JsonProperty("Stage") + public Optional> getStage() { + return stage; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Task") + public Optional> getTask() { + return task; + } + + @JsonProperty("Engagement") + public Optional> getEngagement() { + return engagement; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return account.equals(other.account) + && contact.equals(other.contact) + && lead.equals(other.lead) + && note.equals(other.note) + && opportunity.equals(other.opportunity) + && stage.equals(other.stage) + && user.equals(other.user) + && task.equals(other.task) + && engagement.equals(other.engagement); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.account, + this.contact, + this.lead, + this.note, + this.opportunity, + this.stage, + this.user, + this.task, + this.engagement); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> account = Optional.empty(); + + private Optional> contact = Optional.empty(); + + private Optional> lead = Optional.empty(); + + private Optional> note = Optional.empty(); + + private Optional> opportunity = Optional.empty(); + + private Optional> stage = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> task = Optional.empty(); + + private Optional> engagement = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + account(other.getAccount()); + contact(other.getContact()); + lead(other.getLead()); + note(other.getNote()); + opportunity(other.getOpportunity()); + stage(other.getStage()); + user(other.getUser()); + task(other.getTask()); + engagement(other.getEngagement()); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "Lead", nulls = Nulls.SKIP) + public Builder lead(Optional> lead) { + this.lead = lead; + return this; + } + + public Builder lead(List lead) { + this.lead = Optional.ofNullable(lead); + return this; + } + + @JsonSetter(value = "Note", nulls = Nulls.SKIP) + public Builder note(Optional> note) { + this.note = note; + return this; + } + + public Builder note(List note) { + this.note = Optional.ofNullable(note); + return this; + } + + @JsonSetter(value = "Opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional> opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(List opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + return this; + } + + @JsonSetter(value = "Stage", nulls = Nulls.SKIP) + public Builder stage(Optional> stage) { + this.stage = stage; + return this; + } + + public Builder stage(List stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Task", nulls = Nulls.SKIP) + public Builder task(Optional> task) { + this.task = task; + return this; + } + + public Builder task(List task) { + this.task = Optional.ofNullable(task); + return this; + } + + @JsonSetter(value = "Engagement", nulls = Nulls.SKIP) + public Builder engagement(Optional> engagement) { + this.engagement = engagement; + return this; + } + + public Builder engagement(List engagement) { + this.engagement = Optional.ofNullable(engagement); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse( + account, contact, lead, note, opportunity, stage, user, task, engagement, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..77e81bbe6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/crm/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..09d761c70 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingInstanceResponse.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..1080db84b --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/crm/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..4776a6f70 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/crm/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..b2923aed3 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/FieldTypeEnum.java b/src/main/java/com/merge/api/crm/types/FieldTypeEnum.java new file mode 100644 index 000000000..c5abacf36 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FieldTypeEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + FieldTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/crm/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..3f4cc5646 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/IgnoreCommonModelRequest.java b/src/main/java/com/merge/api/crm/types/IgnoreCommonModelRequest.java new file mode 100644 index 000000000..2751e829c --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/IgnoreCommonModelRequest.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IgnoreCommonModelRequest.Builder.class) +public final class IgnoreCommonModelRequest { + private final ReasonEnum reason; + + private final Optional message; + + private final Map additionalProperties; + + private IgnoreCommonModelRequest( + ReasonEnum reason, Optional message, Map additionalProperties) { + this.reason = reason; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("reason") + public ReasonEnum getReason() { + return reason; + } + + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IgnoreCommonModelRequest && equalTo((IgnoreCommonModelRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IgnoreCommonModelRequest other) { + return reason.equals(other.reason) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.reason, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ReasonStage builder() { + return new Builder(); + } + + public interface ReasonStage { + _FinalStage reason(@NotNull ReasonEnum reason); + + Builder from(IgnoreCommonModelRequest other); + } + + public interface _FinalStage { + IgnoreCommonModelRequest build(); + + _FinalStage message(Optional message); + + _FinalStage message(String message); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ReasonStage, _FinalStage { + private ReasonEnum reason; + + private Optional message = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IgnoreCommonModelRequest other) { + reason(other.getReason()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("reason") + public _FinalStage reason(@NotNull ReasonEnum reason) { + this.reason = reason; + return this; + } + + @java.lang.Override + public _FinalStage message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + @java.lang.Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @java.lang.Override + public IgnoreCommonModelRequest build() { + return new IgnoreCommonModelRequest(reason, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/crm/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..b10e7365a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/crm/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..70d3ff153 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/Issue.java b/src/main/java/com/merge/api/crm/types/Issue.java new file mode 100644 index 000000000..b7df77a8c --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/Issue.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage status(Optional status); + + _FinalStage status(IssueStatusEnum status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

+ *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/IssueStatusEnum.java b/src/main/java/com/merge/api/crm/types/IssueStatusEnum.java new file mode 100644 index 000000000..a544993a7 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssueStatusEnum { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssueStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/IssuesListRequest.java b/src/main/java/com/merge/api/crm/types/IssuesListRequest.java new file mode 100644 index 000000000..834d87f08 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/IssuesListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/crm/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..08215964c --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssuesListRequestStatus { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssuesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/ItemFormatEnum.java b/src/main/java/com/merge/api/crm/types/ItemFormatEnum.java new file mode 100644 index 000000000..6a22c08c0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ItemFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemFormatEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + ItemFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/ItemSchema.java b/src/main/java/com/merge/api/crm/types/ItemSchema.java new file mode 100644 index 000000000..d70420cf9 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ItemSchema.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemSchema.Builder.class) +public final class ItemSchema { + private final Optional itemType; + + private final Optional itemFormat; + + private final Optional> itemChoices; + + private final Map additionalProperties; + + private ItemSchema( + Optional itemType, + Optional itemFormat, + Optional> itemChoices, + Map additionalProperties) { + this.itemType = itemType; + this.itemFormat = itemFormat; + this.itemChoices = itemChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("item_type") + public Optional getItemType() { + return itemType; + } + + @JsonProperty("item_format") + public Optional getItemFormat() { + return itemFormat; + } + + @JsonProperty("item_choices") + public Optional> getItemChoices() { + return itemChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemSchema && equalTo((ItemSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemSchema other) { + return itemType.equals(other.itemType) + && itemFormat.equals(other.itemFormat) + && itemChoices.equals(other.itemChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional itemType = Optional.empty(); + + private Optional itemFormat = Optional.empty(); + + private Optional> itemChoices = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemSchema other) { + itemType(other.getItemType()); + itemFormat(other.getItemFormat()); + itemChoices(other.getItemChoices()); + return this; + } + + @JsonSetter(value = "item_type", nulls = Nulls.SKIP) + public Builder itemType(Optional itemType) { + this.itemType = itemType; + return this; + } + + public Builder itemType(ItemTypeEnum itemType) { + this.itemType = Optional.ofNullable(itemType); + return this; + } + + @JsonSetter(value = "item_format", nulls = Nulls.SKIP) + public Builder itemFormat(Optional itemFormat) { + this.itemFormat = itemFormat; + return this; + } + + public Builder itemFormat(ItemFormatEnum itemFormat) { + this.itemFormat = Optional.ofNullable(itemFormat); + return this; + } + + @JsonSetter(value = "item_choices", nulls = Nulls.SKIP) + public Builder itemChoices(Optional> itemChoices) { + this.itemChoices = itemChoices; + return this; + } + + public Builder itemChoices(List itemChoices) { + this.itemChoices = Optional.ofNullable(itemChoices); + return this; + } + + public ItemSchema build() { + return new ItemSchema(itemType, itemFormat, itemChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ItemTypeEnum.java b/src/main/java/com/merge/api/crm/types/ItemTypeEnum.java new file mode 100644 index 000000000..783d13aea --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ItemTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemTypeEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + ItemTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/LanguageEnum.java b/src/main/java/com/merge/api/crm/types/LanguageEnum.java new file mode 100644 index 000000000..4e7843e85 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LanguageEnum { + EN("en"), + + DE("de"); + + private final String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/LastSyncResultEnum.java b/src/main/java/com/merge/api/crm/types/LastSyncResultEnum.java new file mode 100644 index 000000000..1982d9736 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LastSyncResultEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LastSyncResultEnum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + LastSyncResultEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/Lead.java b/src/main/java/com/merge/api/crm/types/Lead.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/Lead.java rename to src/main/java/com/merge/api/crm/types/Lead.java index acf832812..af6721685 100644 --- a/src/main/java/com/merge/api/resources/crm/types/Lead.java +++ b/src/main/java/com/merge/api/crm/types/Lead.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/LeadConvertedAccount.java b/src/main/java/com/merge/api/crm/types/LeadConvertedAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/LeadConvertedAccount.java rename to src/main/java/com/merge/api/crm/types/LeadConvertedAccount.java index 07ace13e5..f0a277795 100644 --- a/src/main/java/com/merge/api/resources/crm/types/LeadConvertedAccount.java +++ b/src/main/java/com/merge/api/crm/types/LeadConvertedAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public LeadConvertedAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public LeadConvertedAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/LeadConvertedContact.java b/src/main/java/com/merge/api/crm/types/LeadConvertedContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/LeadConvertedContact.java rename to src/main/java/com/merge/api/crm/types/LeadConvertedContact.java index 0d0db06e0..a4f2a8ed1 100644 --- a/src/main/java/com/merge/api/resources/crm/types/LeadConvertedContact.java +++ b/src/main/java/com/merge/api/crm/types/LeadConvertedContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public LeadConvertedContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public LeadConvertedContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadEndpointRequest.java b/src/main/java/com/merge/api/crm/types/LeadEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/leads/requests/LeadEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/LeadEndpointRequest.java index 3583075c8..a60d3e80c 100644 --- a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.leads.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.LeadRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/LeadOwner.java b/src/main/java/com/merge/api/crm/types/LeadOwner.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/LeadOwner.java rename to src/main/java/com/merge/api/crm/types/LeadOwner.java index f8d9e0ccb..1b5c574bd 100644 --- a/src/main/java/com/merge/api/resources/crm/types/LeadOwner.java +++ b/src/main/java/com/merge/api/crm/types/LeadOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public LeadOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public LeadOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/LeadRequest.java b/src/main/java/com/merge/api/crm/types/LeadRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/LeadRequest.java rename to src/main/java/com/merge/api/crm/types/LeadRequest.java index 7ee5460b6..c208259fa 100644 --- a/src/main/java/com/merge/api/resources/crm/types/LeadRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/LeadRequestConvertedAccount.java b/src/main/java/com/merge/api/crm/types/LeadRequestConvertedAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/LeadRequestConvertedAccount.java rename to src/main/java/com/merge/api/crm/types/LeadRequestConvertedAccount.java index 86f2e4006..2d53b5b17 100644 --- a/src/main/java/com/merge/api/resources/crm/types/LeadRequestConvertedAccount.java +++ b/src/main/java/com/merge/api/crm/types/LeadRequestConvertedAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public LeadRequestOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public LeadRequestOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/LeadResponse.java b/src/main/java/com/merge/api/crm/types/LeadResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/LeadResponse.java rename to src/main/java/com/merge/api/crm/types/LeadResponse.java index 681f5a9c4..89949e980 100644 --- a/src/main/java/com/merge/api/resources/crm/types/LeadResponse.java +++ b/src/main/java/com/merge/api/crm/types/LeadResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadsListRequest.java b/src/main/java/com/merge/api/crm/types/LeadsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/leads/requests/LeadsListRequest.java rename to src/main/java/com/merge/api/crm/types/LeadsListRequest.java index 3a72e5898..acba5f729 100644 --- a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.leads.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.leads.types.LeadsListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = LeadsListRequest.Builder.class) public final class LeadsListRequest { + private final Optional> expand; + private final Optional convertedAccountId; private final Optional convertedContactId; @@ -34,8 +37,6 @@ public final class LeadsListRequest { private final Optional emailAddresses; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,13 +60,13 @@ public final class LeadsListRequest { private final Map additionalProperties; private LeadsListRequest( + Optional> expand, Optional convertedAccountId, Optional convertedContactId, Optional createdAfter, Optional createdBefore, Optional cursor, Optional emailAddresses, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -77,13 +78,13 @@ private LeadsListRequest( Optional phoneNumbers, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.convertedAccountId = convertedAccountId; this.convertedContactId = convertedContactId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.emailAddresses = emailAddresses; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -97,6 +98,14 @@ private LeadsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return leads with this account. */ @@ -145,14 +154,6 @@ public Optional getEmailAddresses() { return emailAddresses; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -245,13 +246,13 @@ public Map getAdditionalProperties() { } private boolean equalTo(LeadsListRequest other) { - return convertedAccountId.equals(other.convertedAccountId) + return expand.equals(other.expand) + && convertedAccountId.equals(other.convertedAccountId) && convertedContactId.equals(other.convertedContactId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && emailAddresses.equals(other.emailAddresses) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -267,13 +268,13 @@ private boolean equalTo(LeadsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.convertedAccountId, this.convertedContactId, this.createdAfter, this.createdBefore, this.cursor, this.emailAddresses, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -297,6 +298,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional convertedAccountId = Optional.empty(); private Optional convertedContactId = Optional.empty(); @@ -309,8 +312,6 @@ public static final class Builder { private Optional emailAddresses = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -337,13 +338,13 @@ public static final class Builder { private Builder() {} public Builder from(LeadsListRequest other) { + expand(other.getExpand()); convertedAccountId(other.getConvertedAccountId()); convertedContactId(other.getConvertedContactId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); emailAddresses(other.getEmailAddresses()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -357,6 +358,22 @@ public Builder from(LeadsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(LeadsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "converted_account_id", nulls = Nulls.SKIP) public Builder convertedAccountId(Optional convertedAccountId) { this.convertedAccountId = convertedAccountId; @@ -423,17 +440,6 @@ public Builder emailAddresses(String emailAddresses) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(LeadsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -546,13 +552,13 @@ public Builder remoteId(String remoteId) { public LeadsListRequest build() { return new LeadsListRequest( + expand, convertedAccountId, convertedContactId, createdAfter, createdBefore, cursor, emailAddresses, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/crm/types/LeadsListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/LeadsListRequestExpandItem.java new file mode 100644 index 000000000..b9e710ea6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LeadsListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LeadsListRequestExpandItem { + CONVERTED_ACCOUNT("converted_account"), + + CONVERTED_CONTACT("converted_contact"), + + OWNER("owner"); + + private final String value; + + LeadsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/leads/requests/LeadsRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java index 81a95f0c1..e5b3d9c12 100644 --- a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.leads.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/LeadsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/LeadsRetrieveRequest.java new file mode 100644 index 000000000..bd7af5845 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LeadsRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LeadsRetrieveRequest.Builder.class) +public final class LeadsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private LeadsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadsRetrieveRequest && equalTo((LeadsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LeadsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LeadsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(LeadsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public LeadsRetrieveRequest build() { + return new LeadsRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/LeadsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/LeadsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..c01158ba4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LeadsRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LeadsRetrieveRequestExpandItem { + CONVERTED_ACCOUNT("converted_account"), + + CONVERTED_CONTACT("converted_contact"), + + OWNER("owner"); + + private final String value; + + LeadsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/LinkToken.java b/src/main/java/com/merge/api/crm/types/LinkToken.java new file mode 100644 index 000000000..05b7ac486 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LinkToken.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkToken.Builder.class) +public final class LinkToken { + private final String linkToken; + + private final Optional integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/crm/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..d0171da15 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/crm/types/LinkedAccountStatus.java new file mode 100644 index 000000000..7a838caaa --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LinkedAccountStatus.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) +public final class LinkedAccountStatus { + private final String linkedAccountStatus; + + private final boolean canMakeRequest; + + private final Map additionalProperties; + + private LinkedAccountStatus( + String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { + this.linkedAccountStatus = linkedAccountStatus; + this.canMakeRequest = canMakeRequest; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_status") + public String getLinkedAccountStatus() { + return linkedAccountStatus; + } + + @JsonProperty("can_make_request") + public boolean getCanMakeRequest() { + return canMakeRequest; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountStatus other) { + return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountStatusStage builder() { + return new Builder(); + } + + public interface LinkedAccountStatusStage { + CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); + + Builder from(LinkedAccountStatus other); + } + + public interface CanMakeRequestStage { + _FinalStage canMakeRequest(boolean canMakeRequest); + } + + public interface _FinalStage { + LinkedAccountStatus build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { + private String linkedAccountStatus; + + private boolean canMakeRequest; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @java.lang.Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @java.lang.Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..51d0032ca --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java @@ -0,0 +1,457 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing + *
    + *
  • hris - hris
  • + *
  • ats - ats
  • + *
  • accounting - accounting
  • + *
  • ticketing - ticketing
  • + *
  • crm - crm
  • + *
  • mktg - mktg
  • + *
  • filestorage - filestorage
  • + *
+ */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..c226a5504 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LinkedAccountsListRequestCategory { + ACCOUNTING("accounting"), + + ATS("ats"), + + CRM("crm"), + + FILESTORAGE("filestorage"), + + HRIS("hris"), + + MKTG("mktg"), + + TICKETING("ticketing"); + + private final String value; + + LinkedAccountsListRequestCategory(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/MetaResponse.java b/src/main/java/com/merge/api/crm/types/MetaResponse.java new file mode 100644 index 000000000..8468d3017 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/MetaResponse.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MetaResponse.Builder.class) +public final class MetaResponse { + private final Map requestSchema; + + private final Optional> remoteFieldClasses; + + private final Optional status; + + private final boolean hasConditionalParams; + + private final boolean hasRequiredLinkedAccountParams; + + private final Map additionalProperties; + + private MetaResponse( + Map requestSchema, + Optional> remoteFieldClasses, + Optional status, + boolean hasConditionalParams, + boolean hasRequiredLinkedAccountParams, + Map additionalProperties) { + this.requestSchema = requestSchema; + this.remoteFieldClasses = remoteFieldClasses; + this.status = status; + this.hasConditionalParams = hasConditionalParams; + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("request_schema") + public Map getRequestSchema() { + return requestSchema; + } + + @JsonProperty("remote_field_classes") + public Optional> getRemoteFieldClasses() { + return remoteFieldClasses; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("has_conditional_params") + public boolean getHasConditionalParams() { + return hasConditionalParams; + } + + @JsonProperty("has_required_linked_account_params") + public boolean getHasRequiredLinkedAccountParams() { + return hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MetaResponse && equalTo((MetaResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MetaResponse other) { + return requestSchema.equals(other.requestSchema) + && remoteFieldClasses.equals(other.remoteFieldClasses) + && status.equals(other.status) + && hasConditionalParams == other.hasConditionalParams + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasConditionalParamsStage builder() { + return new Builder(); + } + + public interface HasConditionalParamsStage { + HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); + + Builder from(MetaResponse other); + } + + public interface HasRequiredLinkedAccountParamsStage { + _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); + } + + public interface _FinalStage { + MetaResponse build(); + + _FinalStage requestSchema(Map requestSchema); + + _FinalStage putAllRequestSchema(Map requestSchema); + + _FinalStage requestSchema(String key, JsonNode value); + + _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); + + _FinalStage remoteFieldClasses(Map remoteFieldClasses); + + _FinalStage status(Optional status); + + _FinalStage status(LinkedAccountStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { + private boolean hasConditionalParams; + + private boolean hasRequiredLinkedAccountParams; + + private Optional status = Optional.empty(); + + private Optional> remoteFieldClasses = Optional.empty(); + + private Map requestSchema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @java.lang.Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @java.lang.Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @java.lang.Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @java.lang.Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/MethodEnum.java b/src/main/java/com/merge/api/crm/types/MethodEnum.java new file mode 100644 index 000000000..aa385c1db --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MethodEnum { + GET("GET"), + + OPTIONS("OPTIONS"), + + HEAD("HEAD"), + + POST("POST"), + + PUT("PUT"), + + PATCH("PATCH"), + + DELETE("DELETE"); + + private final String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/ModelOperation.java b/src/main/java/com/merge/api/crm/types/ModelOperation.java new file mode 100644 index 000000000..e609b95b6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ModelOperation.java @@ -0,0 +1,226 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/crm/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..fd82ab87d --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/crm/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..4e4dd6756 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/crm/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..dc384d04f --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/MultipartFormFieldRequest.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(EncodingEnum encoding); + + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

The name of the form field

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

The data for the form field.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

The MIME type of the file, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

The file name of the form field, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

The encoding of the value of data. Defaults to RAW if not defined.

+ *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(EncodingEnum encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/Note.java b/src/main/java/com/merge/api/crm/types/Note.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/Note.java rename to src/main/java/com/merge/api/crm/types/Note.java index a9d6d2761..a84e156e6 100644 --- a/src/main/java/com/merge/api/resources/crm/types/Note.java +++ b/src/main/java/com/merge/api/crm/types/Note.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteAccount.java b/src/main/java/com/merge/api/crm/types/NoteAccount.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/NoteAccount.java rename to src/main/java/com/merge/api/crm/types/NoteAccount.java index f8055632c..43d08f114 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteAccount.java +++ b/src/main/java/com/merge/api/crm/types/NoteAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public NoteAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteContact.java b/src/main/java/com/merge/api/crm/types/NoteContact.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/NoteContact.java rename to src/main/java/com/merge/api/crm/types/NoteContact.java index 50c803acc..f8a1d1fb9 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteContact.java +++ b/src/main/java/com/merge/api/crm/types/NoteContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public NoteContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/notes/requests/NoteEndpointRequest.java b/src/main/java/com/merge/api/crm/types/NoteEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/notes/requests/NoteEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/NoteEndpointRequest.java index bdd8984bf..2213e2a47 100644 --- a/src/main/java/com/merge/api/resources/crm/notes/requests/NoteEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/NoteEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.notes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.NoteRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteOpportunity.java b/src/main/java/com/merge/api/crm/types/NoteOpportunity.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/NoteOpportunity.java rename to src/main/java/com/merge/api/crm/types/NoteOpportunity.java index 33dc9c991..10a702bc5 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteOpportunity.java +++ b/src/main/java/com/merge/api/crm/types/NoteOpportunity.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public NoteOpportunity deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteOpportunity deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteOwner.java b/src/main/java/com/merge/api/crm/types/NoteOwner.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/NoteOwner.java rename to src/main/java/com/merge/api/crm/types/NoteOwner.java index 01a8cb680..e975e6842 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteOwner.java +++ b/src/main/java/com/merge/api/crm/types/NoteOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public NoteOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteRequest.java b/src/main/java/com/merge/api/crm/types/NoteRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/NoteRequest.java rename to src/main/java/com/merge/api/crm/types/NoteRequest.java index 177bdeae4..532dffb49 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteRequest.java +++ b/src/main/java/com/merge/api/crm/types/NoteRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteRequestAccount.java b/src/main/java/com/merge/api/crm/types/NoteRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/NoteRequestAccount.java rename to src/main/java/com/merge/api/crm/types/NoteRequestAccount.java index e8c47f152..a4d7c88b0 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteRequestAccount.java +++ b/src/main/java/com/merge/api/crm/types/NoteRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public NoteRequestAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteRequestContact.java b/src/main/java/com/merge/api/crm/types/NoteRequestContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/NoteRequestContact.java rename to src/main/java/com/merge/api/crm/types/NoteRequestContact.java index 9d845f9e1..e94cce250 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteRequestContact.java +++ b/src/main/java/com/merge/api/crm/types/NoteRequestContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public NoteRequestContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteRequestOpportunity.java b/src/main/java/com/merge/api/crm/types/NoteRequestOpportunity.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/NoteRequestOpportunity.java rename to src/main/java/com/merge/api/crm/types/NoteRequestOpportunity.java index 2dec23d28..bfa35bc65 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteRequestOpportunity.java +++ b/src/main/java/com/merge/api/crm/types/NoteRequestOpportunity.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public NoteRequestOpportunity deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteRequestOpportunity deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteRequestOwner.java b/src/main/java/com/merge/api/crm/types/NoteRequestOwner.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/NoteRequestOwner.java rename to src/main/java/com/merge/api/crm/types/NoteRequestOwner.java index 9f8580f1d..940b89286 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteRequestOwner.java +++ b/src/main/java/com/merge/api/crm/types/NoteRequestOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public NoteRequestOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public NoteRequestOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/NoteResponse.java b/src/main/java/com/merge/api/crm/types/NoteResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/NoteResponse.java rename to src/main/java/com/merge/api/crm/types/NoteResponse.java index 76bb73763..ee45153da 100644 --- a/src/main/java/com/merge/api/resources/crm/types/NoteResponse.java +++ b/src/main/java/com/merge/api/crm/types/NoteResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/notes/requests/NotesListRequest.java b/src/main/java/com/merge/api/crm/types/NotesListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/notes/requests/NotesListRequest.java rename to src/main/java/com/merge/api/crm/types/NotesListRequest.java index d8f262df1..4c2a824c4 100644 --- a/src/main/java/com/merge/api/resources/crm/notes/requests/NotesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/NotesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.notes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.notes.types.NotesListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = NotesListRequest.Builder.class) public final class NotesListRequest { + private final Optional> expand; + private final Optional accountId; private final Optional contactId; @@ -32,8 +35,6 @@ public final class NotesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -57,12 +58,12 @@ public final class NotesListRequest { private final Map additionalProperties; private NotesListRequest( + Optional> expand, Optional accountId, Optional contactId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -74,12 +75,12 @@ private NotesListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.accountId = accountId; this.contactId = contactId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -93,6 +94,14 @@ private NotesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return notes with this account. */ @@ -133,14 +142,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -233,12 +234,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(NotesListRequest other) { - return accountId.equals(other.accountId) + return expand.equals(other.expand) + && accountId.equals(other.accountId) && contactId.equals(other.contactId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -254,12 +255,12 @@ private boolean equalTo(NotesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.accountId, this.contactId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -283,6 +284,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional accountId = Optional.empty(); private Optional contactId = Optional.empty(); @@ -293,8 +296,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -321,12 +322,12 @@ public static final class Builder { private Builder() {} public Builder from(NotesListRequest other) { + expand(other.getExpand()); accountId(other.getAccountId()); contactId(other.getContactId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -340,6 +341,22 @@ public Builder from(NotesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(NotesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) public Builder accountId(Optional accountId) { this.accountId = accountId; @@ -395,17 +412,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(NotesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -518,12 +524,12 @@ public Builder remoteId(String remoteId) { public NotesListRequest build() { return new NotesListRequest( + expand, accountId, contactId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/crm/types/NotesListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/NotesListRequestExpandItem.java new file mode 100644 index 000000000..2f4f3d280 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/NotesListRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum NotesListRequestExpandItem { + ACCOUNT("account"), + + CONTACT("contact"), + + OPPORTUNITY("opportunity"), + + OWNER("owner"); + + private final String value; + + NotesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/notes/requests/NotesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/notes/requests/NotesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java index b4dd7d66b..99638e036 100644 --- a/src/main/java/com/merge/api/resources/crm/notes/requests/NotesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.notes.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/NotesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/NotesRetrieveRequest.java new file mode 100644 index 000000000..66714647b --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/NotesRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = NotesRetrieveRequest.Builder.class) +public final class NotesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private NotesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof NotesRetrieveRequest && equalTo((NotesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(NotesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(NotesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(NotesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public NotesRetrieveRequest build() { + return new NotesRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/NotesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/NotesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..3024edfb2 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/NotesRetrieveRequestExpandItem.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum NotesRetrieveRequestExpandItem { + ACCOUNT("account"), + + CONTACT("contact"), + + OPPORTUNITY("opportunity"), + + OWNER("owner"); + + private final String value; + + NotesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/ObjectClassDescriptionRequest.java b/src/main/java/com/merge/api/crm/types/ObjectClassDescriptionRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/types/ObjectClassDescriptionRequest.java rename to src/main/java/com/merge/api/crm/types/ObjectClassDescriptionRequest.java index 93a098b79..aa1a98968 100644 --- a/src/main/java/com/merge/api/resources/crm/types/ObjectClassDescriptionRequest.java +++ b/src/main/java/com/merge/api/crm/types/ObjectClassDescriptionRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesListRequest.java b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesListRequest.java rename to src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java index c60a045c3..1819c092c 100644 --- a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.opportunities.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,10 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.opportunities.types.OpportunitiesListRequestExpand; -import com.merge.api.resources.crm.opportunities.types.OpportunitiesListRequestStatus; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = OpportunitiesListRequest.Builder.class) public final class OpportunitiesListRequest { + private final Optional> expand; + private final Optional accountId; private final Optional createdAfter; @@ -31,8 +33,6 @@ public final class OpportunitiesListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -64,11 +64,11 @@ public final class OpportunitiesListRequest { private final Map additionalProperties; private OpportunitiesListRequest( + Optional> expand, Optional accountId, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -84,11 +84,11 @@ private OpportunitiesListRequest( Optional stageId, Optional status, Map additionalProperties) { + this.expand = expand; this.accountId = accountId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -106,6 +106,14 @@ private OpportunitiesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return opportunities with this account. */ @@ -138,14 +146,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -275,11 +275,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(OpportunitiesListRequest other) { - return accountId.equals(other.accountId) + return expand.equals(other.expand) + && accountId.equals(other.accountId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -299,11 +299,11 @@ private boolean equalTo(OpportunitiesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.accountId, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -331,6 +331,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional accountId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -339,8 +341,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -375,11 +375,11 @@ public static final class Builder { private Builder() {} public Builder from(OpportunitiesListRequest other) { + expand(other.getExpand()); accountId(other.getAccountId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -397,6 +397,22 @@ public Builder from(OpportunitiesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(OpportunitiesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) public Builder accountId(Optional accountId) { this.accountId = accountId; @@ -441,17 +457,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(OpportunitiesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -608,11 +613,11 @@ public Builder status(OpportunitiesListRequestStatus status) { public OpportunitiesListRequest build() { return new OpportunitiesListRequest( + expand, accountId, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestExpandItem.java new file mode 100644 index 000000000..aadd0cf12 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OpportunitiesListRequestExpandItem { + ACCOUNT("account"), + + OWNER("owner"), + + STAGE("stage"); + + private final String value; + + OpportunitiesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesListRequestStatus.java b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestStatus.java similarity index 88% rename from src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesListRequestStatus.java rename to src/main/java/com/merge/api/crm/types/OpportunitiesListRequestStatus.java index f6157baec..28b575f70 100644 --- a/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesListRequestStatus.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestStatus.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.opportunities.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java index 28f593280..f556a92b7 100644 --- a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.opportunities.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequest.java similarity index 77% rename from src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesRetrieveRequest.java rename to src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequest.java index e1558e686..b38695884 100644 --- a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunitiesRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.opportunities.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.opportunities.types.OpportunitiesRetrieveRequestExpand; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,12 +22,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = OpportunitiesRetrieveRequest.Builder.class) public final class OpportunitiesRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeRemoteFields; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -34,15 +37,17 @@ public final class OpportunitiesRetrieveRequest { private final Map additionalProperties; private OpportunitiesRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, Optional includeRemoteFields, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -52,7 +57,7 @@ private OpportunitiesRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -72,6 +77,14 @@ public Optional getIncludeRemoteFields() { return includeRemoteFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -103,6 +116,7 @@ private boolean equalTo(OpportunitiesRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @@ -110,7 +124,12 @@ private boolean equalTo(OpportunitiesRetrieveRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + this.expand, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); } @java.lang.Override @@ -124,12 +143,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); private Optional includeRemoteFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -143,22 +164,28 @@ public Builder from(OpportunitiesRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(OpportunitiesRetrieveRequestExpand expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(OpportunitiesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -181,6 +208,17 @@ public Builder includeRemoteFields(Boolean includeRemoteFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -208,6 +246,7 @@ public OpportunitiesRetrieveRequest build() { expand, includeRemoteData, includeRemoteFields, + includeShellData, remoteFields, showEnumOrigins, additionalProperties); diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..08723f760 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum OpportunitiesRetrieveRequestExpandItem { + ACCOUNT("account"), + + OWNER("owner"), + + STAGE("stage"); + + private final String value; + + OpportunitiesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/Opportunity.java b/src/main/java/com/merge/api/crm/types/Opportunity.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/types/Opportunity.java rename to src/main/java/com/merge/api/crm/types/Opportunity.java index 71a6e2809..c57f483d1 100644 --- a/src/main/java/com/merge/api/resources/crm/types/Opportunity.java +++ b/src/main/java/com/merge/api/crm/types/Opportunity.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -43,7 +43,7 @@ public final class Opportunity { private final Optional stage; - private final Optional status; + private final Optional status; private final Optional lastActivityAt; @@ -72,7 +72,7 @@ private Opportunity( Optional owner, Optional account, Optional stage, - Optional status, + Optional status, Optional lastActivityAt, Optional closeDate, Optional remoteCreatedAt, @@ -188,7 +188,7 @@ public Optional getStage() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -325,7 +325,7 @@ public static final class Builder { private Optional stage = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional lastActivityAt = Optional.empty(); @@ -479,12 +479,12 @@ public Builder stage(OpportunityStage stage) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(OpportunityStatus status) { + public Builder status(OpportunityStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityAccount.java b/src/main/java/com/merge/api/crm/types/OpportunityAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityAccount.java rename to src/main/java/com/merge/api/crm/types/OpportunityAccount.java index c0712cc25..45155e279 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityAccount.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public OpportunityAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public OpportunityAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunityEndpointRequest.java b/src/main/java/com/merge/api/crm/types/OpportunityEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunityEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/OpportunityEndpointRequest.java index 6b1f2102c..fa0283d81 100644 --- a/src/main/java/com/merge/api/resources/crm/opportunities/requests/OpportunityEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.opportunities.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.OpportunityRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityOwner.java b/src/main/java/com/merge/api/crm/types/OpportunityOwner.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityOwner.java rename to src/main/java/com/merge/api/crm/types/OpportunityOwner.java index 21e499ad5..9433b7210 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityOwner.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public OpportunityOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public OpportunityOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequest.java b/src/main/java/com/merge/api/crm/types/OpportunityRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityRequest.java rename to src/main/java/com/merge/api/crm/types/OpportunityRequest.java index c2bced6f1..ff76a7e8b 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,7 +35,7 @@ public final class OpportunityRequest { private final Optional stage; - private final Optional status; + private final Optional status; private final Optional lastActivityAt; @@ -56,7 +56,7 @@ private OpportunityRequest( Optional owner, Optional account, Optional stage, - Optional status, + Optional status, Optional lastActivityAt, Optional closeDate, Optional> integrationParams, @@ -135,7 +135,7 @@ public Optional getStage() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -236,7 +236,7 @@ public static final class Builder { private Optional stage = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional lastActivityAt = Optional.empty(); @@ -336,12 +336,12 @@ public Builder stage(OpportunityRequestStage stage) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(OpportunityRequestStatus status) { + public Builder status(OpportunityStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequestAccount.java b/src/main/java/com/merge/api/crm/types/OpportunityRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityRequestAccount.java rename to src/main/java/com/merge/api/crm/types/OpportunityRequestAccount.java index 7b8fe838f..985f9beca 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequestAccount.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public OpportunityRequestOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public OpportunityRequestOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequestStage.java b/src/main/java/com/merge/api/crm/types/OpportunityRequestStage.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityRequestStage.java rename to src/main/java/com/merge/api/crm/types/OpportunityRequestStage.java index cdf6f0cf2..2ef395739 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequestStage.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityRequestStage.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public OpportunityRequestStage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public OpportunityRequestStage deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityResponse.java b/src/main/java/com/merge/api/crm/types/OpportunityResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityResponse.java rename to src/main/java/com/merge/api/crm/types/OpportunityResponse.java index 88c2493b4..cc31f724c 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityResponse.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityStage.java b/src/main/java/com/merge/api/crm/types/OpportunityStage.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityStage.java rename to src/main/java/com/merge/api/crm/types/OpportunityStage.java index 4228a322c..684a518e5 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityStage.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityStage.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public OpportunityStage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public OpportunityStage deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityStatusEnum.java b/src/main/java/com/merge/api/crm/types/OpportunityStatusEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/crm/types/OpportunityStatusEnum.java rename to src/main/java/com/merge/api/crm/types/OpportunityStatusEnum.java index cf612d914..65e5db8fa 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityStatusEnum.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/crm/types/OriginTypeEnum.java b/src/main/java/com/merge/api/crm/types/OriginTypeEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/crm/types/OriginTypeEnum.java rename to src/main/java/com/merge/api/crm/types/OriginTypeEnum.java index 435d6b280..dd1c0128f 100644 --- a/src/main/java/com/merge/api/resources/crm/types/OriginTypeEnum.java +++ b/src/main/java/com/merge/api/crm/types/OriginTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/crm/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..d45820818 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAccountList.java b/src/main/java/com/merge/api/crm/types/PaginatedAccountList.java new file mode 100644 index 000000000..df573b743 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedAccountList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountList.Builder.class) +public final class PaginatedAccountList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountList && equalTo((PaginatedAccountList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountList build() { + return new PaginatedAccountList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedAssociationList.java b/src/main/java/com/merge/api/crm/types/PaginatedAssociationList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedAssociationList.java rename to src/main/java/com/merge/api/crm/types/PaginatedAssociationList.java index bef9d5b6f..aea131957 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedAssociationList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedAssociationList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedAssociationTypeList.java b/src/main/java/com/merge/api/crm/types/PaginatedAssociationTypeList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedAssociationTypeList.java rename to src/main/java/com/merge/api/crm/types/PaginatedAssociationTypeList.java index d1b0a48ca..9554ec02a 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedAssociationTypeList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedAssociationTypeList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/crm/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..9c9fa22dd --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/PaginatedContactList.java b/src/main/java/com/merge/api/crm/types/PaginatedContactList.java new file mode 100644 index 000000000..e41185da4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedContactList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedContactList.Builder.class) +public final class PaginatedContactList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedContactList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedContactList && equalTo((PaginatedContactList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedContactList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedContactList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedContactList build() { + return new PaginatedContactList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedCustomObjectClassList.java b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectClassList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedCustomObjectClassList.java rename to src/main/java/com/merge/api/crm/types/PaginatedCustomObjectClassList.java index 034c3de3f..11afe1471 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedCustomObjectClassList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectClassList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedCustomObjectList.java b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedCustomObjectList.java rename to src/main/java/com/merge/api/crm/types/PaginatedCustomObjectList.java index 7a37a4ffd..c84858b26 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedCustomObjectList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedEngagementList.java b/src/main/java/com/merge/api/crm/types/PaginatedEngagementList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedEngagementList.java rename to src/main/java/com/merge/api/crm/types/PaginatedEngagementList.java index cee531b62..42c562d25 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedEngagementList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedEngagementList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedEngagementTypeList.java b/src/main/java/com/merge/api/crm/types/PaginatedEngagementTypeList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedEngagementTypeList.java rename to src/main/java/com/merge/api/crm/types/PaginatedEngagementTypeList.java index 15face72d..f63709fdf 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedEngagementTypeList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedEngagementTypeList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedIssueList.java b/src/main/java/com/merge/api/crm/types/PaginatedIssueList.java new file mode 100644 index 000000000..8e2e2d79b --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedLeadList.java b/src/main/java/com/merge/api/crm/types/PaginatedLeadList.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedLeadList.java rename to src/main/java/com/merge/api/crm/types/PaginatedLeadList.java index 69446d700..a720bfcaa 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedLeadList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedLeadList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedNoteList.java b/src/main/java/com/merge/api/crm/types/PaginatedNoteList.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedNoteList.java rename to src/main/java/com/merge/api/crm/types/PaginatedNoteList.java index dfcecc85c..c64f057eb 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedNoteList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedNoteList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedOpportunityList.java b/src/main/java/com/merge/api/crm/types/PaginatedOpportunityList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedOpportunityList.java rename to src/main/java/com/merge/api/crm/types/PaginatedOpportunityList.java index 8a077aacd..4f578b36a 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedOpportunityList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedOpportunityList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/crm/types/PaginatedRemoteFieldClassList.java new file mode 100644 index 000000000..d29407fac --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedRemoteFieldClassList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedRemoteFieldClassList.Builder.class) +public final class PaginatedRemoteFieldClassList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedRemoteFieldClassList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedRemoteFieldClassList && equalTo((PaginatedRemoteFieldClassList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedRemoteFieldClassList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedRemoteFieldClassList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedRemoteFieldClassList build() { + return new PaginatedRemoteFieldClassList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedStageList.java b/src/main/java/com/merge/api/crm/types/PaginatedStageList.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedStageList.java rename to src/main/java/com/merge/api/crm/types/PaginatedStageList.java index f788255a5..f18790e08 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedStageList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedStageList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/crm/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..426fe835e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedTaskList.java b/src/main/java/com/merge/api/crm/types/PaginatedTaskList.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/types/PaginatedTaskList.java rename to src/main/java/com/merge/api/crm/types/PaginatedTaskList.java index 8133b2283..fea8769e2 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedTaskList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedTaskList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedUserList.java b/src/main/java/com/merge/api/crm/types/PaginatedUserList.java new file mode 100644 index 000000000..e887e4a2e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PaginatedUserList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedUserList.Builder.class) +public final class PaginatedUserList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedUserList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedUserList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedUserList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedUserList build() { + return new PaginatedUserList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedAccountRequest.java b/src/main/java/com/merge/api/crm/types/PatchedAccountRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PatchedAccountRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedAccountRequest.java index a6e4b1ab5..84d479257 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedAccountRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedAccountRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedContactRequest.java b/src/main/java/com/merge/api/crm/types/PatchedContactRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/PatchedContactRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedContactRequest.java index f5187d156..af913c0d7 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedContactRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedContactRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedContactRequestOwner.java b/src/main/java/com/merge/api/crm/types/PatchedContactRequestOwner.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/PatchedContactRequestOwner.java rename to src/main/java/com/merge/api/crm/types/PatchedContactRequestOwner.java index 7cb7088f7..845a79f0e 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedContactRequestOwner.java +++ b/src/main/java/com/merge/api/crm/types/PatchedContactRequestOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Map additionalProperties) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + return this; + } + + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/engagements/requests/PatchedEngagementEndpointRequest.java b/src/main/java/com/merge/api/crm/types/PatchedEngagementEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/engagements/requests/PatchedEngagementEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedEngagementEndpointRequest.java index b5865695f..fac59973c 100644 --- a/src/main/java/com/merge/api/resources/crm/engagements/requests/PatchedEngagementEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedEngagementEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.engagements.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.PatchedEngagementRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedEngagementRequest.java b/src/main/java/com/merge/api/crm/types/PatchedEngagementRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/PatchedEngagementRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedEngagementRequest.java index e989fb0a7..a247451fb 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedEngagementRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedEngagementRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -29,7 +29,7 @@ public final class PatchedEngagementRequest { private final Optional subject; - private final Optional direction; + private final Optional direction; private final Optional engagementType; @@ -53,7 +53,7 @@ private PatchedEngagementRequest( Optional owner, Optional content, Optional subject, - Optional direction, + Optional direction, Optional engagementType, Optional startTime, Optional endTime, @@ -110,7 +110,7 @@ public Optional getSubject() { * */ @JsonProperty("direction") - public Optional getDirection() { + public Optional getDirection() { return direction; } @@ -226,7 +226,7 @@ public static final class Builder { private Optional subject = Optional.empty(); - private Optional direction = Optional.empty(); + private Optional direction = Optional.empty(); private Optional engagementType = Optional.empty(); @@ -299,12 +299,12 @@ public Builder subject(String subject) { } @JsonSetter(value = "direction", nulls = Nulls.SKIP) - public Builder direction(Optional direction) { + public Builder direction(Optional direction) { this.direction = direction; return this; } - public Builder direction(PatchedEngagementRequestDirection direction) { + public Builder direction(DirectionEnum direction) { this.direction = Optional.ofNullable(direction); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/requests/PatchedOpportunityEndpointRequest.java b/src/main/java/com/merge/api/crm/types/PatchedOpportunityEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/opportunities/requests/PatchedOpportunityEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedOpportunityEndpointRequest.java index c8b5cfeb2..841654c1e 100644 --- a/src/main/java/com/merge/api/resources/crm/opportunities/requests/PatchedOpportunityEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedOpportunityEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.opportunities.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.PatchedOpportunityRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedOpportunityRequest.java b/src/main/java/com/merge/api/crm/types/PatchedOpportunityRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/PatchedOpportunityRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedOpportunityRequest.java index 5a03c865e..8028fbbd2 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedOpportunityRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedOpportunityRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,7 +35,7 @@ public final class PatchedOpportunityRequest { private final Optional stage; - private final Optional status; + private final Optional status; private final Optional lastActivityAt; @@ -56,7 +56,7 @@ private PatchedOpportunityRequest( Optional owner, Optional account, Optional stage, - Optional status, + Optional status, Optional lastActivityAt, Optional closeDate, Optional> integrationParams, @@ -135,7 +135,7 @@ public Optional getStage() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -236,7 +236,7 @@ public static final class Builder { private Optional stage = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional lastActivityAt = Optional.empty(); @@ -336,12 +336,12 @@ public Builder stage(String stage) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(PatchedOpportunityRequestStatus status) { + public Builder status(OpportunityStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/tasks/requests/PatchedTaskEndpointRequest.java b/src/main/java/com/merge/api/crm/types/PatchedTaskEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/tasks/requests/PatchedTaskEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedTaskEndpointRequest.java index 79d8930f3..ae7d55331 100644 --- a/src/main/java/com/merge/api/resources/crm/tasks/requests/PatchedTaskEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedTaskEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.tasks.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.PatchedTaskRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedTaskRequest.java b/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/PatchedTaskRequest.java rename to src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java index c7f75e730..ac6ff7e34 100644 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedTaskRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,7 +37,7 @@ public final class PatchedTaskRequest { private final Optional dueDate; - private final Optional status; + private final Optional status; private final Optional> integrationParams; @@ -55,7 +55,7 @@ private PatchedTaskRequest( Optional opportunity, Optional completedDate, Optional dueDate, - Optional status, + Optional status, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -138,7 +138,7 @@ public Optional getDueDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -223,7 +223,7 @@ public static final class Builder { private Optional dueDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -329,12 +329,12 @@ public Builder dueDate(OffsetDateTime dueDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(PatchedTaskRequestStatus status) { + public Builder status(TaskStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/crm/types/PhoneNumber.java b/src/main/java/com/merge/api/crm/types/PhoneNumber.java new file mode 100644 index 000000000..e920f9512 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PhoneNumber.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneNumber.Builder.class) +public final class PhoneNumber { + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional phoneNumber; + + private final Optional phoneNumberType; + + private final Map additionalProperties; + + private PhoneNumber( + Optional createdAt, + Optional modifiedAt, + Optional phoneNumber, + Optional phoneNumberType, + Map additionalProperties) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.phoneNumber = phoneNumber; + this.phoneNumberType = phoneNumberType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The phone number. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return The phone number's type. + */ + @JsonProperty("phone_number_type") + public Optional getPhoneNumberType() { + return phoneNumberType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneNumber && equalTo((PhoneNumber) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneNumber other) { + return createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && phoneNumber.equals(other.phoneNumber) + && phoneNumberType.equals(other.phoneNumberType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.createdAt, this.modifiedAt, this.phoneNumber, this.phoneNumberType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional phoneNumberType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneNumber other) { + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + phoneNumber(other.getPhoneNumber()); + phoneNumberType(other.getPhoneNumberType()); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) + public Builder phoneNumberType(Optional phoneNumberType) { + this.phoneNumberType = phoneNumberType; + return this; + } + + public Builder phoneNumberType(String phoneNumberType) { + this.phoneNumberType = Optional.ofNullable(phoneNumberType); + return this; + } + + public PhoneNumber build() { + return new PhoneNumber(createdAt, modifiedAt, phoneNumber, phoneNumberType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/PhoneNumberRequest.java b/src/main/java/com/merge/api/crm/types/PhoneNumberRequest.java new file mode 100644 index 000000000..c6625ec3e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/PhoneNumberRequest.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PhoneNumberRequest.Builder.class) +public final class PhoneNumberRequest { + private final Optional phoneNumber; + + private final Optional phoneNumberType; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private PhoneNumberRequest( + Optional phoneNumber, + Optional phoneNumberType, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.phoneNumber = phoneNumber; + this.phoneNumberType = phoneNumberType; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The phone number. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return The phone number's type. + */ + @JsonProperty("phone_number_type") + public Optional getPhoneNumberType() { + return phoneNumberType; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PhoneNumberRequest && equalTo((PhoneNumberRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PhoneNumberRequest other) { + return phoneNumber.equals(other.phoneNumber) + && phoneNumberType.equals(other.phoneNumberType) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.phoneNumber, this.phoneNumberType, this.integrationParams, this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional phoneNumber = Optional.empty(); + + private Optional phoneNumberType = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PhoneNumberRequest other) { + phoneNumber(other.getPhoneNumber()); + phoneNumberType(other.getPhoneNumberType()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) + public Builder phoneNumberType(Optional phoneNumberType) { + this.phoneNumberType = phoneNumberType; + return this; + } + + public Builder phoneNumberType(String phoneNumberType) { + this.phoneNumberType = Optional.ofNullable(phoneNumberType); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public PhoneNumberRequest build() { + return new PhoneNumberRequest( + phoneNumber, phoneNumberType, integrationParams, linkedAccountParams, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ReasonEnum.java b/src/main/java/com/merge/api/crm/types/ReasonEnum.java new file mode 100644 index 000000000..c60da60c4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ReasonEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ReasonEnum { + GENERAL_CUSTOMER_REQUEST("GENERAL_CUSTOMER_REQUEST"), + + GDPR("GDPR"), + + OTHER("OTHER"); + + private final String value; + + ReasonEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteData.java b/src/main/java/com/merge/api/crm/types/RemoteData.java new file mode 100644 index 000000000..e940918d1 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteData.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

The third-party API path that is being called.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/crm/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..fab04babc --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteEndpointInfo.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteField.java b/src/main/java/com/merge/api/crm/types/RemoteField.java new file mode 100644 index 000000000..d94ea3408 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteField.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteField.Builder.class) +public final class RemoteField { + private final RemoteFieldRemoteFieldClass remoteFieldClass; + + private final Optional value; + + private final Map additionalProperties; + + private RemoteField( + RemoteFieldRemoteFieldClass remoteFieldClass, + Optional value, + Map additionalProperties) { + this.remoteFieldClass = remoteFieldClass; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_field_class") + public RemoteFieldRemoteFieldClass getRemoteFieldClass() { + return remoteFieldClass; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteField && equalTo((RemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteField other) { + return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteFieldClassStage builder() { + return new Builder(); + } + + public interface RemoteFieldClassStage { + _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass); + + Builder from(RemoteField other); + } + + public interface _FinalStage { + RemoteField build(); + + _FinalStage value(Optional value); + + _FinalStage value(JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteFieldClassStage, _FinalStage { + private RemoteFieldRemoteFieldClass remoteFieldClass; + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteField other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @java.lang.Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public RemoteField build() { + return new RemoteField(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldApi.java b/src/main/java/com/merge/api/crm/types/RemoteFieldApi.java new file mode 100644 index 000000000..525a79746 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldApi.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/crm/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..e7988c76a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/crm/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..af73f9a8a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldApiResponse.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> account; + + private final Optional> contact; + + private final Optional> lead; + + private final Optional> note; + + private final Optional> opportunity; + + private final Optional> stage; + + private final Optional> user; + + private final Optional> task; + + private final Optional> engagement; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> account, + Optional> contact, + Optional> lead, + Optional> note, + Optional> opportunity, + Optional> stage, + Optional> user, + Optional> task, + Optional> engagement, + Map additionalProperties) { + this.account = account; + this.contact = contact; + this.lead = lead; + this.note = note; + this.opportunity = opportunity; + this.stage = stage; + this.user = user; + this.task = task; + this.engagement = engagement; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @JsonProperty("Lead") + public Optional> getLead() { + return lead; + } + + @JsonProperty("Note") + public Optional> getNote() { + return note; + } + + @JsonProperty("Opportunity") + public Optional> getOpportunity() { + return opportunity; + } + + @JsonProperty("Stage") + public Optional> getStage() { + return stage; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Task") + public Optional> getTask() { + return task; + } + + @JsonProperty("Engagement") + public Optional> getEngagement() { + return engagement; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return account.equals(other.account) + && contact.equals(other.contact) + && lead.equals(other.lead) + && note.equals(other.note) + && opportunity.equals(other.opportunity) + && stage.equals(other.stage) + && user.equals(other.user) + && task.equals(other.task) + && engagement.equals(other.engagement); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.account, + this.contact, + this.lead, + this.note, + this.opportunity, + this.stage, + this.user, + this.task, + this.engagement); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> account = Optional.empty(); + + private Optional> contact = Optional.empty(); + + private Optional> lead = Optional.empty(); + + private Optional> note = Optional.empty(); + + private Optional> opportunity = Optional.empty(); + + private Optional> stage = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> task = Optional.empty(); + + private Optional> engagement = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + account(other.getAccount()); + contact(other.getContact()); + lead(other.getLead()); + note(other.getNote()); + opportunity(other.getOpportunity()); + stage(other.getStage()); + user(other.getUser()); + task(other.getTask()); + engagement(other.getEngagement()); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @JsonSetter(value = "Lead", nulls = Nulls.SKIP) + public Builder lead(Optional> lead) { + this.lead = lead; + return this; + } + + public Builder lead(List lead) { + this.lead = Optional.ofNullable(lead); + return this; + } + + @JsonSetter(value = "Note", nulls = Nulls.SKIP) + public Builder note(Optional> note) { + this.note = note; + return this; + } + + public Builder note(List note) { + this.note = Optional.ofNullable(note); + return this; + } + + @JsonSetter(value = "Opportunity", nulls = Nulls.SKIP) + public Builder opportunity(Optional> opportunity) { + this.opportunity = opportunity; + return this; + } + + public Builder opportunity(List opportunity) { + this.opportunity = Optional.ofNullable(opportunity); + return this; + } + + @JsonSetter(value = "Stage", nulls = Nulls.SKIP) + public Builder stage(Optional> stage) { + this.stage = stage; + return this; + } + + public Builder stage(List stage) { + this.stage = Optional.ofNullable(stage); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Task", nulls = Nulls.SKIP) + public Builder task(Optional> task) { + this.task = task; + return this; + } + + public Builder task(List task) { + this.task = Optional.ofNullable(task); + return this; + } + + @JsonSetter(value = "Engagement", nulls = Nulls.SKIP) + public Builder engagement(Optional> engagement) { + this.engagement = engagement; + return this; + } + + public Builder engagement(List engagement) { + this.engagement = Optional.ofNullable(engagement); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse( + account, contact, lead, note, opportunity, stage, user, task, engagement, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java new file mode 100644 index 000000000..5a6206b21 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldClass.Builder.class) +public final class RemoteFieldClass { + private final Optional id; + + private final Optional displayName; + + private final Optional remoteKeyName; + + private final Optional description; + + private final Optional isCustom; + + private final Optional isRequired; + + private final Optional fieldType; + + private final Optional fieldFormat; + + private final Optional> fieldChoices; + + private final Optional itemSchema; + + private final Map additionalProperties; + + private RemoteFieldClass( + Optional id, + Optional displayName, + Optional remoteKeyName, + Optional description, + Optional isCustom, + Optional isRequired, + Optional fieldType, + Optional fieldFormat, + Optional> fieldChoices, + Optional itemSchema, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.remoteKeyName = remoteKeyName; + this.description = description; + this.isCustom = isCustom; + this.isRequired = isRequired; + this.fieldType = fieldType; + this.fieldFormat = fieldFormat; + this.fieldChoices = fieldChoices; + this.itemSchema = itemSchema; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("field_type") + public Optional getFieldType() { + return fieldType; + } + + @JsonProperty("field_format") + public Optional getFieldFormat() { + return fieldFormat; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @JsonProperty("item_schema") + public Optional getItemSchema() { + return itemSchema; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClass && equalTo((RemoteFieldClass) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClass other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && remoteKeyName.equals(other.remoteKeyName) + && description.equals(other.description) + && isCustom.equals(other.isCustom) + && isRequired.equals(other.isRequired) + && fieldType.equals(other.fieldType) + && fieldFormat.equals(other.fieldFormat) + && fieldChoices.equals(other.fieldChoices) + && itemSchema.equals(other.itemSchema); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.displayName, + this.remoteKeyName, + this.description, + this.isCustom, + this.isRequired, + this.fieldType, + this.fieldFormat, + this.fieldChoices, + this.itemSchema); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional fieldType = Optional.empty(); + + private Optional fieldFormat = Optional.empty(); + + private Optional> fieldChoices = Optional.empty(); + + private Optional itemSchema = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldClass other) { + id(other.getId()); + displayName(other.getDisplayName()); + remoteKeyName(other.getRemoteKeyName()); + description(other.getDescription()); + isCustom(other.getIsCustom()); + isRequired(other.getIsRequired()); + fieldType(other.getFieldType()); + fieldFormat(other.getFieldFormat()); + fieldChoices(other.getFieldChoices()); + itemSchema(other.getItemSchema()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public Builder remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + public Builder remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public Builder isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + public Builder isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @JsonSetter(value = "field_type", nulls = Nulls.SKIP) + public Builder fieldType(Optional fieldType) { + this.fieldType = fieldType; + return this; + } + + public Builder fieldType(FieldTypeEnum fieldType) { + this.fieldType = Optional.ofNullable(fieldType); + return this; + } + + @JsonSetter(value = "field_format", nulls = Nulls.SKIP) + public Builder fieldFormat(Optional fieldFormat) { + this.fieldFormat = fieldFormat; + return this; + } + + public Builder fieldFormat(FieldFormatEnum fieldFormat) { + this.fieldFormat = Optional.ofNullable(fieldFormat); + return this; + } + + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public Builder fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + public Builder fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) + public Builder itemSchema(Optional itemSchema) { + this.itemSchema = itemSchema; + return this; + } + + public Builder itemSchema(ItemSchema itemSchema) { + this.itemSchema = Optional.ofNullable(itemSchema); + return this; + } + + public RemoteFieldClass build() { + return new RemoteFieldClass( + id, + displayName, + remoteKeyName, + description, + isCustom, + isRequired, + fieldType, + fieldFormat, + fieldChoices, + itemSchema, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassFieldChoicesItem.java new file mode 100644 index 000000000..79c2d557f --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassFieldChoicesItem.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldClassFieldChoicesItem.Builder.class) +public final class RemoteFieldClassFieldChoicesItem { + private final Optional value; + + private final Optional displayName; + + private final Map additionalProperties; + + private RemoteFieldClassFieldChoicesItem( + Optional value, Optional displayName, Map additionalProperties) { + this.value = value; + this.displayName = displayName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClassFieldChoicesItem && equalTo((RemoteFieldClassFieldChoicesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClassFieldChoicesItem other) { + return value.equals(other.value) && displayName.equals(other.displayName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.displayName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional value = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldClassFieldChoicesItem other) { + value(other.getValue()); + displayName(other.getDisplayName()); + return this; + } + + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + public RemoteFieldClassFieldChoicesItem build() { + return new RemoteFieldClassFieldChoicesItem(value, displayName, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClass.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClass.java similarity index 90% rename from src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClass.java rename to src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClass.java index 095ef21d3..77db8b030 100644 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClass.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClass.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -34,9 +34,9 @@ public final class RemoteFieldClassForCustomObjectClass { private final Optional isRequired; - private final Optional fieldType; + private final Optional fieldType; - private final Optional fieldFormat; + private final Optional fieldFormat; private final Optional> fieldChoices; @@ -51,8 +51,8 @@ private RemoteFieldClassForCustomObjectClass( Optional remoteKeyName, Optional description, Optional isRequired, - Optional fieldType, - Optional fieldFormat, + Optional fieldType, + Optional fieldFormat, Optional> fieldChoices, Optional itemSchema, Map additionalProperties) { @@ -106,12 +106,12 @@ public Optional getIsRequired() { } @JsonProperty("field_type") - public Optional getFieldType() { + public Optional getFieldType() { return fieldType; } @JsonProperty("field_format") - public Optional getFieldFormat() { + public Optional getFieldFormat() { return fieldFormat; } @@ -188,9 +188,9 @@ public static final class Builder { private Optional isRequired = Optional.empty(); - private Optional fieldType = Optional.empty(); + private Optional fieldType = Optional.empty(); - private Optional fieldFormat = Optional.empty(); + private Optional fieldFormat = Optional.empty(); private Optional> fieldChoices = Optional.empty(); @@ -282,23 +282,23 @@ public Builder isRequired(Boolean isRequired) { } @JsonSetter(value = "field_type", nulls = Nulls.SKIP) - public Builder fieldType(Optional fieldType) { + public Builder fieldType(Optional fieldType) { this.fieldType = fieldType; return this; } - public Builder fieldType(RemoteFieldClassForCustomObjectClassFieldType fieldType) { + public Builder fieldType(FieldTypeEnum fieldType) { this.fieldType = Optional.ofNullable(fieldType); return this; } @JsonSetter(value = "field_format", nulls = Nulls.SKIP) - public Builder fieldFormat(Optional fieldFormat) { + public Builder fieldFormat(Optional fieldFormat) { this.fieldFormat = fieldFormat; return this; } - public Builder fieldFormat(RemoteFieldClassForCustomObjectClassFieldFormat fieldFormat) { + public Builder fieldFormat(FieldFormatEnum fieldFormat) { this.fieldFormat = Optional.ofNullable(fieldFormat); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java rename to src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java index a24e76057..96c96203a 100644 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java rename to src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java index 907e27181..da45c3a8c 100644 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/api/crm/types/RemoteFieldRemoteFieldClass.java new file mode 100644 index 000000000..abaa38a0a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldRemoteFieldClass.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldRemoteFieldClass.Deserializer.class) +public final class RemoteFieldRemoteFieldClass { + private final Object value; + + private final int type; + + private RemoteFieldRemoteFieldClass(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((RemoteFieldClass) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRemoteFieldClass && equalTo((RemoteFieldRemoteFieldClass) other); + } + + private boolean equalTo(RemoteFieldRemoteFieldClass other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldRemoteFieldClass of(String value) { + return new RemoteFieldRemoteFieldClass(value, 0); + } + + public static RemoteFieldRemoteFieldClass of(RemoteFieldClass value) { + return new RemoteFieldRemoteFieldClass(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteFieldClass value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldRemoteFieldClass.class); + } + + @java.lang.Override + public RemoteFieldRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/crm/types/RemoteFieldRequest.java new file mode 100644 index 000000000..74f4e557d --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldRequest.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldRequest.Builder.class) +public final class RemoteFieldRequest { + private final RemoteFieldRequestRemoteFieldClass remoteFieldClass; + + private final Optional value; + + private final Map additionalProperties; + + private RemoteFieldRequest( + RemoteFieldRequestRemoteFieldClass remoteFieldClass, + Optional value, + Map additionalProperties) { + this.remoteFieldClass = remoteFieldClass; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_field_class") + public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { + return remoteFieldClass; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRequest && equalTo((RemoteFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldRequest other) { + return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteFieldClassStage builder() { + return new Builder(); + } + + public interface RemoteFieldClassStage { + _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass); + + Builder from(RemoteFieldRequest other); + } + + public interface _FinalStage { + RemoteFieldRequest build(); + + _FinalStage value(Optional value); + + _FinalStage value(JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteFieldClassStage, _FinalStage { + private RemoteFieldRequestRemoteFieldClass remoteFieldClass; + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldRequest other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @java.lang.Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public RemoteFieldRequest build() { + return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/api/crm/types/RemoteFieldRequestRemoteFieldClass.java new file mode 100644 index 000000000..12418fdc4 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldRequestRemoteFieldClass.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldRequestRemoteFieldClass.Deserializer.class) +public final class RemoteFieldRequestRemoteFieldClass { + private final Object value; + + private final int type; + + private RemoteFieldRequestRemoteFieldClass(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((RemoteFieldClass) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRequestRemoteFieldClass + && equalTo((RemoteFieldRequestRemoteFieldClass) other); + } + + private boolean equalTo(RemoteFieldRequestRemoteFieldClass other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldRequestRemoteFieldClass of(String value) { + return new RemoteFieldRequestRemoteFieldClass(value, 0); + } + + public static RemoteFieldRequestRemoteFieldClass of(RemoteFieldClass value) { + return new RemoteFieldRequestRemoteFieldClass(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteFieldClass value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldRequestRemoteFieldClass.class); + } + + @java.lang.Override + public RemoteFieldRequestRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..390c0e6b5 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteKey.java b/src/main/java/com/merge/api/crm/types/RemoteKey.java new file mode 100644 index 000000000..981e26cb0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/crm/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..4715accd8 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteResponse.java b/src/main/java/com/merge/api/crm/types/RemoteResponse.java new file mode 100644 index 000000000..b2b09e447 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(ResponseTypeEnum responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RequestFormatEnum.java b/src/main/java/com/merge/api/crm/types/RequestFormatEnum.java new file mode 100644 index 000000000..45346aebb --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RequestFormatEnum { + JSON("JSON"), + + XML("XML"), + + MULTIPART("MULTIPART"); + + private final String value; + + RequestFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/crm/types/ResponseTypeEnum.java new file mode 100644 index 000000000..e0b08e562 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ResponseTypeEnum { + JSON("JSON"), + + BASE_64_GZIP("BASE64_GZIP"); + + private final String value; + + ResponseTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/RoleEnum.java b/src/main/java/com/merge/api/crm/types/RoleEnum.java new file mode 100644 index 000000000..2d77a296a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RoleEnum { + ADMIN("ADMIN"), + + DEVELOPER("DEVELOPER"), + + MEMBER("MEMBER"), + + API("API"), + + SYSTEM("SYSTEM"), + + MERGE_TEAM("MERGE_TEAM"); + + private final String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/crm/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..57b123c92 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SelectiveSyncConfigurationsUsageEnum { + IN_NEXT_SYNC("IN_NEXT_SYNC"), + + IN_LAST_SYNC("IN_LAST_SYNC"); + + private final String value; + + SelectiveSyncConfigurationsUsageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/Stage.java b/src/main/java/com/merge/api/crm/types/Stage.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/Stage.java rename to src/main/java/com/merge/api/crm/types/Stage.java index 1fca9fcfe..d1873eb9e 100644 --- a/src/main/java/com/merge/api/resources/crm/types/Stage.java +++ b/src/main/java/com/merge/api/crm/types/Stage.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/stages/requests/StagesListRequest.java b/src/main/java/com/merge/api/crm/types/StagesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/stages/requests/StagesListRequest.java rename to src/main/java/com/merge/api/crm/types/StagesListRequest.java index 08600dec3..104f90980 100644 --- a/src/main/java/com/merge/api/resources/crm/stages/requests/StagesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/StagesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.stages.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/stages/requests/StagesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/stages/requests/StagesRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java index 31e8b899e..b5e7600e1 100644 --- a/src/main/java/com/merge/api/resources/crm/stages/requests/StagesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.stages.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/stages/requests/StagesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/StagesRetrieveRequest.java similarity index 76% rename from src/main/java/com/merge/api/resources/crm/stages/requests/StagesRetrieveRequest.java rename to src/main/java/com/merge/api/crm/types/StagesRetrieveRequest.java index 58d02bedf..96c0538db 100644 --- a/src/main/java/com/merge/api/resources/crm/stages/requests/StagesRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/StagesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.stages.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -24,14 +24,18 @@ public final class StagesRetrieveRequest { private final Optional includeRemoteFields; + private final Optional includeShellData; + private final Map additionalProperties; private StagesRetrieveRequest( Optional includeRemoteData, Optional includeRemoteFields, + Optional includeShellData, Map additionalProperties) { this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; this.additionalProperties = additionalProperties; } @@ -51,6 +55,14 @@ public Optional getIncludeRemoteFields() { return includeRemoteFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -64,12 +76,13 @@ public Map getAdditionalProperties() { private boolean equalTo(StagesRetrieveRequest other) { return includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); } @java.lang.Override public int hashCode() { - return Objects.hash(this.includeRemoteData, this.includeRemoteFields); + return Objects.hash(this.includeRemoteData, this.includeRemoteFields, this.includeShellData); } @java.lang.Override @@ -87,6 +100,8 @@ public static final class Builder { private Optional includeRemoteFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -95,6 +110,7 @@ private Builder() {} public Builder from(StagesRetrieveRequest other) { includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); return this; } @@ -120,8 +136,20 @@ public Builder includeRemoteFields(Boolean includeRemoteFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + public StagesRetrieveRequest build() { - return new StagesRetrieveRequest(includeRemoteData, includeRemoteFields, additionalProperties); + return new StagesRetrieveRequest( + includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/crm/types/StatusFd5Enum.java b/src/main/java/com/merge/api/crm/types/StatusFd5Enum.java new file mode 100644 index 000000000..220b79799 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/StatusFd5Enum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum StatusFd5Enum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + StatusFd5Enum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/SyncStatus.java b/src/main/java/com/merge/api/crm/types/SyncStatus.java new file mode 100644 index 000000000..bc79ffa57 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final StatusFd5Enum status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + StatusFd5Enum status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public StatusFd5Enum getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull StatusFd5Enum status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private StatusFd5Enum status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull StatusFd5Enum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/crm/types/SyncStatusListRequest.java new file mode 100644 index 000000000..b841e6fe6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/SyncStatusListRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/types/Task.java b/src/main/java/com/merge/api/crm/types/Task.java similarity index 97% rename from src/main/java/com/merge/api/resources/crm/types/Task.java rename to src/main/java/com/merge/api/crm/types/Task.java index 78a64c54d..f8d73207f 100644 --- a/src/main/java/com/merge/api/resources/crm/types/Task.java +++ b/src/main/java/com/merge/api/crm/types/Task.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -45,7 +45,7 @@ public final class Task { private final Optional dueDate; - private final Optional status; + private final Optional status; private final Optional remoteWasDeleted; @@ -69,7 +69,7 @@ private Task( Optional opportunity, Optional completedDate, Optional dueDate, - Optional status, + Optional status, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -187,7 +187,7 @@ public Optional getDueDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -298,7 +298,7 @@ public static final class Builder { private Optional dueDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -455,12 +455,12 @@ public Builder dueDate(OffsetDateTime dueDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TaskStatus status) { + public Builder status(TaskStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskAccount.java b/src/main/java/com/merge/api/crm/types/TaskAccount.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/TaskAccount.java rename to src/main/java/com/merge/api/crm/types/TaskAccount.java index 317d35a2d..261c44030 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskAccount.java +++ b/src/main/java/com/merge/api/crm/types/TaskAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TaskAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TaskAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/tasks/requests/TaskEndpointRequest.java b/src/main/java/com/merge/api/crm/types/TaskEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/crm/tasks/requests/TaskEndpointRequest.java rename to src/main/java/com/merge/api/crm/types/TaskEndpointRequest.java index cb877a271..234b7618f 100644 --- a/src/main/java/com/merge/api/resources/crm/tasks/requests/TaskEndpointRequest.java +++ b/src/main/java/com/merge/api/crm/types/TaskEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.tasks.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.TaskRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskOpportunity.java b/src/main/java/com/merge/api/crm/types/TaskOpportunity.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/TaskOpportunity.java rename to src/main/java/com/merge/api/crm/types/TaskOpportunity.java index e3c59fd20..f0a5ccf88 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskOpportunity.java +++ b/src/main/java/com/merge/api/crm/types/TaskOpportunity.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TaskOpportunity deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TaskOpportunity deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskOwner.java b/src/main/java/com/merge/api/crm/types/TaskOwner.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/TaskOwner.java rename to src/main/java/com/merge/api/crm/types/TaskOwner.java index f0b1175a3..5f70195d2 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskOwner.java +++ b/src/main/java/com/merge/api/crm/types/TaskOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TaskOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TaskOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskRequest.java b/src/main/java/com/merge/api/crm/types/TaskRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/crm/types/TaskRequest.java rename to src/main/java/com/merge/api/crm/types/TaskRequest.java index 92cf769d9..20eb99c05 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskRequest.java +++ b/src/main/java/com/merge/api/crm/types/TaskRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,7 +37,7 @@ public final class TaskRequest { private final Optional dueDate; - private final Optional status; + private final Optional status; private final Optional> integrationParams; @@ -55,7 +55,7 @@ private TaskRequest( Optional opportunity, Optional completedDate, Optional dueDate, - Optional status, + Optional status, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -138,7 +138,7 @@ public Optional getDueDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -223,7 +223,7 @@ public static final class Builder { private Optional dueDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -329,12 +329,12 @@ public Builder dueDate(OffsetDateTime dueDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TaskRequestStatus status) { + public Builder status(TaskStatusEnum status) { this.status = Optional.ofNullable(status); return this; } diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskRequestAccount.java b/src/main/java/com/merge/api/crm/types/TaskRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/TaskRequestAccount.java rename to src/main/java/com/merge/api/crm/types/TaskRequestAccount.java index 89148c9df..cab4f9b78 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskRequestAccount.java +++ b/src/main/java/com/merge/api/crm/types/TaskRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TaskRequestAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TaskRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskRequestOpportunity.java b/src/main/java/com/merge/api/crm/types/TaskRequestOpportunity.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/TaskRequestOpportunity.java rename to src/main/java/com/merge/api/crm/types/TaskRequestOpportunity.java index 7e7a3e8b1..19e1f5b6f 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskRequestOpportunity.java +++ b/src/main/java/com/merge/api/crm/types/TaskRequestOpportunity.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TaskRequestOpportunity deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TaskRequestOpportunity deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskRequestOwner.java b/src/main/java/com/merge/api/crm/types/TaskRequestOwner.java similarity index 95% rename from src/main/java/com/merge/api/resources/crm/types/TaskRequestOwner.java rename to src/main/java/com/merge/api/crm/types/TaskRequestOwner.java index 3ade35e23..e7913cba0 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskRequestOwner.java +++ b/src/main/java/com/merge/api/crm/types/TaskRequestOwner.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TaskRequestOwner deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TaskRequestOwner deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskResponse.java b/src/main/java/com/merge/api/crm/types/TaskResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/types/TaskResponse.java rename to src/main/java/com/merge/api/crm/types/TaskResponse.java index a6be4acaa..f73f7c0c4 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskResponse.java +++ b/src/main/java/com/merge/api/crm/types/TaskResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskStatusEnum.java b/src/main/java/com/merge/api/crm/types/TaskStatusEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/crm/types/TaskStatusEnum.java rename to src/main/java/com/merge/api/crm/types/TaskStatusEnum.java index 9f3b7ad60..6f1a0ec7b 100644 --- a/src/main/java/com/merge/api/resources/crm/types/TaskStatusEnum.java +++ b/src/main/java/com/merge/api/crm/types/TaskStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.types; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/crm/tasks/requests/TasksListRequest.java b/src/main/java/com/merge/api/crm/types/TasksListRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/crm/tasks/requests/TasksListRequest.java rename to src/main/java/com/merge/api/crm/types/TasksListRequest.java index d9a7fc96d..92a251f07 100644 --- a/src/main/java/com/merge/api/resources/crm/tasks/requests/TasksListRequest.java +++ b/src/main/java/com/merge/api/crm/types/TasksListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.tasks.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.tasks.types.TasksListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TasksListRequest.Builder.class) public final class TasksListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -49,10 +50,10 @@ public final class TasksListRequest { private final Map additionalProperties; private TasksListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -62,10 +63,10 @@ private TasksListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -77,6 +78,14 @@ private TasksListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -101,14 +110,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -185,10 +186,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(TasksListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -202,10 +203,10 @@ private boolean equalTo(TasksListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -227,14 +228,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -257,10 +258,10 @@ public static final class Builder { private Builder() {} public Builder from(TasksListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -272,6 +273,22 @@ public Builder from(TasksListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(TasksListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -305,17 +322,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(TasksListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -406,10 +412,10 @@ public Builder remoteId(String remoteId) { public TasksListRequest build() { return new TasksListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/crm/types/TasksListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/TasksListRequestExpandItem.java new file mode 100644 index 000000000..a1f56c48b --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/TasksListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TasksListRequestExpandItem { + ACCOUNT("account"), + + OPPORTUNITY("opportunity"), + + OWNER("owner"); + + private final String value; + + TasksListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/crm/tasks/requests/TasksRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/tasks/requests/TasksRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java index 3def24821..d475332b3 100644 --- a/src/main/java/com/merge/api/resources/crm/tasks/requests/TasksRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.tasks.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/TasksRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/TasksRetrieveRequest.java new file mode 100644 index 000000000..cc70b5c1b --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/TasksRetrieveRequest.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TasksRetrieveRequest.Builder.class) +public final class TasksRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private TasksRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TasksRetrieveRequest && equalTo((TasksRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TasksRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TasksRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(TasksRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public TasksRetrieveRequest build() { + return new TasksRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/TasksRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/TasksRetrieveRequestExpandItem.java new file mode 100644 index 000000000..55961d8ef --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/TasksRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TasksRetrieveRequestExpandItem { + ACCOUNT("account"), + + OPPORTUNITY("opportunity"), + + OWNER("owner"); + + private final String value; + + TasksRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/crm/types/User.java b/src/main/java/com/merge/api/crm/types/User.java new file mode 100644 index 000000000..c5ce7145e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/User.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = User.Builder.class) +public final class User { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional email; + + private final Optional isActive; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private User( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional email, + Optional isActive, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.email = email; + this.isActive = isActive; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The user's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The user's email address. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Whether or not the user is active. + */ + @JsonProperty("is_active") + public Optional getIsActive() { + return isActive; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof User && equalTo((User) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(User other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && email.equals(other.email) + && isActive.equals(other.isActive) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.email, + this.isActive, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional isActive = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(User other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + email(other.getEmail()); + isActive(other.getIsActive()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @JsonSetter(value = "is_active", nulls = Nulls.SKIP) + public Builder isActive(Optional isActive) { + this.isActive = isActive; + return this; + } + + public Builder isActive(Boolean isActive) { + this.isActive = Optional.ofNullable(isActive); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public User build() { + return new User( + id, + remoteId, + createdAt, + modifiedAt, + name, + email, + isActive, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/UsersListRequest.java b/src/main/java/com/merge/api/crm/types/UsersListRequest.java new file mode 100644 index 000000000..9a7c9d751 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/UsersListRequest.java @@ -0,0 +1,423 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersListRequest.Builder.class) +public final class UsersListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional email; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private UsersListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional email, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.email = email; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return users with this email. + */ + @JsonProperty("email") + public Optional getEmail() { + return email; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListRequest && equalTo((UsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && email.equals(other.email) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.email, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional email = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + email(other.getEmail()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "email", nulls = Nulls.SKIP) + public Builder email(Optional email) { + this.email = email; + return this; + } + + public Builder email(String email) { + this.email = Optional.ofNullable(email); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public UsersListRequest build() { + return new UsersListRequest( + createdAfter, + createdBefore, + cursor, + email, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/crm/users/requests/UsersRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/crm/users/requests/UsersRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java index 2ee77f95d..fe73df048 100644 --- a/src/main/java/com/merge/api/resources/crm/users/requests/UsersRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.crm.users.requests; +package com.merge.api.crm.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/crm/types/UsersRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/UsersRetrieveRequest.java new file mode 100644 index 000000000..f07707488 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/UsersRetrieveRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) +public final class UsersRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private UsersRetrieveRequest( + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public UsersRetrieveRequest build() { + return new UsersRetrieveRequest( + includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/ValidationProblemSource.java b/src/main/java/com/merge/api/crm/types/ValidationProblemSource.java new file mode 100644 index 000000000..4bd0da75f --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ValidationProblemSource.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ValidationProblemSource.Builder.class) +public final class ValidationProblemSource { + private final String pointer; + + private final Map additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/WarningValidationProblem.java b/src/main/java/com/merge/api/crm/types/WarningValidationProblem.java new file mode 100644 index 000000000..65db3d72e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/WarningValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/WebhookReceiver.java b/src/main/java/com/merge/api/crm/types/WebhookReceiver.java new file mode 100644 index 000000000..01fd5fb10 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/crm/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..dc478e7ad --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/AccountDetailsClient.java b/src/main/java/com/merge/api/filestorage/AccountDetailsClient.java new file mode 100644 index 000000000..8c688c16a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountDetails; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AccountTokenClient.java b/src/main/java/com/merge/api/filestorage/AccountTokenClient.java new file mode 100644 index 000000000..c1d0b59f1 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AccountTokenClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountToken; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/filestorage/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..938feea65 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountDetails; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncAccountTokenClient.java new file mode 100644 index 000000000..92730e571 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncAccountTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/filestorage/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..f06c66060 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AsyncPassthroughReciept; +import com.merge.api.filestorage.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.filestorage.types.DataPassthroughRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/filestorage/AsyncAuditTrailClient.java new file mode 100644 index 000000000..c97842155 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AuditLogEvent; +import com.merge.api.filestorage.types.AuditTrailListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/filestorage/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..ef9f502e9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AvailableActions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/filestorage/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..872545318 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncDrivesClient.java b/src/main/java/com/merge/api/filestorage/AsyncDrivesClient.java new file mode 100644 index 000000000..9ffeceac4 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncDrivesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Drive; +import com.merge.api.filestorage.types.DrivesListRequest; +import com.merge.api.filestorage.types.DrivesRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncDrivesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDrivesClient rawClient; + + public AsyncDrivesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDrivesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDrivesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Drive objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Drive objects. + */ + public CompletableFuture> list(DrivesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Drive objects. + */ + public CompletableFuture> list(DrivesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Drive object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Drive object with the given id. + */ + public CompletableFuture retrieve(String id, DrivesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Drive object with the given id. + */ + public CompletableFuture retrieve(String id, DrivesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/filestorage/AsyncFieldMappingClient.java new file mode 100644 index 000000000..5eb1e9af9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncFieldMappingClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CreateFieldMappingRequest; +import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; +import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; +import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; +import com.merge.api.filestorage.types.RemoteFieldApiResponse; +import com.merge.api.filestorage.types.RemoteFieldsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncFileStorageClient.java b/src/main/java/com/merge/api/filestorage/AsyncFileStorageClient.java new file mode 100644 index 000000000..223cec07e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncFileStorageClient.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncFileStorageClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier drivesClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier filesClient; + + protected final Supplier foldersClient; + + protected final Supplier generateKeyClient; + + protected final Supplier groupsClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public AsyncFileStorageClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.drivesClient = Suppliers.memoize(() -> new AsyncDrivesClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.filesClient = Suppliers.memoize(() -> new AsyncFilesClient(clientOptions)); + this.foldersClient = Suppliers.memoize(() -> new AsyncFoldersClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.groupsClient = Suppliers.memoize(() -> new AsyncGroupsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncDrivesClient drives() { + return this.drivesClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncFilesClient files() { + return this.filesClient.get(); + } + + public AsyncFoldersClient folders() { + return this.foldersClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncGroupsClient groups() { + return this.groupsClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncFilesClient.java b/src/main/java/com/merge/api/filestorage/AsyncFilesClient.java new file mode 100644 index 000000000..82ac1a4b8 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncFilesClient.java @@ -0,0 +1,179 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.DownloadRequestMeta; +import com.merge.api.filestorage.types.File; +import com.merge.api.filestorage.types.FileStorageFileEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFileResponse; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaListRequest; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaRetrieveRequest; +import com.merge.api.filestorage.types.FilesDownloadRetrieveRequest; +import com.merge.api.filestorage.types.FilesListRequest; +import com.merge.api.filestorage.types.FilesRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; +import java.io.InputStream; +import java.util.concurrent.CompletableFuture; + +public class AsyncFilesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFilesClient rawClient; + + public AsyncFilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of File objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of File objects. + */ + public CompletableFuture> list(FilesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of File objects. + */ + public CompletableFuture> list(FilesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a File object with the given values. + */ + public CompletableFuture create(FileStorageFileEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a File object with the given values. + */ + public CompletableFuture create( + FileStorageFileEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a File object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a File object with the given id. + */ + public CompletableFuture retrieve(String id, FilesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a File object with the given id. + */ + public CompletableFuture retrieve(String id, FilesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture downloadRetrieve(String id) { + return this.rawClient.downloadRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture downloadRetrieve(String id, FilesDownloadRetrieveRequest request) { + return this.rawClient.downloadRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture downloadRetrieve( + String id, FilesDownloadRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.downloadRetrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public CompletableFuture downloadRequestMetaRetrieve(String id) { + return this.rawClient.downloadRequestMetaRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public CompletableFuture downloadRequestMetaRetrieve( + String id, FilesDownloadRequestMetaRetrieveRequest request) { + return this.rawClient.downloadRequestMetaRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public CompletableFuture downloadRequestMetaRetrieve( + String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient + .downloadRequestMetaRetrieve(id, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public CompletableFuture> downloadRequestMetaList() { + return this.rawClient.downloadRequestMetaList().thenApply(response -> response.body()); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public CompletableFuture> downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request) { + return this.rawClient.downloadRequestMetaList(request).thenApply(response -> response.body()); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public CompletableFuture> downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request, RequestOptions requestOptions) { + return this.rawClient.downloadRequestMetaList(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncFoldersClient.java b/src/main/java/com/merge/api/filestorage/AsyncFoldersClient.java new file mode 100644 index 000000000..501b1f155 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncFoldersClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.FileStorageFolderEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFolderResponse; +import com.merge.api.filestorage.types.Folder; +import com.merge.api.filestorage.types.FoldersListRequest; +import com.merge.api.filestorage.types.FoldersRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncFoldersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFoldersClient rawClient; + + public AsyncFoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFoldersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFoldersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Folder objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Folder objects. + */ + public CompletableFuture> list(FoldersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Folder objects. + */ + public CompletableFuture> list( + FoldersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Folder object with the given values. + */ + public CompletableFuture create(FileStorageFolderEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Folder object with the given values. + */ + public CompletableFuture create( + FileStorageFolderEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Folder object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Folder object with the given id. + */ + public CompletableFuture retrieve(String id, FoldersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Folder object with the given id. + */ + public CompletableFuture retrieve( + String id, FoldersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncForceResyncClient.java b/src/main/java/com/merge/api/filestorage/AsyncForceResyncClient.java new file mode 100644 index 000000000..2a9f202c4 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.SyncStatus; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..eafa15bf7 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.GenerateRemoteKeyRequest; +import com.merge.api.filestorage.types.RemoteKey; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncGroupsClient.java b/src/main/java/com/merge/api/filestorage/AsyncGroupsClient.java new file mode 100644 index 000000000..a048b98d1 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncGroupsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Group; +import com.merge.api.filestorage.types.GroupsListRequest; +import com.merge.api.filestorage.types.GroupsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncGroupsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGroupsClient rawClient; + + public AsyncGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncIssuesClient.java b/src/main/java/com/merge/api/filestorage/AsyncIssuesClient.java new file mode 100644 index 000000000..8e7898f6b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Issue; +import com.merge.api.filestorage.types.IssuesListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncLinkTokenClient.java new file mode 100644 index 000000000..0525c203b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.EndUserDetailsRequest; +import com.merge.api.filestorage.types.LinkToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/filestorage/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..739e169e7 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AccountDetailsAndActions; +import com.merge.api.filestorage.types.LinkedAccountsListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncPassthroughClient.java b/src/main/java/com/merge/api/filestorage/AsyncPassthroughClient.java new file mode 100644 index 000000000..eff3dc2ef --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.DataPassthroughRequest; +import com.merge.api.filestorage.types.RemoteResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..6f0cf937f --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAccountDetailsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountDetails; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..2e2e03ad9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAccountTokenClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..900bd0b7c --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AsyncPassthroughReciept; +import com.merge.api.filestorage.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.filestorage.types.DataPassthroughRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughReciept.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..948c33d4f --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AuditLogEvent; +import com.merge.api.filestorage.types.AuditTrailListRequest; +import com.merge.api.filestorage.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..098630669 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAvailableActionsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AvailableActions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..919c58759 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawDeleteAccountClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java new file mode 100644 index 000000000..fcab5d3c0 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java @@ -0,0 +1,254 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Drive; +import com.merge.api.filestorage.types.DrivesListRequest; +import com.merge.api.filestorage.types.DrivesRetrieveRequest; +import com.merge.api.filestorage.types.PaginatedDriveList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDrivesClient { + protected final ClientOptions clientOptions; + + public AsyncRawDrivesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Drive objects. + */ + public CompletableFuture>> list() { + return list(DrivesListRequest.builder().build()); + } + + /** + * Returns a list of Drive objects. + */ + public CompletableFuture>> list(DrivesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Drive objects. + */ + public CompletableFuture>> list( + DrivesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/drives"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedDriveList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDriveList.class); + Optional startingAfter = parsedResponse.getNext(); + DrivesListRequest nextRequest = DrivesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Drive object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, DrivesRetrieveRequest.builder().build()); + } + + /** + * Returns a Drive object with the given id. + */ + public CompletableFuture> retrieve(String id, DrivesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Drive object with the given id. + */ + public CompletableFuture> retrieve( + String id, DrivesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/drives") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Drive.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..fb98913b3 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CreateFieldMappingRequest; +import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; +import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; +import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; +import com.merge.api.filestorage.types.RemoteFieldApiResponse; +import com.merge.api.filestorage.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), RemoteFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java new file mode 100644 index 000000000..87f3c91a3 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java @@ -0,0 +1,672 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.ResponseBodyInputStream; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.DownloadRequestMeta; +import com.merge.api.filestorage.types.File; +import com.merge.api.filestorage.types.FileStorageFileEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFileResponse; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaListRequest; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaRetrieveRequest; +import com.merge.api.filestorage.types.FilesDownloadRetrieveRequest; +import com.merge.api.filestorage.types.FilesListRequest; +import com.merge.api.filestorage.types.FilesRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; +import com.merge.api.filestorage.types.PaginatedDownloadRequestMetaList; +import com.merge.api.filestorage.types.PaginatedFileList; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFilesClient { + protected final ClientOptions clientOptions; + + public AsyncRawFilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of File objects. + */ + public CompletableFuture>> list() { + return list(FilesListRequest.builder().build()); + } + + /** + * Returns a list of File objects. + */ + public CompletableFuture>> list(FilesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of File objects. + */ + public CompletableFuture>> list( + FilesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDriveId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "drive_id", request.getDriveId().get(), false); + } + if (request.getFolderId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "folder_id", request.getFolderId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedFileList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFileList.class); + Optional startingAfter = parsedResponse.getNext(); + FilesListRequest nextRequest = FilesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a File object with the given values. + */ + public CompletableFuture> create( + FileStorageFileEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a File object with the given values. + */ + public CompletableFuture> create( + FileStorageFileEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FileStorageFileResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a File object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, FilesRetrieveRequest.builder().build()); + } + + /** + * Returns a File object with the given id. + */ + public CompletableFuture> retrieve(String id, FilesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a File object with the given id. + */ + public CompletableFuture> retrieve( + String id, FilesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), File.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture> downloadRetrieve(String id) { + return downloadRetrieve(id, FilesDownloadRetrieveRequest.builder().build()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture> downloadRetrieve( + String id, FilesDownloadRetrieveRequest request) { + return downloadRetrieve(id, request, null); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture> downloadRetrieve( + String id, FilesDownloadRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files") + .addPathSegment(id) + .addPathSegments("download"); + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public CompletableFuture> downloadRequestMetaRetrieve(String id) { + return downloadRequestMetaRetrieve( + id, FilesDownloadRequestMetaRetrieveRequest.builder().build()); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public CompletableFuture> downloadRequestMetaRetrieve( + String id, FilesDownloadRequestMetaRetrieveRequest request) { + return downloadRequestMetaRetrieve(id, request, null); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public CompletableFuture> downloadRequestMetaRetrieve( + String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files") + .addPathSegment(id) + .addPathSegments("download/request-meta"); + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DownloadRequestMeta.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public CompletableFuture>> downloadRequestMetaList() { + return downloadRequestMetaList( + FilesDownloadRequestMetaListRequest.builder().build()); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public CompletableFuture>> downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request) { + return downloadRequestMetaList(request, null); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public CompletableFuture>> downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files/download/request-meta"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedDownloadRequestMetaList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedDownloadRequestMetaList.class); + Optional startingAfter = parsedResponse.getNext(); + FilesDownloadRequestMetaListRequest nextRequest = FilesDownloadRequestMetaListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return downloadRequestMetaList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java new file mode 100644 index 000000000..f23f6a26f --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java @@ -0,0 +1,410 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.FileStorageFolderEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFolderResponse; +import com.merge.api.filestorage.types.Folder; +import com.merge.api.filestorage.types.FoldersListRequest; +import com.merge.api.filestorage.types.FoldersRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; +import com.merge.api.filestorage.types.PaginatedFolderList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFoldersClient { + protected final ClientOptions clientOptions; + + public AsyncRawFoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Folder objects. + */ + public CompletableFuture>> list() { + return list(FoldersListRequest.builder().build()); + } + + /** + * Returns a list of Folder objects. + */ + public CompletableFuture>> list(FoldersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Folder objects. + */ + public CompletableFuture>> list( + FoldersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDriveId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "drive_id", request.getDriveId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentFolderId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_folder_id", request.getParentFolderId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedFolderList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFolderList.class); + Optional startingAfter = parsedResponse.getNext(); + FoldersListRequest nextRequest = FoldersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Folder object with the given values. + */ + public CompletableFuture> create( + FileStorageFolderEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Folder object with the given values. + */ + public CompletableFuture> create( + FileStorageFolderEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FileStorageFolderResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Folder object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, FoldersRetrieveRequest.builder().build()); + } + + /** + * Returns a Folder object with the given id. + */ + public CompletableFuture> retrieve(String id, FoldersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Folder object with the given id. + */ + public CompletableFuture> retrieve( + String id, FoldersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Folder.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..764b8a3b3 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawForceResyncClient.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..e789b0ad1 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawGenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.GenerateRemoteKeyRequest; +import com.merge.api.filestorage.types.RemoteKey; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java new file mode 100644 index 000000000..6af8bfb24 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java @@ -0,0 +1,258 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Group; +import com.merge.api.filestorage.types.GroupsListRequest; +import com.merge.api.filestorage.types.GroupsRetrieveRequest; +import com.merge.api.filestorage.types.PaginatedGroupList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGroupsClient { + protected final ClientOptions clientOptions; + + public AsyncRawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java new file mode 100644 index 000000000..eb66b97ac --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Issue; +import com.merge.api.filestorage.types.IssuesListRequest; +import com.merge.api.filestorage.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..1508a124d --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.EndUserDetailsRequest; +import com.merge.api.filestorage.types.LinkToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..c2c8638b5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AccountDetailsAndActions; +import com.merge.api.filestorage.types.LinkedAccountsListRequest; +import com.merge.api.filestorage.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..10cd403a3 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawPassthroughClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.DataPassthroughRequest; +import com.merge.api.filestorage.types.RemoteResponse; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..942d9df97 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.RemoteKey; +import com.merge.api.filestorage.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawScopesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawScopesClient.java new file mode 100644 index 000000000..e2c51e5a6 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawScopesClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CommonModelScopeApi; +import com.merge.api.filestorage.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..2edbe952d --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.PaginatedSyncStatusList; +import com.merge.api.filestorage.types.SyncStatus; +import com.merge.api.filestorage.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java new file mode 100644 index 000000000..03438cb24 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java @@ -0,0 +1,254 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.PaginatedUserList; +import com.merge.api.filestorage.types.User; +import com.merge.api.filestorage.types.UsersListRequest; +import com.merge.api.filestorage.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsMe().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_me", request.getIsMe().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..c453e0167 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.WebhookReceiver; +import com.merge.api.filestorage.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..1f83df3b5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.RemoteKey; +import com.merge.api.filestorage.types.RemoteKeyForRegenerationRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncScopesClient.java b/src/main/java/com/merge/api/filestorage/AsyncScopesClient.java new file mode 100644 index 000000000..b909b98c8 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CommonModelScopeApi; +import com.merge.api.filestorage.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/filestorage/AsyncSyncStatusClient.java new file mode 100644 index 000000000..3d8edec01 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.SyncStatus; +import com.merge.api.filestorage.types.SyncStatusListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncUsersClient.java b/src/main/java/com/merge/api/filestorage/AsyncUsersClient.java new file mode 100644 index 000000000..82f534fa0 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncUsersClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.User; +import com.merge.api.filestorage.types.UsersListRequest; +import com.merge.api.filestorage.types.UsersRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/filestorage/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..ca3a18579 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.WebhookReceiver; +import com.merge.api.filestorage.types.WebhookReceiverRequest; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AuditTrailClient.java b/src/main/java/com/merge/api/filestorage/AuditTrailClient.java new file mode 100644 index 000000000..724fa325f --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AuditLogEvent; +import com.merge.api.filestorage.types.AuditTrailListRequest; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/AvailableActionsClient.java b/src/main/java/com/merge/api/filestorage/AvailableActionsClient.java new file mode 100644 index 000000000..eaeb3b69a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AvailableActions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/DeleteAccountClient.java b/src/main/java/com/merge/api/filestorage/DeleteAccountClient.java new file mode 100644 index 000000000..e1900228a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/DrivesClient.java b/src/main/java/com/merge/api/filestorage/DrivesClient.java new file mode 100644 index 000000000..6973f3d5d --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/DrivesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Drive; +import com.merge.api.filestorage.types.DrivesListRequest; +import com.merge.api.filestorage.types.DrivesRetrieveRequest; + +public class DrivesClient { + protected final ClientOptions clientOptions; + + private final RawDrivesClient rawClient; + + public DrivesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDrivesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDrivesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Drive objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Drive objects. + */ + public SyncPagingIterable list(DrivesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Drive objects. + */ + public SyncPagingIterable list(DrivesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Drive object with the given id. + */ + public Drive retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Drive object with the given id. + */ + public Drive retrieve(String id, DrivesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Drive object with the given id. + */ + public Drive retrieve(String id, DrivesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/FieldMappingClient.java b/src/main/java/com/merge/api/filestorage/FieldMappingClient.java new file mode 100644 index 000000000..acc221467 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/FieldMappingClient.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CreateFieldMappingRequest; +import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; +import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; +import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; +import com.merge.api.filestorage.types.RemoteFieldApiResponse; +import com.merge.api.filestorage.types.RemoteFieldsRetrieveRequest; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/FileStorageClient.java b/src/main/java/com/merge/api/filestorage/FileStorageClient.java new file mode 100644 index 000000000..29b263879 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/FileStorageClient.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class FileStorageClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier drivesClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier filesClient; + + protected final Supplier foldersClient; + + protected final Supplier generateKeyClient; + + protected final Supplier groupsClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public FileStorageClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.drivesClient = Suppliers.memoize(() -> new DrivesClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); + this.filesClient = Suppliers.memoize(() -> new FilesClient(clientOptions)); + this.foldersClient = Suppliers.memoize(() -> new FoldersClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions)); + this.groupsClient = Suppliers.memoize(() -> new GroupsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new WebhookReceiversClient(clientOptions)); + } + + public AccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public DrivesClient drives() { + return this.drivesClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public FilesClient files() { + return this.filesClient.get(); + } + + public FoldersClient folders() { + return this.foldersClient.get(); + } + + public GenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public GroupsClient groups() { + return this.groupsClient.get(); + } + + public IssuesClient issues() { + return this.issuesClient.get(); + } + + public LinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public LinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public PassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/FilesClient.java b/src/main/java/com/merge/api/filestorage/FilesClient.java new file mode 100644 index 000000000..f6001c2b0 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/FilesClient.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.DownloadRequestMeta; +import com.merge.api.filestorage.types.File; +import com.merge.api.filestorage.types.FileStorageFileEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFileResponse; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaListRequest; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaRetrieveRequest; +import com.merge.api.filestorage.types.FilesDownloadRetrieveRequest; +import com.merge.api.filestorage.types.FilesListRequest; +import com.merge.api.filestorage.types.FilesRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; +import java.io.InputStream; + +public class FilesClient { + protected final ClientOptions clientOptions; + + private final RawFilesClient rawClient; + + public FilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFilesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFilesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of File objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of File objects. + */ + public SyncPagingIterable list(FilesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of File objects. + */ + public SyncPagingIterable list(FilesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a File object with the given values. + */ + public FileStorageFileResponse create(FileStorageFileEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a File object with the given values. + */ + public FileStorageFileResponse create(FileStorageFileEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a File object with the given id. + */ + public File retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a File object with the given id. + */ + public File retrieve(String id, FilesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a File object with the given id. + */ + public File retrieve(String id, FilesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public InputStream downloadRetrieve(String id) { + return this.rawClient.downloadRetrieve(id).body(); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public InputStream downloadRetrieve(String id, FilesDownloadRetrieveRequest request) { + return this.rawClient.downloadRetrieve(id, request).body(); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public InputStream downloadRetrieve( + String id, FilesDownloadRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.downloadRetrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public DownloadRequestMeta downloadRequestMetaRetrieve(String id) { + return this.rawClient.downloadRequestMetaRetrieve(id).body(); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public DownloadRequestMeta downloadRequestMetaRetrieve(String id, FilesDownloadRequestMetaRetrieveRequest request) { + return this.rawClient.downloadRequestMetaRetrieve(id, request).body(); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public DownloadRequestMeta downloadRequestMetaRetrieve( + String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient + .downloadRequestMetaRetrieve(id, request, requestOptions) + .body(); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public SyncPagingIterable downloadRequestMetaList() { + return this.rawClient.downloadRequestMetaList().body(); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public SyncPagingIterable downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request) { + return this.rawClient.downloadRequestMetaList(request).body(); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public SyncPagingIterable downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request, RequestOptions requestOptions) { + return this.rawClient.downloadRequestMetaList(request, requestOptions).body(); + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/FoldersClient.java b/src/main/java/com/merge/api/filestorage/FoldersClient.java new file mode 100644 index 000000000..f09e18388 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/FoldersClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.FileStorageFolderEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFolderResponse; +import com.merge.api.filestorage.types.Folder; +import com.merge.api.filestorage.types.FoldersListRequest; +import com.merge.api.filestorage.types.FoldersRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; + +public class FoldersClient { + protected final ClientOptions clientOptions; + + private final RawFoldersClient rawClient; + + public FoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFoldersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFoldersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Folder objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Folder objects. + */ + public SyncPagingIterable list(FoldersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Folder objects. + */ + public SyncPagingIterable list(FoldersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Folder object with the given values. + */ + public FileStorageFolderResponse create(FileStorageFolderEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Folder object with the given values. + */ + public FileStorageFolderResponse create(FileStorageFolderEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Folder object with the given id. + */ + public Folder retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Folder object with the given id. + */ + public Folder retrieve(String id, FoldersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Folder object with the given id. + */ + public Folder retrieve(String id, FoldersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/ForceResyncClient.java b/src/main/java/com/merge/api/filestorage/ForceResyncClient.java new file mode 100644 index 000000000..5701e72f9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.SyncStatus; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/GenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/GenerateKeyClient.java new file mode 100644 index 000000000..7941ad316 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.GenerateRemoteKeyRequest; +import com.merge.api.filestorage.types.RemoteKey; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/GroupsClient.java b/src/main/java/com/merge/api/filestorage/GroupsClient.java new file mode 100644 index 000000000..0dfc963d0 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/GroupsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Group; +import com.merge.api.filestorage.types.GroupsListRequest; +import com.merge.api.filestorage.types.GroupsRetrieveRequest; + +public class GroupsClient { + protected final ClientOptions clientOptions; + + private final RawGroupsClient rawClient; + + public GroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/IssuesClient.java b/src/main/java/com/merge/api/filestorage/IssuesClient.java new file mode 100644 index 000000000..d76a2872b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Issue; +import com.merge.api.filestorage.types.IssuesListRequest; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/LinkTokenClient.java b/src/main/java/com/merge/api/filestorage/LinkTokenClient.java new file mode 100644 index 000000000..2b581d1a0 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.EndUserDetailsRequest; +import com.merge.api.filestorage.types.LinkToken; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/LinkedAccountsClient.java b/src/main/java/com/merge/api/filestorage/LinkedAccountsClient.java new file mode 100644 index 000000000..dcb27e307 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AccountDetailsAndActions; +import com.merge.api.filestorage.types.LinkedAccountsListRequest; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/PassthroughClient.java b/src/main/java/com/merge/api/filestorage/PassthroughClient.java new file mode 100644 index 000000000..0851776f7 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.DataPassthroughRequest; +import com.merge.api.filestorage.types.RemoteResponse; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawAccountDetailsClient.java b/src/main/java/com/merge/api/filestorage/RawAccountDetailsClient.java new file mode 100644 index 000000000..90337d284 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawAccountDetailsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountDetails; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java b/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java new file mode 100644 index 000000000..01f2c2e17 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AccountToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..d80f4f4a5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AsyncPassthroughReciept; +import com.merge.api.filestorage.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.filestorage.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java b/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java new file mode 100644 index 000000000..03ac510b9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AuditLogEvent; +import com.merge.api.filestorage.types.AuditTrailListRequest; +import com.merge.api.filestorage.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawAvailableActionsClient.java b/src/main/java/com/merge/api/filestorage/RawAvailableActionsClient.java new file mode 100644 index 000000000..eaa274ab5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawAvailableActionsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.AvailableActions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawDeleteAccountClient.java b/src/main/java/com/merge/api/filestorage/RawDeleteAccountClient.java new file mode 100644 index 000000000..559ab00ee --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawDeleteAccountClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawDrivesClient.java b/src/main/java/com/merge/api/filestorage/RawDrivesClient.java new file mode 100644 index 000000000..e50bfd03f --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawDrivesClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Drive; +import com.merge.api.filestorage.types.DrivesListRequest; +import com.merge.api.filestorage.types.DrivesRetrieveRequest; +import com.merge.api.filestorage.types.PaginatedDriveList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDrivesClient { + protected final ClientOptions clientOptions; + + public RawDrivesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Drive objects. + */ + public MergeApiHttpResponse> list() { + return list(DrivesListRequest.builder().build()); + } + + /** + * Returns a list of Drive objects. + */ + public MergeApiHttpResponse> list(DrivesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Drive objects. + */ + public MergeApiHttpResponse> list( + DrivesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/drives"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedDriveList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDriveList.class); + Optional startingAfter = parsedResponse.getNext(); + DrivesListRequest nextRequest = DrivesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Drive object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, DrivesRetrieveRequest.builder().build()); + } + + /** + * Returns a Drive object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, DrivesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Drive object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, DrivesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/drives") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Drive.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java b/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java new file mode 100644 index 000000000..46d8e276e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java @@ -0,0 +1,380 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CreateFieldMappingRequest; +import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; +import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; +import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; +import com.merge.api.filestorage.types.RemoteFieldApiResponse; +import com.merge.api.filestorage.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawFilesClient.java b/src/main/java/com/merge/api/filestorage/RawFilesClient.java new file mode 100644 index 000000000..5a876094e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawFilesClient.java @@ -0,0 +1,558 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.ResponseBodyInputStream; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.DownloadRequestMeta; +import com.merge.api.filestorage.types.File; +import com.merge.api.filestorage.types.FileStorageFileEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFileResponse; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaListRequest; +import com.merge.api.filestorage.types.FilesDownloadRequestMetaRetrieveRequest; +import com.merge.api.filestorage.types.FilesDownloadRetrieveRequest; +import com.merge.api.filestorage.types.FilesListRequest; +import com.merge.api.filestorage.types.FilesRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; +import com.merge.api.filestorage.types.PaginatedDownloadRequestMetaList; +import com.merge.api.filestorage.types.PaginatedFileList; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFilesClient { + protected final ClientOptions clientOptions; + + public RawFilesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of File objects. + */ + public MergeApiHttpResponse> list() { + return list(FilesListRequest.builder().build()); + } + + /** + * Returns a list of File objects. + */ + public MergeApiHttpResponse> list(FilesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of File objects. + */ + public MergeApiHttpResponse> list( + FilesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDriveId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "drive_id", request.getDriveId().get(), false); + } + if (request.getFolderId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "folder_id", request.getFolderId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedFileList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFileList.class); + Optional startingAfter = parsedResponse.getNext(); + FilesListRequest nextRequest = FilesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a File object with the given values. + */ + public MergeApiHttpResponse create(FileStorageFileEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a File object with the given values. + */ + public MergeApiHttpResponse create( + FileStorageFileEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FileStorageFileResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a File object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, FilesRetrieveRequest.builder().build()); + } + + /** + * Returns a File object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, FilesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a File object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, FilesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), File.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public MergeApiHttpResponse downloadRetrieve(String id) { + return downloadRetrieve(id, FilesDownloadRetrieveRequest.builder().build()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public MergeApiHttpResponse downloadRetrieve(String id, FilesDownloadRetrieveRequest request) { + return downloadRetrieve(id, request, null); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public MergeApiHttpResponse downloadRetrieve( + String id, FilesDownloadRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files") + .addPathSegment(id) + .addPathSegments("download"); + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public MergeApiHttpResponse downloadRequestMetaRetrieve(String id) { + return downloadRequestMetaRetrieve( + id, FilesDownloadRequestMetaRetrieveRequest.builder().build()); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public MergeApiHttpResponse downloadRequestMetaRetrieve( + String id, FilesDownloadRequestMetaRetrieveRequest request) { + return downloadRequestMetaRetrieve(id, request, null); + } + + /** + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + */ + public MergeApiHttpResponse downloadRequestMetaRetrieve( + String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files") + .addPathSegment(id) + .addPathSegments("download/request-meta"); + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DownloadRequestMeta.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public MergeApiHttpResponse> downloadRequestMetaList() { + return downloadRequestMetaList( + FilesDownloadRequestMetaListRequest.builder().build()); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public MergeApiHttpResponse> downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request) { + return downloadRequestMetaList(request, null); + } + + /** + * Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. + */ + public MergeApiHttpResponse> downloadRequestMetaList( + FilesDownloadRequestMetaListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files/download/request-meta"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedDownloadRequestMetaList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedDownloadRequestMetaList.class); + Optional startingAfter = parsedResponse.getNext(); + FilesDownloadRequestMetaListRequest nextRequest = FilesDownloadRequestMetaListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> downloadRequestMetaList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for FileStorageFile POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/files/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawFoldersClient.java b/src/main/java/com/merge/api/filestorage/RawFoldersClient.java new file mode 100644 index 000000000..ddfaa9f29 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawFoldersClient.java @@ -0,0 +1,344 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.FileStorageFolderEndpointRequest; +import com.merge.api.filestorage.types.FileStorageFolderResponse; +import com.merge.api.filestorage.types.Folder; +import com.merge.api.filestorage.types.FoldersListRequest; +import com.merge.api.filestorage.types.FoldersRetrieveRequest; +import com.merge.api.filestorage.types.MetaResponse; +import com.merge.api.filestorage.types.PaginatedFolderList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFoldersClient { + protected final ClientOptions clientOptions; + + public RawFoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Folder objects. + */ + public MergeApiHttpResponse> list() { + return list(FoldersListRequest.builder().build()); + } + + /** + * Returns a list of Folder objects. + */ + public MergeApiHttpResponse> list(FoldersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Folder objects. + */ + public MergeApiHttpResponse> list( + FoldersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDriveId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "drive_id", request.getDriveId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentFolderId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_folder_id", request.getParentFolderId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedFolderList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFolderList.class); + Optional startingAfter = parsedResponse.getNext(); + FoldersListRequest nextRequest = FoldersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Folder object with the given values. + */ + public MergeApiHttpResponse create(FileStorageFolderEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Folder object with the given values. + */ + public MergeApiHttpResponse create( + FileStorageFolderEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FileStorageFolderResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Folder object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, FoldersRetrieveRequest.builder().build()); + } + + /** + * Returns a Folder object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, FoldersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Folder object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, FoldersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Folder.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for FileStorageFolder POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/folders/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawForceResyncClient.java b/src/main/java/com/merge/api/filestorage/RawForceResyncClient.java new file mode 100644 index 000000000..781e7c3c9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawForceResyncClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawGenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/RawGenerateKeyClient.java new file mode 100644 index 000000000..37becfccd --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawGenerateKeyClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.GenerateRemoteKeyRequest; +import com.merge.api.filestorage.types.RemoteKey; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawGroupsClient.java b/src/main/java/com/merge/api/filestorage/RawGroupsClient.java new file mode 100644 index 000000000..6f40b5ce8 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawGroupsClient.java @@ -0,0 +1,221 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Group; +import com.merge.api.filestorage.types.GroupsListRequest; +import com.merge.api.filestorage.types.GroupsRetrieveRequest; +import com.merge.api.filestorage.types.PaginatedGroupList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGroupsClient { + protected final ClientOptions clientOptions; + + public RawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawIssuesClient.java b/src/main/java/com/merge/api/filestorage/RawIssuesClient.java new file mode 100644 index 000000000..84000cc76 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawIssuesClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.Issue; +import com.merge.api.filestorage.types.IssuesListRequest; +import com.merge.api.filestorage.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java b/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java new file mode 100644 index 000000000..00c042dab --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.EndUserDetailsRequest; +import com.merge.api.filestorage.types.LinkToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java new file mode 100644 index 000000000..07e91c436 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.AccountDetailsAndActions; +import com.merge.api.filestorage.types.LinkedAccountsListRequest; +import com.merge.api.filestorage.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawPassthroughClient.java b/src/main/java/com/merge/api/filestorage/RawPassthroughClient.java new file mode 100644 index 000000000..8017aa2d9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawPassthroughClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.DataPassthroughRequest; +import com.merge.api.filestorage.types.RemoteResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/RawRegenerateKeyClient.java new file mode 100644 index 000000000..83c2d4ec4 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawRegenerateKeyClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.RemoteKey; +import com.merge.api.filestorage.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawScopesClient.java b/src/main/java/com/merge/api/filestorage/RawScopesClient.java new file mode 100644 index 000000000..39e1fc763 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawScopesClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CommonModelScopeApi; +import com.merge.api.filestorage.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java b/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java new file mode 100644 index 000000000..236a380b5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.PaginatedSyncStatusList; +import com.merge.api.filestorage.types.SyncStatus; +import com.merge.api.filestorage.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawUsersClient.java b/src/main/java/com/merge/api/filestorage/RawUsersClient.java new file mode 100644 index 000000000..2efb17299 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawUsersClient.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.PaginatedUserList; +import com.merge.api.filestorage.types.User; +import com.merge.api.filestorage.types.UsersListRequest; +import com.merge.api.filestorage.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsMe().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_me", request.getIsMe().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/filestorage/RawWebhookReceiversClient.java new file mode 100644 index 000000000..127b9fbd1 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RawWebhookReceiversClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.WebhookReceiver; +import com.merge.api.filestorage.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("filestorage/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/RegenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/RegenerateKeyClient.java new file mode 100644 index 000000000..de8e80395 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.RemoteKey; +import com.merge.api.filestorage.types.RemoteKeyForRegenerationRequest; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/ScopesClient.java b/src/main/java/com/merge/api/filestorage/ScopesClient.java new file mode 100644 index 000000000..715fdf06f --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.CommonModelScopeApi; +import com.merge.api.filestorage.types.LinkedAccountCommonModelScopeDeserializerRequest; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/SyncStatusClient.java b/src/main/java/com/merge/api/filestorage/SyncStatusClient.java new file mode 100644 index 000000000..c14d663b5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.SyncStatus; +import com.merge.api.filestorage.types.SyncStatusListRequest; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/UsersClient.java b/src/main/java/com/merge/api/filestorage/UsersClient.java new file mode 100644 index 000000000..dc11b618a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/UsersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.filestorage.types.User; +import com.merge.api.filestorage.types.UsersListRequest; +import com.merge.api.filestorage.types.UsersRetrieveRequest; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/WebhookReceiversClient.java b/src/main/java/com/merge/api/filestorage/WebhookReceiversClient.java new file mode 100644 index 000000000..af5c00f6f --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.filestorage.types.WebhookReceiver; +import com.merge.api.filestorage.types.WebhookReceiverRequest; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AccountDetails.java b/src/main/java/com/merge/api/filestorage/types/AccountDetails.java new file mode 100644 index 000000000..d27529e08 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetails.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..840d359bb --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatusEnum status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatusEnum status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatusEnum getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(CategoryEnum category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatusEnum status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

The tenant or domain the customer has provided access to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..bce43804d --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..b6477ded0 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountDetailsAndActionsStatusEnum { + COMPLETE("COMPLETE"), + + INCOMPLETE("INCOMPLETE"), + + RELINK_NEEDED("RELINK_NEEDED"), + + IDLE("IDLE"); + + private final String value; + + AccountDetailsAndActionsStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AccountIntegration.java b/src/main/java/com/merge/api/filestorage/types/AccountIntegration.java new file mode 100644 index 000000000..7cd2968b1 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AccountIntegration.java @@ -0,0 +1,463 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

Company name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

Category or categories this integration is in beta status for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

Company logo in square shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

Company logo in rectangular shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AccountToken.java b/src/main/java/com/merge/api/filestorage/types/AccountToken.java new file mode 100644 index 000000000..5acb1f3d3 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AdvancedMetadata.java b/src/main/java/com/merge/api/filestorage/types/AdvancedMetadata.java new file mode 100644 index 000000000..c13353dbf --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..2bf7d1957 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..a84a06b3b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AuditLogEvent.java b/src/main/java/com/merge/api/filestorage/types/AuditLogEvent.java new file mode 100644 index 000000000..277f88c59 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AuditLogEvent.java @@ -0,0 +1,449 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final RoleEnum role; + + private final String ipAddress; + + private final EventTypeEnum eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + RoleEnum role, + String ipAddress, + EventTypeEnum eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ */ + @JsonProperty("role") + public RoleEnum getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ */ + @JsonProperty("event_type") + public EventTypeEnum getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + IpAddressStage role(@NotNull RoleEnum role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + EventDescriptionStage eventType(@NotNull EventTypeEnum eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private RoleEnum role; + + private String ipAddress; + + private EventTypeEnum eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

+ *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull RoleEnum role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

Designates the type of event that occurred.

+ *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull EventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The User's email at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

The User's full name at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/filestorage/types/AuditTrailListRequest.java new file mode 100644 index 000000000..b70b6c075 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AuditTrailListRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AvailableActions.java b/src/main/java/com/merge/api/filestorage/types/AvailableActions.java new file mode 100644 index 000000000..53fc95916 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/CategoriesEnum.java b/src/main/java/com/merge/api/filestorage/types/CategoriesEnum.java new file mode 100644 index 000000000..d62a65b23 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoriesEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoriesEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/CategoryEnum.java b/src/main/java/com/merge/api/filestorage/types/CategoryEnum.java new file mode 100644 index 000000000..5826e01e5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoryEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/filestorage/types/CommonModelScopeApi.java new file mode 100644 index 000000000..ce7bfbdc9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/CommonModelScopeApi.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/filestorage/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..1891c1262 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/filestorage/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..e3159f3a5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/CreateFieldMappingRequest.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final String targetFieldName; + + private final String targetFieldDescription; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + String targetFieldName, + String targetFieldDescription, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return The name of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_name") + public String getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_description") + public String getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TargetFieldNameStage builder() { + return new Builder(); + } + + public interface TargetFieldNameStage { + TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); + + Builder from(CreateFieldMappingRequest other); + } + + public interface TargetFieldDescriptionStage { + RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); + } + + public interface RemoteMethodStage { + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + } + + public interface RemoteUrlPathStage { + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TargetFieldNameStage, + TargetFieldDescriptionStage, + RemoteMethodStage, + RemoteUrlPathStage, + CommonModelNameStage, + _FinalStage { + private String targetFieldName; + + private String targetFieldDescription; + + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + return this; + } + + /** + *

The name of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_name") + public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

The description of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_description") + public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

The method of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

The path of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

The name of the Common Model that the remote field corresponds to in a given category.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/filestorage/types/DataPassthroughRequest.java new file mode 100644 index 000000000..afd410079 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/DataPassthroughRequest.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final MethodEnum method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + MethodEnum method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public MethodEnum getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull MethodEnum method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + _FinalStage data(Optional data); + + _FinalStage data(String data); + + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(RequestFormatEnum requestFormat); + + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private MethodEnum method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull MethodEnum method) { + this.method = method; + return this; + } + + /** + *

The path of the request in the third party's platform.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

The data with the request. You must include a request_format parameter matching the data's format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

An optional override of the third party's base url for the request.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/DebugModeLog.java b/src/main/java/com/merge/api/filestorage/types/DebugModeLog.java new file mode 100644 index 000000000..a92567ac6 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/filestorage/types/DebugModelLogSummary.java new file mode 100644 index 000000000..6319a5ed8 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/DownloadRequestMeta.java b/src/main/java/com/merge/api/filestorage/types/DownloadRequestMeta.java new file mode 100644 index 000000000..ae08fc733 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/DownloadRequestMeta.java @@ -0,0 +1,233 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DownloadRequestMeta.Builder.class) +public final class DownloadRequestMeta { + private final String id; + + private final String url; + + private final String method; + + private final Map headers; + + private final Map body; + + private final Map additionalProperties; + + private DownloadRequestMeta( + String id, + String url, + String method, + Map headers, + Map body, + Map additionalProperties) { + this.id = id; + this.url = url; + this.method = method; + this.headers = headers; + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("headers") + public Map getHeaders() { + return headers; + } + + @JsonProperty("body") + public Map getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DownloadRequestMeta && equalTo((DownloadRequestMeta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DownloadRequestMeta other) { + return id.equals(other.id) + && url.equals(other.url) + && method.equals(other.method) + && headers.equals(other.headers) + && body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.url, this.method, this.headers, this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + UrlStage id(@NotNull String id); + + Builder from(DownloadRequestMeta other); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + } + + public interface MethodStage { + _FinalStage method(@NotNull String method); + } + + public interface _FinalStage { + DownloadRequestMeta build(); + + _FinalStage headers(Map headers); + + _FinalStage putAllHeaders(Map headers); + + _FinalStage headers(String key, JsonNode value); + + _FinalStage body(Map body); + + _FinalStage putAllBody(Map body); + + _FinalStage body(String key, JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, UrlStage, MethodStage, _FinalStage { + private String id; + + private String url; + + private String method; + + private Map body = new LinkedHashMap<>(); + + private Map headers = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DownloadRequestMeta other) { + id(other.getId()); + url(other.getUrl()); + method(other.getMethod()); + headers(other.getHeaders()); + body(other.getBody()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public UrlStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public _FinalStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + public _FinalStage body(String key, JsonNode value) { + this.body.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllBody(Map body) { + this.body.putAll(body); + return this; + } + + @java.lang.Override + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public _FinalStage body(Map body) { + this.body.clear(); + this.body.putAll(body); + return this; + } + + @java.lang.Override + public _FinalStage headers(String key, JsonNode value) { + this.headers.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllHeaders(Map headers) { + this.headers.putAll(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Map headers) { + this.headers.clear(); + this.headers.putAll(headers); + return this; + } + + @java.lang.Override + public DownloadRequestMeta build() { + return new DownloadRequestMeta(id, url, method, headers, body, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/Drive.java b/src/main/java/com/merge/api/filestorage/types/Drive.java similarity index 99% rename from src/main/java/com/merge/api/resources/filestorage/types/Drive.java rename to src/main/java/com/merge/api/filestorage/types/Drive.java index 8bca14b9a..fb9334dea 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/Drive.java +++ b/src/main/java/com/merge/api/filestorage/types/Drive.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/filestorage/drives/requests/DrivesListRequest.java b/src/main/java/com/merge/api/filestorage/types/DrivesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/filestorage/drives/requests/DrivesListRequest.java rename to src/main/java/com/merge/api/filestorage/types/DrivesListRequest.java index 12b800361..0b20547b3 100644 --- a/src/main/java/com/merge/api/resources/filestorage/drives/requests/DrivesListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/DrivesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.drives.requests; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/filestorage/types/DrivesRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/DrivesRetrieveRequest.java new file mode 100644 index 000000000..c503815ef --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/DrivesRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DrivesRetrieveRequest.Builder.class) +public final class DrivesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private DrivesRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DrivesRetrieveRequest && equalTo((DrivesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DrivesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DrivesRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public DrivesRetrieveRequest build() { + return new DrivesRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/filestorage/types/EnabledActionsEnum.java new file mode 100644 index 000000000..907d4b858 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EnabledActionsEnum { + READ("READ"), + + WRITE("WRITE"); + + private final String value; + + EnabledActionsEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/EncodingEnum.java b/src/main/java/com/merge/api/filestorage/types/EncodingEnum.java new file mode 100644 index 000000000..50c96a365 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EncodingEnum { + RAW("RAW"), + + BASE_64("BASE64"), + + GZIP_BASE_64("GZIP_BASE64"); + + private final String value; + + EncodingEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/filestorage/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..a5dad7f71 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/EndUserDetailsRequest.java @@ -0,0 +1,607 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + _FinalStage language(Optional language); + + _FinalStage language(LanguageEnum language); + + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + return this; + } + + /** + *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

Your end user's organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

A JSON object containing integration-specific configuration options.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

The following subset of IETF language tags can be used to configure localization.

+ *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/filestorage/types/ErrorValidationProblem.java new file mode 100644 index 000000000..659928b0b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ErrorValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/EventTypeEnum.java b/src/main/java/com/merge/api/filestorage/types/EventTypeEnum.java new file mode 100644 index 000000000..2abea1fa4 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/EventTypeEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EventTypeEnum { + CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), + + DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), + + CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), + + DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), + + REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), + + INVITED_USER("INVITED_USER"), + + TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), + + TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), + + DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), + + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT("DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"), + + CREATED_DESTINATION("CREATED_DESTINATION"), + + DELETED_DESTINATION("DELETED_DESTINATION"), + + CHANGED_DESTINATION("CHANGED_DESTINATION"), + + CHANGED_SCOPES("CHANGED_SCOPES"), + + CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), + + CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), + + ENABLED_INTEGRATION("ENABLED_INTEGRATION"), + + DISABLED_INTEGRATION("DISABLED_INTEGRATION"), + + ENABLED_CATEGORY("ENABLED_CATEGORY"), + + DISABLED_CATEGORY("DISABLED_CATEGORY"), + + CHANGED_PASSWORD("CHANGED_PASSWORD"), + + RESET_PASSWORD("RESET_PASSWORD"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), + + DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), + + DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), + + MUTED_ISSUE("MUTED_ISSUE"), + + GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), + + ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), + + DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), + + MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), + + END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); + + private final String value; + + EventTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..4b5378e7c --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..d0ae09826 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> file; + + private final Optional> folder; + + private final Optional> drive; + + private final Optional> group; + + private final Optional> user; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> file, + Optional> folder, + Optional> drive, + Optional> group, + Optional> user, + Map additionalProperties) { + this.file = file; + this.folder = folder; + this.drive = drive; + this.group = group; + this.user = user; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("File") + public Optional> getFile() { + return file; + } + + @JsonProperty("Folder") + public Optional> getFolder() { + return folder; + } + + @JsonProperty("Drive") + public Optional> getDrive() { + return drive; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return file.equals(other.file) + && folder.equals(other.folder) + && drive.equals(other.drive) + && group.equals(other.group) + && user.equals(other.user); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> file = Optional.empty(); + + private Optional> folder = Optional.empty(); + + private Optional> drive = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> user = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + file(other.getFile()); + folder(other.getFolder()); + drive(other.getDrive()); + group(other.getGroup()); + user(other.getUser()); + return this; + } + + @JsonSetter(value = "File", nulls = Nulls.SKIP) + public Builder file(Optional> file) { + this.file = file; + return this; + } + + public Builder file(List file) { + this.file = Optional.ofNullable(file); + return this; + } + + @JsonSetter(value = "Folder", nulls = Nulls.SKIP) + public Builder folder(Optional> folder) { + this.folder = folder; + return this; + } + + public Builder folder(List folder) { + this.folder = Optional.ofNullable(folder); + return this; + } + + @JsonSetter(value = "Drive", nulls = Nulls.SKIP) + public Builder drive(Optional> drive) { + this.drive = drive; + return this; + } + + public Builder drive(List drive) { + this.drive = Optional.ofNullable(drive); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse(file, folder, drive, group, user, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..9cdf36de8 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..03ff4fc79 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..14df13139 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..adc5ec878 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> file; + + private final Optional> folder; + + private final Optional> drive; + + private final Optional> group; + + private final Optional> user; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> file, + Optional> folder, + Optional> drive, + Optional> group, + Optional> user, + Map additionalProperties) { + this.file = file; + this.folder = folder; + this.drive = drive; + this.group = group; + this.user = user; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("File") + public Optional> getFile() { + return file; + } + + @JsonProperty("Folder") + public Optional> getFolder() { + return folder; + } + + @JsonProperty("Drive") + public Optional> getDrive() { + return drive; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return file.equals(other.file) + && folder.equals(other.folder) + && drive.equals(other.drive) + && group.equals(other.group) + && user.equals(other.user); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> file = Optional.empty(); + + private Optional> folder = Optional.empty(); + + private Optional> drive = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> user = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + file(other.getFile()); + folder(other.getFolder()); + drive(other.getDrive()); + group(other.getGroup()); + user(other.getUser()); + return this; + } + + @JsonSetter(value = "File", nulls = Nulls.SKIP) + public Builder file(Optional> file) { + this.file = file; + return this; + } + + public Builder file(List file) { + this.file = Optional.ofNullable(file); + return this; + } + + @JsonSetter(value = "Folder", nulls = Nulls.SKIP) + public Builder folder(Optional> folder) { + this.folder = folder; + return this; + } + + public Builder folder(List folder) { + this.folder = Optional.ofNullable(folder); + return this; + } + + @JsonSetter(value = "Drive", nulls = Nulls.SKIP) + public Builder drive(Optional> drive) { + this.drive = drive; + return this; + } + + public Builder drive(List drive) { + this.drive = Optional.ofNullable(drive); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse(file, folder, drive, group, user, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..a7550a009 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..e3f6f8e32 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingInstanceResponse.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..87f7e26ef --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/filestorage/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..c3e803dc6 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/filestorage/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..0e4db2514 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/File.java b/src/main/java/com/merge/api/filestorage/types/File.java similarity index 99% rename from src/main/java/com/merge/api/resources/filestorage/types/File.java rename to src/main/java/com/merge/api/filestorage/types/File.java index a33712511..8913f8d97 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/File.java +++ b/src/main/java/com/merge/api/filestorage/types/File.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FileDrive.java b/src/main/java/com/merge/api/filestorage/types/FileDrive.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FileDrive.java rename to src/main/java/com/merge/api/filestorage/types/FileDrive.java index 65cd761c1..3ba627aab 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FileDrive.java +++ b/src/main/java/com/merge/api/filestorage/types/FileDrive.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FileDrive deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FileDrive deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FileFolder.java b/src/main/java/com/merge/api/filestorage/types/FileFolder.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FileFolder.java rename to src/main/java/com/merge/api/filestorage/types/FileFolder.java index db27a890b..d4a673fb3 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FileFolder.java +++ b/src/main/java/com/merge/api/filestorage/types/FileFolder.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FileFolder deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FileFolder deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FilePermissions.java b/src/main/java/com/merge/api/filestorage/types/FilePermissions.java similarity index 91% rename from src/main/java/com/merge/api/resources/filestorage/types/FilePermissions.java rename to src/main/java/com/merge/api/filestorage/types/FilePermissions.java index 09f4e5f6c..4dea58508 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FilePermissions.java +++ b/src/main/java/com/merge/api/filestorage/types/FilePermissions.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -31,11 +31,12 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((PermissionRequest) this.value); + return visitor.visit((Permission) this.value); } else if (this.type == 2) { return visitor.visit((List) this.value); } @@ -66,7 +67,7 @@ public static FilePermissions of(String value) { return new FilePermissions(value, 0); } - public static FilePermissions of(PermissionRequest value) { + public static FilePermissions of(Permission value) { return new FilePermissions(value, 1); } @@ -77,7 +78,7 @@ public static FilePermissions of(List value) { public interface Visitor { T visit(String value); - T visit(PermissionRequest value); + T visit(Permission value); T visit(List value); } @@ -88,14 +89,14 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FilePermissions deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FilePermissions deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (IllegalArgumentException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PermissionRequest.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Permission.class)); } catch (IllegalArgumentException e) { } try { diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FilePermissionsItem.java b/src/main/java/com/merge/api/filestorage/types/FilePermissionsItem.java similarity index 89% rename from src/main/java/com/merge/api/resources/filestorage/types/FilePermissionsItem.java rename to src/main/java/com/merge/api/filestorage/types/FilePermissionsItem.java index eb2f9519c..5fcceda4f 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FilePermissionsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/FilePermissionsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,11 +29,12 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((PermissionRequest) this.value); + return visitor.visit((Permission) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -62,14 +63,14 @@ public static FilePermissionsItem of(String value) { return new FilePermissionsItem(value, 0); } - public static FilePermissionsItem of(PermissionRequest value) { + public static FilePermissionsItem of(Permission value) { return new FilePermissionsItem(value, 1); } public interface Visitor { T visit(String value); - T visit(PermissionRequest value); + T visit(Permission value); } static final class Deserializer extends StdDeserializer { @@ -78,14 +79,14 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FilePermissionsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FilePermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (IllegalArgumentException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PermissionRequest.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Permission.class)); } catch (IllegalArgumentException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FileRequest.java b/src/main/java/com/merge/api/filestorage/types/FileRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/filestorage/types/FileRequest.java rename to src/main/java/com/merge/api/filestorage/types/FileRequest.java index 396483ee1..39aaa69ed 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FileRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestDrive.java b/src/main/java/com/merge/api/filestorage/types/FileRequestDrive.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FileRequestDrive.java rename to src/main/java/com/merge/api/filestorage/types/FileRequestDrive.java index 73b1cf4ac..105eec4f3 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestDrive.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequestDrive.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FileRequestDrive deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FileRequestDrive deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestFolder.java b/src/main/java/com/merge/api/filestorage/types/FileRequestFolder.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FileRequestFolder.java rename to src/main/java/com/merge/api/filestorage/types/FileRequestFolder.java index 71ff18f25..f239bb8e4 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestFolder.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequestFolder.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FileRequestFolder deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FileRequestFolder deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestPermissions.java b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissions.java similarity index 96% rename from src/main/java/com/merge/api/resources/filestorage/types/FileRequestPermissions.java rename to src/main/java/com/merge/api/filestorage/types/FileRequestPermissions.java index cc36e0eeb..7ed5384e1 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestPermissions.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissions.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -31,6 +31,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -88,7 +89,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public FileRequestPermissions deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FileRequestPermissions deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestPermissionsItem.java b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FileRequestPermissionsItem.java rename to src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsItem.java index 0e281743b..eef669d92 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FileRequestPermissionsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer cursor; + + private final Optional includeDeletedData; + + private final Optional mimeType; + + private final Optional pageSize; + + private final Map additionalProperties; + + private FilesDownloadRequestMetaListRequest( + Optional cursor, + Optional includeDeletedData, + Optional mimeType, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.mimeType = mimeType; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return If provided, specifies the export format of the files to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. + */ + @JsonProperty("mime_type") + public Optional getMimeType() { + return mimeType; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FilesDownloadRequestMetaListRequest + && equalTo((FilesDownloadRequestMetaListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FilesDownloadRequestMetaListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && mimeType.equals(other.mimeType) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.includeDeletedData, this.mimeType, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional mimeType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FilesDownloadRequestMetaListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + mimeType(other.getMimeType()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "mime_type", nulls = Nulls.SKIP) + public Builder mimeType(Optional mimeType) { + this.mimeType = mimeType; + return this; + } + + public Builder mimeType(String mimeType) { + this.mimeType = Optional.ofNullable(mimeType); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public FilesDownloadRequestMetaListRequest build() { + return new FilesDownloadRequestMetaListRequest( + cursor, includeDeletedData, mimeType, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaRetrieveRequest.java new file mode 100644 index 000000000..a65d919f3 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaRetrieveRequest.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FilesDownloadRequestMetaRetrieveRequest.Builder.class) +public final class FilesDownloadRequestMetaRetrieveRequest { + private final Optional mimeType; + + private final Map additionalProperties; + + private FilesDownloadRequestMetaRetrieveRequest( + Optional mimeType, Map additionalProperties) { + this.mimeType = mimeType; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. + */ + @JsonProperty("mime_type") + public Optional getMimeType() { + return mimeType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FilesDownloadRequestMetaRetrieveRequest + && equalTo((FilesDownloadRequestMetaRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FilesDownloadRequestMetaRetrieveRequest other) { + return mimeType.equals(other.mimeType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mimeType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional mimeType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FilesDownloadRequestMetaRetrieveRequest other) { + mimeType(other.getMimeType()); + return this; + } + + @JsonSetter(value = "mime_type", nulls = Nulls.SKIP) + public Builder mimeType(Optional mimeType) { + this.mimeType = mimeType; + return this; + } + + public Builder mimeType(String mimeType) { + this.mimeType = Optional.ofNullable(mimeType); + return this; + } + + public FilesDownloadRequestMetaRetrieveRequest build() { + return new FilesDownloadRequestMetaRetrieveRequest(mimeType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FilesDownloadRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRetrieveRequest.java new file mode 100644 index 000000000..adbe6f25a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRetrieveRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FilesDownloadRetrieveRequest.Builder.class) +public final class FilesDownloadRetrieveRequest { + private final Optional includeShellData; + + private final Optional mimeType; + + private final Map additionalProperties; + + private FilesDownloadRetrieveRequest( + Optional includeShellData, Optional mimeType, Map additionalProperties) { + this.includeShellData = includeShellData; + this.mimeType = mimeType; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. + */ + @JsonProperty("mime_type") + public Optional getMimeType() { + return mimeType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FilesDownloadRetrieveRequest && equalTo((FilesDownloadRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FilesDownloadRetrieveRequest other) { + return includeShellData.equals(other.includeShellData) && mimeType.equals(other.mimeType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeShellData, this.mimeType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeShellData = Optional.empty(); + + private Optional mimeType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FilesDownloadRetrieveRequest other) { + includeShellData(other.getIncludeShellData()); + mimeType(other.getMimeType()); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "mime_type", nulls = Nulls.SKIP) + public Builder mimeType(Optional mimeType) { + this.mimeType = mimeType; + return this; + } + + public Builder mimeType(String mimeType) { + this.mimeType = Optional.ofNullable(mimeType); + return this; + } + + public FilesDownloadRetrieveRequest build() { + return new FilesDownloadRetrieveRequest(includeShellData, mimeType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesListRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/files/requests/FilesListRequest.java rename to src/main/java/com/merge/api/filestorage/types/FilesListRequest.java index 486716aa1..abe6f9ac2 100644 --- a/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.files.requests; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.files.types.FilesListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = FilesListRequest.Builder.class) public final class FilesListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -30,8 +33,6 @@ public final class FilesListRequest { private final Optional driveId; - private final Optional expand; - private final Optional folderId; private final Optional includeDeletedData; @@ -55,11 +56,11 @@ public final class FilesListRequest { private final Map additionalProperties; private FilesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional driveId, - Optional expand, Optional folderId, Optional includeDeletedData, Optional includeRemoteData, @@ -71,11 +72,11 @@ private FilesListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.driveId = driveId; - this.expand = expand; this.folderId = folderId; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; @@ -89,6 +90,14 @@ private FilesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -121,14 +130,6 @@ public Optional getDriveId() { return driveId; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Specifying a folder id returns only the files in that folder. Specifying null returns only the files in root directory. */ @@ -221,11 +222,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(FilesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && driveId.equals(other.driveId) - && expand.equals(other.expand) && folderId.equals(other.folderId) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) @@ -241,11 +242,11 @@ private boolean equalTo(FilesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.driveId, - this.expand, this.folderId, this.includeDeletedData, this.includeRemoteData, @@ -269,6 +270,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -277,8 +280,6 @@ public static final class Builder { private Optional driveId = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional folderId = Optional.empty(); private Optional includeDeletedData = Optional.empty(); @@ -305,11 +306,11 @@ public static final class Builder { private Builder() {} public Builder from(FilesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); driveId(other.getDriveId()); - expand(other.getExpand()); folderId(other.getFolderId()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); @@ -323,6 +324,22 @@ public Builder from(FilesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(FilesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -367,17 +384,6 @@ public Builder driveId(String driveId) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(FilesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "folder_id", nulls = Nulls.SKIP) public Builder folderId(Optional folderId) { this.folderId = folderId; @@ -490,11 +496,11 @@ public Builder remoteId(String remoteId) { public FilesListRequest build() { return new FilesListRequest( + expand, createdAfter, createdBefore, cursor, driveId, - expand, folderId, includeDeletedData, includeRemoteData, diff --git a/src/main/java/com/merge/api/filestorage/types/FilesListRequestExpandItem.java b/src/main/java/com/merge/api/filestorage/types/FilesListRequestExpandItem.java new file mode 100644 index 000000000..e68a4dea7 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FilesListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FilesListRequestExpandItem { + DRIVE("drive"), + + FOLDER("folder"), + + PERMISSIONS("permissions"); + + private final String value; + + FilesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FilesRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesRetrieveRequest.java new file mode 100644 index 000000000..ac186bd0e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FilesRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FilesRetrieveRequest.Builder.class) +public final class FilesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private FilesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FilesRetrieveRequest && equalTo((FilesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FilesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FilesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(FilesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public FilesRetrieveRequest build() { + return new FilesRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FilesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/filestorage/types/FilesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..ee08c7733 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FilesRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FilesRetrieveRequestExpandItem { + DRIVE("drive"), + + FOLDER("folder"), + + PERMISSIONS("permissions"); + + private final String value; + + FilesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/Folder.java b/src/main/java/com/merge/api/filestorage/types/Folder.java similarity index 99% rename from src/main/java/com/merge/api/resources/filestorage/types/Folder.java rename to src/main/java/com/merge/api/filestorage/types/Folder.java index dc528a05d..8d607ed9c 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/Folder.java +++ b/src/main/java/com/merge/api/filestorage/types/Folder.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FolderDrive.java b/src/main/java/com/merge/api/filestorage/types/FolderDrive.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FolderDrive.java rename to src/main/java/com/merge/api/filestorage/types/FolderDrive.java index a3cbb80f9..2aa0402d8 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FolderDrive.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderDrive.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FolderDrive deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FolderDrive deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FolderParentFolder.java b/src/main/java/com/merge/api/filestorage/types/FolderParentFolder.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FolderParentFolder.java rename to src/main/java/com/merge/api/filestorage/types/FolderParentFolder.java index 5d5951072..8d0c4c065 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FolderParentFolder.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderParentFolder.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FolderParentFolder deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FolderParentFolder deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FolderPermissions.java b/src/main/java/com/merge/api/filestorage/types/FolderPermissions.java similarity index 91% rename from src/main/java/com/merge/api/resources/filestorage/types/FolderPermissions.java rename to src/main/java/com/merge/api/filestorage/types/FolderPermissions.java index e218bd1fb..c6204e594 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FolderPermissions.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderPermissions.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -31,11 +31,12 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((PermissionRequest) this.value); + return visitor.visit((Permission) this.value); } else if (this.type == 2) { return visitor.visit((List) this.value); } @@ -66,7 +67,7 @@ public static FolderPermissions of(String value) { return new FolderPermissions(value, 0); } - public static FolderPermissions of(PermissionRequest value) { + public static FolderPermissions of(Permission value) { return new FolderPermissions(value, 1); } @@ -77,7 +78,7 @@ public static FolderPermissions of(List value) { public interface Visitor { T visit(String value); - T visit(PermissionRequest value); + T visit(Permission value); T visit(List value); } @@ -88,14 +89,14 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FolderPermissions deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FolderPermissions deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (IllegalArgumentException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PermissionRequest.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Permission.class)); } catch (IllegalArgumentException e) { } try { diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FolderPermissionsItem.java b/src/main/java/com/merge/api/filestorage/types/FolderPermissionsItem.java similarity index 89% rename from src/main/java/com/merge/api/resources/filestorage/types/FolderPermissionsItem.java rename to src/main/java/com/merge/api/filestorage/types/FolderPermissionsItem.java index 29d78fa26..4d8ada40f 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FolderPermissionsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderPermissionsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,11 +29,12 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((PermissionRequest) this.value); + return visitor.visit((Permission) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -62,14 +63,14 @@ public static FolderPermissionsItem of(String value) { return new FolderPermissionsItem(value, 0); } - public static FolderPermissionsItem of(PermissionRequest value) { + public static FolderPermissionsItem of(Permission value) { return new FolderPermissionsItem(value, 1); } public interface Visitor { T visit(String value); - T visit(PermissionRequest value); + T visit(Permission value); } static final class Deserializer extends StdDeserializer { @@ -78,14 +79,14 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FolderPermissionsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FolderPermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (IllegalArgumentException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PermissionRequest.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Permission.class)); } catch (IllegalArgumentException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FolderRequest.java b/src/main/java/com/merge/api/filestorage/types/FolderRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/filestorage/types/FolderRequest.java rename to src/main/java/com/merge/api/filestorage/types/FolderRequest.java index 5c1dc2c7f..eea23d03d 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FolderRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FolderRequestDrive.java b/src/main/java/com/merge/api/filestorage/types/FolderRequestDrive.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FolderRequestDrive.java rename to src/main/java/com/merge/api/filestorage/types/FolderRequestDrive.java index 487981030..29f440ac9 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FolderRequestDrive.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderRequestDrive.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public FolderRequestDrive deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public FolderRequestDrive deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FolderRequestParentFolder.java b/src/main/java/com/merge/api/filestorage/types/FolderRequestParentFolder.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/FolderRequestParentFolder.java rename to src/main/java/com/merge/api/filestorage/types/FolderRequestParentFolder.java index c70e803bd..da4748460 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/FolderRequestParentFolder.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderRequestParentFolder.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -88,7 +89,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -30,8 +33,6 @@ public final class FoldersListRequest { private final Optional driveId; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -53,11 +54,11 @@ public final class FoldersListRequest { private final Map additionalProperties; private FoldersListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional driveId, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -68,11 +69,11 @@ private FoldersListRequest( Optional parentFolderId, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.driveId = driveId; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -85,6 +86,14 @@ private FoldersListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -117,14 +126,6 @@ public Optional getDriveId() { return driveId; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -209,11 +210,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(FoldersListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && driveId.equals(other.driveId) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -228,11 +229,11 @@ private boolean equalTo(FoldersListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.driveId, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -255,6 +256,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -263,8 +266,6 @@ public static final class Builder { private Optional driveId = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -289,11 +290,11 @@ public static final class Builder { private Builder() {} public Builder from(FoldersListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); driveId(other.getDriveId()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -306,6 +307,22 @@ public Builder from(FoldersListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(FoldersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -350,17 +367,6 @@ public Builder driveId(String driveId) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(FoldersListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -462,11 +468,11 @@ public Builder remoteId(String remoteId) { public FoldersListRequest build() { return new FoldersListRequest( + expand, createdAfter, createdBefore, cursor, driveId, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/filestorage/types/FoldersListRequestExpandItem.java b/src/main/java/com/merge/api/filestorage/types/FoldersListRequestExpandItem.java new file mode 100644 index 000000000..757c08fcb --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FoldersListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FoldersListRequestExpandItem { + DRIVE("drive"), + + PARENT_FOLDER("parent_folder"), + + PERMISSIONS("permissions"); + + private final String value; + + FoldersListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FoldersRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/FoldersRetrieveRequest.java new file mode 100644 index 000000000..c0deea910 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FoldersRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FoldersRetrieveRequest.Builder.class) +public final class FoldersRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private FoldersRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersRetrieveRequest && equalTo((FoldersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FoldersRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(FoldersRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public FoldersRetrieveRequest build() { + return new FoldersRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/FoldersRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/filestorage/types/FoldersRetrieveRequestExpandItem.java new file mode 100644 index 000000000..f8aad1763 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FoldersRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FoldersRetrieveRequestExpandItem { + DRIVE("drive"), + + PARENT_FOLDER("parent_folder"), + + PERMISSIONS("permissions"); + + private final String value; + + FoldersRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/filestorage/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..874f253c1 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/Group.java b/src/main/java/com/merge/api/filestorage/types/Group.java new file mode 100644 index 000000000..0174e679c --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/Group.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Group.Builder.class) +public final class Group { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final List users; + + private final Optional> childGroups; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Group( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + List users, + Optional> childGroups, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.users = users; + this.childGroups = childGroups; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The group's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The users that belong in the group. If null, this typically means it's either a domain or the third-party platform does not surface this information. + */ + @JsonProperty("users") + public List getUsers() { + return users; + } + + /** + * @return Groups that inherit the permissions of the parent group. + */ + @JsonProperty("child_groups") + public Optional> getChildGroups() { + return childGroups; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Group && equalTo((Group) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Group other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && users.equals(other.users) + && childGroups.equals(other.childGroups) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.users, + this.childGroups, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private List users = new ArrayList<>(); + + private Optional> childGroups = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Group other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + users(other.getUsers()); + childGroups(other.getChildGroups()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "users", nulls = Nulls.SKIP) + public Builder users(List users) { + this.users.clear(); + this.users.addAll(users); + return this; + } + + public Builder addUsers(String users) { + this.users.add(users); + return this; + } + + public Builder addAllUsers(List users) { + this.users.addAll(users); + return this; + } + + @JsonSetter(value = "child_groups", nulls = Nulls.SKIP) + public Builder childGroups(Optional> childGroups) { + this.childGroups = childGroups; + return this; + } + + public Builder childGroups(List childGroups) { + this.childGroups = Optional.ofNullable(childGroups); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Group build() { + return new Group( + id, + remoteId, + createdAt, + modifiedAt, + name, + users, + childGroups, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/GroupChildGroupsItem.java b/src/main/java/com/merge/api/filestorage/types/GroupChildGroupsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/GroupChildGroupsItem.java rename to src/main/java/com/merge/api/filestorage/types/GroupChildGroupsItem.java index ae72f8b88..43238fc44 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/GroupChildGroupsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/GroupChildGroupsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public GroupChildGroupsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public GroupChildGroupsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java b/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java new file mode 100644 index 000000000..6b1df020e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java @@ -0,0 +1,401 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsListRequest.Builder.class) +public final class GroupsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private GroupsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsListRequest && equalTo((GroupsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(GroupsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public GroupsListRequest build() { + return new GroupsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/GroupsListRequestExpandItem.java b/src/main/java/com/merge/api/filestorage/types/GroupsListRequestExpandItem.java new file mode 100644 index 000000000..5b28a4b5a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/GroupsListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GroupsListRequestExpandItem { + CHILD_GROUPS("child_groups"), + + USERS("users"); + + private final String value; + + GroupsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/GroupsRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/GroupsRetrieveRequest.java new file mode 100644 index 000000000..d3f281a10 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/GroupsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsRetrieveRequest.Builder.class) +public final class GroupsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private GroupsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsRetrieveRequest && equalTo((GroupsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(GroupsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public GroupsRetrieveRequest build() { + return new GroupsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/GroupsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/filestorage/types/GroupsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..f7f6e315e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/GroupsRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GroupsRetrieveRequestExpandItem { + CHILD_GROUPS("child_groups"), + + USERS("users"); + + private final String value; + + GroupsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/filestorage/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..f888a0e0a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..9d4337c77 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/Issue.java b/src/main/java/com/merge/api/filestorage/types/Issue.java new file mode 100644 index 000000000..e6f8f6343 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/Issue.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage status(Optional status); + + _FinalStage status(IssueStatusEnum status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

+ *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/IssueStatusEnum.java b/src/main/java/com/merge/api/filestorage/types/IssueStatusEnum.java new file mode 100644 index 000000000..17143bd98 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssueStatusEnum { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssueStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java b/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java new file mode 100644 index 000000000..ed26e389b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/filestorage/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..4ef49ea2e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssuesListRequestStatus { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssuesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/LanguageEnum.java b/src/main/java/com/merge/api/filestorage/types/LanguageEnum.java new file mode 100644 index 000000000..22b293bca --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LanguageEnum { + EN("en"), + + DE("de"); + + private final String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/LastSyncResultEnum.java b/src/main/java/com/merge/api/filestorage/types/LastSyncResultEnum.java new file mode 100644 index 000000000..b99cbf70a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/LastSyncResultEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LastSyncResultEnum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + LastSyncResultEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/LinkToken.java b/src/main/java/com/merge/api/filestorage/types/LinkToken.java new file mode 100644 index 000000000..8560a2a7b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/LinkToken.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkToken.Builder.class) +public final class LinkToken { + private final String linkToken; + + private final Optional integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/filestorage/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..90b6cd840 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/filestorage/types/LinkedAccountStatus.java new file mode 100644 index 000000000..8bd813702 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/LinkedAccountStatus.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) +public final class LinkedAccountStatus { + private final String linkedAccountStatus; + + private final boolean canMakeRequest; + + private final Map additionalProperties; + + private LinkedAccountStatus( + String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { + this.linkedAccountStatus = linkedAccountStatus; + this.canMakeRequest = canMakeRequest; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_status") + public String getLinkedAccountStatus() { + return linkedAccountStatus; + } + + @JsonProperty("can_make_request") + public boolean getCanMakeRequest() { + return canMakeRequest; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountStatus other) { + return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountStatusStage builder() { + return new Builder(); + } + + public interface LinkedAccountStatusStage { + CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); + + Builder from(LinkedAccountStatus other); + } + + public interface CanMakeRequestStage { + _FinalStage canMakeRequest(boolean canMakeRequest); + } + + public interface _FinalStage { + LinkedAccountStatus build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { + private String linkedAccountStatus; + + private boolean canMakeRequest; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @java.lang.Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @java.lang.Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..37e161b40 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java @@ -0,0 +1,457 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing + *
    + *
  • hris - hris
  • + *
  • ats - ats
  • + *
  • accounting - accounting
  • + *
  • ticketing - ticketing
  • + *
  • crm - crm
  • + *
  • mktg - mktg
  • + *
  • filestorage - filestorage
  • + *
+ */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..fa3a75ceb --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LinkedAccountsListRequestCategory { + ACCOUNTING("accounting"), + + ATS("ats"), + + CRM("crm"), + + FILESTORAGE("filestorage"), + + HRIS("hris"), + + MKTG("mktg"), + + TICKETING("ticketing"); + + private final String value; + + LinkedAccountsListRequestCategory(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/MetaResponse.java b/src/main/java/com/merge/api/filestorage/types/MetaResponse.java new file mode 100644 index 000000000..73e1e3f5a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/MetaResponse.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MetaResponse.Builder.class) +public final class MetaResponse { + private final Map requestSchema; + + private final Optional> remoteFieldClasses; + + private final Optional status; + + private final boolean hasConditionalParams; + + private final boolean hasRequiredLinkedAccountParams; + + private final Map additionalProperties; + + private MetaResponse( + Map requestSchema, + Optional> remoteFieldClasses, + Optional status, + boolean hasConditionalParams, + boolean hasRequiredLinkedAccountParams, + Map additionalProperties) { + this.requestSchema = requestSchema; + this.remoteFieldClasses = remoteFieldClasses; + this.status = status; + this.hasConditionalParams = hasConditionalParams; + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("request_schema") + public Map getRequestSchema() { + return requestSchema; + } + + @JsonProperty("remote_field_classes") + public Optional> getRemoteFieldClasses() { + return remoteFieldClasses; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("has_conditional_params") + public boolean getHasConditionalParams() { + return hasConditionalParams; + } + + @JsonProperty("has_required_linked_account_params") + public boolean getHasRequiredLinkedAccountParams() { + return hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MetaResponse && equalTo((MetaResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MetaResponse other) { + return requestSchema.equals(other.requestSchema) + && remoteFieldClasses.equals(other.remoteFieldClasses) + && status.equals(other.status) + && hasConditionalParams == other.hasConditionalParams + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasConditionalParamsStage builder() { + return new Builder(); + } + + public interface HasConditionalParamsStage { + HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); + + Builder from(MetaResponse other); + } + + public interface HasRequiredLinkedAccountParamsStage { + _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); + } + + public interface _FinalStage { + MetaResponse build(); + + _FinalStage requestSchema(Map requestSchema); + + _FinalStage putAllRequestSchema(Map requestSchema); + + _FinalStage requestSchema(String key, JsonNode value); + + _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); + + _FinalStage remoteFieldClasses(Map remoteFieldClasses); + + _FinalStage status(Optional status); + + _FinalStage status(LinkedAccountStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { + private boolean hasConditionalParams; + + private boolean hasRequiredLinkedAccountParams; + + private Optional status = Optional.empty(); + + private Optional> remoteFieldClasses = Optional.empty(); + + private Map requestSchema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @java.lang.Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @java.lang.Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @java.lang.Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @java.lang.Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/MethodEnum.java b/src/main/java/com/merge/api/filestorage/types/MethodEnum.java new file mode 100644 index 000000000..6fdda9c07 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MethodEnum { + GET("GET"), + + OPTIONS("OPTIONS"), + + HEAD("HEAD"), + + POST("POST"), + + PUT("PUT"), + + PATCH("PATCH"), + + DELETE("DELETE"); + + private final String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ModelOperation.java b/src/main/java/com/merge/api/filestorage/types/ModelOperation.java new file mode 100644 index 000000000..4576c5235 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ModelOperation.java @@ -0,0 +1,226 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/filestorage/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..7d191138d --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/filestorage/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..b4ee93b23 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/filestorage/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..4964b82b9 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/MultipartFormFieldRequest.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(EncodingEnum encoding); + + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

The name of the form field

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

The data for the form field.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

The MIME type of the file, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

The file name of the form field, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

The encoding of the value of data. Defaults to RAW if not defined.

+ *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(EncodingEnum encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..698ea4134 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..90aed02de --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedDownloadRequestMetaList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedDownloadRequestMetaList.java new file mode 100644 index 000000000..a5bc052ff --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedDownloadRequestMetaList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedDownloadRequestMetaList.Builder.class) +public final class PaginatedDownloadRequestMetaList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedDownloadRequestMetaList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedDownloadRequestMetaList && equalTo((PaginatedDownloadRequestMetaList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedDownloadRequestMetaList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedDownloadRequestMetaList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedDownloadRequestMetaList build() { + return new PaginatedDownloadRequestMetaList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedDriveList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedDriveList.java similarity index 98% rename from src/main/java/com/merge/api/resources/filestorage/types/PaginatedDriveList.java rename to src/main/java/com/merge/api/filestorage/types/PaginatedDriveList.java index 030ecf685..9e25c40cc 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedDriveList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedDriveList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedFileList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedFileList.java similarity index 98% rename from src/main/java/com/merge/api/resources/filestorage/types/PaginatedFileList.java rename to src/main/java/com/merge/api/filestorage/types/PaginatedFileList.java index 904e23c88..0b7b17bee 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedFileList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedFileList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedFolderList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedFolderList.java similarity index 98% rename from src/main/java/com/merge/api/resources/filestorage/types/PaginatedFolderList.java rename to src/main/java/com/merge/api/filestorage/types/PaginatedFolderList.java index d8e40774d..45f5e4569 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedFolderList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedFolderList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedGroupList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedGroupList.java new file mode 100644 index 000000000..60fd62ba8 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedGroupList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedGroupList.Builder.class) +public final class PaginatedGroupList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedGroupList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedGroupList && equalTo((PaginatedGroupList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedGroupList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedGroupList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedGroupList build() { + return new PaginatedGroupList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedIssueList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedIssueList.java new file mode 100644 index 000000000..89f80cc5d --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..b4097e613 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedUserList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedUserList.java new file mode 100644 index 000000000..e8a60f078 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedUserList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedUserList.Builder.class) +public final class PaginatedUserList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedUserList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedUserList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedUserList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedUserList build() { + return new PaginatedUserList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/filestorage/types/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..4467d4226 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/PatchedEditFieldMappingRequest.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) +public final class PatchedEditFieldMappingRequest { + private final Optional> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Map additionalProperties) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + return this; + } + + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/Permission.java b/src/main/java/com/merge/api/filestorage/types/Permission.java similarity index 91% rename from src/main/java/com/merge/api/resources/filestorage/types/Permission.java rename to src/main/java/com/merge/api/filestorage/types/Permission.java index add248c84..dc991e56f 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/Permission.java +++ b/src/main/java/com/merge/api/filestorage/types/Permission.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -34,9 +34,9 @@ public final class Permission { private final Optional group; - private final Optional type; + private final Optional type; - private final Optional>> roles; + private final Optional> roles; private final Map additionalProperties; @@ -47,8 +47,8 @@ private Permission( Optional modifiedAt, Optional user, Optional group, - Optional type, - Optional>> roles, + Optional type, + Optional> roles, Map additionalProperties) { this.id = id; this.remoteId = remoteId; @@ -116,7 +116,7 @@ public Optional getGroup() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -124,7 +124,7 @@ public Optional getType() { * @return The permissions that the user or group has for the File or Folder. It is possible for a user or group to have multiple roles, such as viewing & uploading. Possible values include: READ, WRITE, OWNER. In cases where there is no clear mapping, the original value passed through will be returned. */ @JsonProperty("roles") - public Optional>> getRoles() { + public Optional> getRoles() { return roles; } @@ -179,9 +179,9 @@ public static final class Builder { private Optional group = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); - private Optional>> roles = Optional.empty(); + private Optional> roles = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -267,23 +267,23 @@ public Builder group(PermissionGroup group) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(PermissionType type) { + public Builder type(TypeEnum type) { this.type = Optional.ofNullable(type); return this; } @JsonSetter(value = "roles", nulls = Nulls.SKIP) - public Builder roles(Optional>> roles) { + public Builder roles(Optional> roles) { this.roles = roles; return this; } - public Builder roles(List> roles) { + public Builder roles(List roles) { this.roles = Optional.ofNullable(roles); return this; } diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionGroup.java b/src/main/java/com/merge/api/filestorage/types/PermissionGroup.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/PermissionGroup.java rename to src/main/java/com/merge/api/filestorage/types/PermissionGroup.java index b6f6439d1..f49ca9073 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionGroup.java +++ b/src/main/java/com/merge/api/filestorage/types/PermissionGroup.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PermissionGroup deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PermissionGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequest.java b/src/main/java/com/merge/api/filestorage/types/PermissionRequest.java similarity index 90% rename from src/main/java/com/merge/api/resources/filestorage/types/PermissionRequest.java rename to src/main/java/com/merge/api/filestorage/types/PermissionRequest.java index aae51beb4..6f5aeaa6a 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/PermissionRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -28,9 +28,9 @@ public final class PermissionRequest { private final Optional group; - private final Optional type; + private final Optional type; - private final Optional>> roles; + private final Optional> roles; private final Optional> integrationParams; @@ -42,8 +42,8 @@ private PermissionRequest( Optional remoteId, Optional user, Optional group, - Optional type, - Optional>> roles, + Optional type, + Optional> roles, Optional> integrationParams, Optional> linkedAccountParams, Map additionalProperties) { @@ -91,7 +91,7 @@ public Optional getGroup() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -99,7 +99,7 @@ public Optional getType() { * @return The permissions that the user or group has for the File or Folder. It is possible for a user or group to have multiple roles, such as viewing & uploading. Possible values include: READ, WRITE, OWNER. In cases where there is no clear mapping, the original value passed through will be returned. */ @JsonProperty("roles") - public Optional>> getRoles() { + public Optional> getRoles() { return roles; } @@ -163,9 +163,9 @@ public static final class Builder { private Optional group = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); - private Optional>> roles = Optional.empty(); + private Optional> roles = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -221,23 +221,23 @@ public Builder group(PermissionRequestGroup group) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(PermissionRequestType type) { + public Builder type(TypeEnum type) { this.type = Optional.ofNullable(type); return this; } @JsonSetter(value = "roles", nulls = Nulls.SKIP) - public Builder roles(Optional>> roles) { + public Builder roles(Optional> roles) { this.roles = roles; return this; } - public Builder roles(List> roles) { + public Builder roles(List roles) { this.roles = Optional.ofNullable(roles); return this; } diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestGroup.java b/src/main/java/com/merge/api/filestorage/types/PermissionRequestGroup.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestGroup.java rename to src/main/java/com/merge/api/filestorage/types/PermissionRequestGroup.java index 61bd7d834..b0fd481a3 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestGroup.java +++ b/src/main/java/com/merge/api/filestorage/types/PermissionRequestGroup.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public PermissionRequestGroup deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PermissionRequestGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestUser.java b/src/main/java/com/merge/api/filestorage/types/PermissionRequestUser.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestUser.java rename to src/main/java/com/merge/api/filestorage/types/PermissionRequestUser.java index c87ae8ca2..048ea1c46 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestUser.java +++ b/src/main/java/com/merge/api/filestorage/types/PermissionRequestUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PermissionRequestUser deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PermissionRequestUser deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionUser.java b/src/main/java/com/merge/api/filestorage/types/PermissionUser.java similarity index 95% rename from src/main/java/com/merge/api/resources/filestorage/types/PermissionUser.java rename to src/main/java/com/merge/api/filestorage/types/PermissionUser.java index 1594302b2..3253b3642 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionUser.java +++ b/src/main/java/com/merge/api/filestorage/types/PermissionUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public PermissionUser deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public PermissionUser deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteData.java b/src/main/java/com/merge/api/filestorage/types/RemoteData.java new file mode 100644 index 000000000..e6560ce3b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteData.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

The third-party API path that is being called.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/filestorage/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..3a362acfd --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteEndpointInfo.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteFieldApi.java b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApi.java new file mode 100644 index 000000000..935ac11dd --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApi.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..437d9799e --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..adcd12898 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApiResponse.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> file; + + private final Optional> folder; + + private final Optional> drive; + + private final Optional> group; + + private final Optional> user; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> file, + Optional> folder, + Optional> drive, + Optional> group, + Optional> user, + Map additionalProperties) { + this.file = file; + this.folder = folder; + this.drive = drive; + this.group = group; + this.user = user; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("File") + public Optional> getFile() { + return file; + } + + @JsonProperty("Folder") + public Optional> getFolder() { + return folder; + } + + @JsonProperty("Drive") + public Optional> getDrive() { + return drive; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return file.equals(other.file) + && folder.equals(other.folder) + && drive.equals(other.drive) + && group.equals(other.group) + && user.equals(other.user); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> file = Optional.empty(); + + private Optional> folder = Optional.empty(); + + private Optional> drive = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> user = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + file(other.getFile()); + folder(other.getFolder()); + drive(other.getDrive()); + group(other.getGroup()); + user(other.getUser()); + return this; + } + + @JsonSetter(value = "File", nulls = Nulls.SKIP) + public Builder file(Optional> file) { + this.file = file; + return this; + } + + public Builder file(List file) { + this.file = Optional.ofNullable(file); + return this; + } + + @JsonSetter(value = "Folder", nulls = Nulls.SKIP) + public Builder folder(Optional> folder) { + this.folder = folder; + return this; + } + + public Builder folder(List folder) { + this.folder = Optional.ofNullable(folder); + return this; + } + + @JsonSetter(value = "Drive", nulls = Nulls.SKIP) + public Builder drive(Optional> drive) { + this.drive = drive; + return this; + } + + public Builder drive(List drive) { + this.drive = Optional.ofNullable(drive); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse(file, folder, drive, group, user, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..89f49ed07 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteKey.java b/src/main/java/com/merge/api/filestorage/types/RemoteKey.java new file mode 100644 index 000000000..0edfee3e2 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/filestorage/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..12f301a5c --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteResponse.java b/src/main/java/com/merge/api/filestorage/types/RemoteResponse.java new file mode 100644 index 000000000..2f1d2ae84 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(ResponseTypeEnum responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RequestFormatEnum.java b/src/main/java/com/merge/api/filestorage/types/RequestFormatEnum.java new file mode 100644 index 000000000..8955e4131 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RequestFormatEnum { + JSON("JSON"), + + XML("XML"), + + MULTIPART("MULTIPART"); + + private final String value; + + RequestFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/filestorage/types/ResponseTypeEnum.java new file mode 100644 index 000000000..bb651cbec --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ResponseTypeEnum { + JSON("JSON"), + + BASE_64_GZIP("BASE64_GZIP"); + + private final String value; + + ResponseTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RoleEnum.java b/src/main/java/com/merge/api/filestorage/types/RoleEnum.java new file mode 100644 index 000000000..206690563 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RoleEnum { + ADMIN("ADMIN"), + + DEVELOPER("DEVELOPER"), + + MEMBER("MEMBER"), + + API("API"), + + SYSTEM("SYSTEM"), + + MERGE_TEAM("MERGE_TEAM"); + + private final String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RolesEnum.java b/src/main/java/com/merge/api/filestorage/types/RolesEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/filestorage/types/RolesEnum.java rename to src/main/java/com/merge/api/filestorage/types/RolesEnum.java index b40bbc423..5117a0087 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/RolesEnum.java +++ b/src/main/java/com/merge/api/filestorage/types/RolesEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..38b3d47b0 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SelectiveSyncConfigurationsUsageEnum { + IN_NEXT_SYNC("IN_NEXT_SYNC"), + + IN_LAST_SYNC("IN_LAST_SYNC"); + + private final String value; + + SelectiveSyncConfigurationsUsageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/StatusFd5Enum.java b/src/main/java/com/merge/api/filestorage/types/StatusFd5Enum.java new file mode 100644 index 000000000..bbd9c12fa --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/StatusFd5Enum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum StatusFd5Enum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + StatusFd5Enum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/SyncStatus.java b/src/main/java/com/merge/api/filestorage/types/SyncStatus.java new file mode 100644 index 000000000..a03696390 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final StatusFd5Enum status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + StatusFd5Enum status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public StatusFd5Enum getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull StatusFd5Enum status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private StatusFd5Enum status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull StatusFd5Enum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/filestorage/types/SyncStatusListRequest.java new file mode 100644 index 000000000..f684233f5 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/SyncStatusListRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/TypeEnum.java b/src/main/java/com/merge/api/filestorage/types/TypeEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/filestorage/types/TypeEnum.java rename to src/main/java/com/merge/api/filestorage/types/TypeEnum.java index 5d9208342..dda1a661c 100644 --- a/src/main/java/com/merge/api/resources/filestorage/types/TypeEnum.java +++ b/src/main/java/com/merge/api/filestorage/types/TypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.filestorage.types; +package com.merge.api.filestorage.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/filestorage/types/User.java b/src/main/java/com/merge/api/filestorage/types/User.java new file mode 100644 index 000000000..5b9874aac --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/User.java @@ -0,0 +1,358 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = User.Builder.class) +public final class User { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional emailAddress; + + private final Optional isMe; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private User( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional emailAddress, + Optional isMe, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.emailAddress = emailAddress; + this.isMe = isMe; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The user's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The user's email address. This is typically used to identify a user across linked accounts. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return Whether the user is the one who linked this account. + */ + @JsonProperty("is_me") + public Optional getIsMe() { + return isMe; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof User && equalTo((User) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(User other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && emailAddress.equals(other.emailAddress) + && isMe.equals(other.isMe) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.emailAddress, + this.isMe, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional isMe = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(User other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + emailAddress(other.getEmailAddress()); + isMe(other.getIsMe()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "is_me", nulls = Nulls.SKIP) + public Builder isMe(Optional isMe) { + this.isMe = isMe; + return this; + } + + public Builder isMe(Boolean isMe) { + this.isMe = Optional.ofNullable(isMe); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public User build() { + return new User( + id, + remoteId, + createdAt, + modifiedAt, + name, + emailAddress, + isMe, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java b/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java new file mode 100644 index 000000000..1686b1d2b --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java @@ -0,0 +1,394 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersListRequest.Builder.class) +public final class UsersListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isMe; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private UsersListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isMe, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isMe = isMe; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return the user object for requestor. + */ + @JsonProperty("is_me") + public Optional getIsMe() { + return isMe; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListRequest && equalTo((UsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isMe.equals(other.isMe) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isMe, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isMe = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isMe(other.getIsMe()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "is_me", nulls = Nulls.SKIP) + public Builder isMe(Optional isMe) { + this.isMe = isMe; + return this; + } + + public Builder isMe(String isMe) { + this.isMe = Optional.ofNullable(isMe); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public UsersListRequest build() { + return new UsersListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isMe, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/UsersRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/UsersRetrieveRequest.java new file mode 100644 index 000000000..9c5da39b1 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/UsersRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) +public final class UsersRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private UsersRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public UsersRetrieveRequest build() { + return new UsersRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/ValidationProblemSource.java b/src/main/java/com/merge/api/filestorage/types/ValidationProblemSource.java new file mode 100644 index 000000000..0858f653d --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/ValidationProblemSource.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ValidationProblemSource.Builder.class) +public final class ValidationProblemSource { + private final String pointer; + + private final Map additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/WarningValidationProblem.java b/src/main/java/com/merge/api/filestorage/types/WarningValidationProblem.java new file mode 100644 index 000000000..73c320b97 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/WarningValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/WebhookReceiver.java b/src/main/java/com/merge/api/filestorage/types/WebhookReceiver.java new file mode 100644 index 000000000..e394b013a --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/filestorage/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..fd354c501 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/AccountDetailsClient.java b/src/main/java/com/merge/api/hris/AccountDetailsClient.java new file mode 100644 index 000000000..41c0e9012 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountDetails; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/AccountTokenClient.java b/src/main/java/com/merge/api/hris/AccountTokenClient.java new file mode 100644 index 000000000..175aa353b --- /dev/null +++ b/src/main/java/com/merge/api/hris/AccountTokenClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountToken; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/hris/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..6fbc4a901 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountDetails; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/hris/AsyncAccountTokenClient.java new file mode 100644 index 000000000..b22f0157e --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncAccountTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/hris/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..f68010daf --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AsyncPassthroughReciept; +import com.merge.api.hris.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.hris.types.DataPassthroughRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/hris/AsyncAuditTrailClient.java new file mode 100644 index 000000000..e56b79d33 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AuditLogEvent; +import com.merge.api.hris.types.AuditTrailListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/hris/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..a704ce883 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AvailableActions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncBankInfoClient.java b/src/main/java/com/merge/api/hris/AsyncBankInfoClient.java new file mode 100644 index 000000000..cb4d5c525 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncBankInfoClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.BankInfo; +import com.merge.api.hris.types.BankInfoListRequest; +import com.merge.api.hris.types.BankInfoRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncBankInfoClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBankInfoClient rawClient; + + public AsyncBankInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBankInfoClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBankInfoClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BankInfo objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of BankInfo objects. + */ + public CompletableFuture> list(BankInfoListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of BankInfo objects. + */ + public CompletableFuture> list( + BankInfoListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a BankInfo object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a BankInfo object with the given id. + */ + public CompletableFuture retrieve(String id, BankInfoRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a BankInfo object with the given id. + */ + public CompletableFuture retrieve( + String id, BankInfoRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncBenefitsClient.java b/src/main/java/com/merge/api/hris/AsyncBenefitsClient.java new file mode 100644 index 000000000..23c45188a --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncBenefitsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Benefit; +import com.merge.api.hris.types.BenefitsListRequest; +import com.merge.api.hris.types.BenefitsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncBenefitsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawBenefitsClient rawClient; + + public AsyncBenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawBenefitsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawBenefitsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Benefit objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Benefit objects. + */ + public CompletableFuture> list(BenefitsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Benefit objects. + */ + public CompletableFuture> list( + BenefitsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Benefit object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Benefit object with the given id. + */ + public CompletableFuture retrieve(String id, BenefitsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Benefit object with the given id. + */ + public CompletableFuture retrieve( + String id, BenefitsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncCompaniesClient.java b/src/main/java/com/merge/api/hris/AsyncCompaniesClient.java new file mode 100644 index 000000000..5e7bbd197 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncCompaniesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.CompaniesListRequest; +import com.merge.api.hris.types.CompaniesRetrieveRequest; +import com.merge.api.hris.types.Company; +import java.util.concurrent.CompletableFuture; + +public class AsyncCompaniesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCompaniesClient rawClient; + + public AsyncCompaniesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCompaniesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCompaniesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Company objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Company objects. + */ + public CompletableFuture> list(CompaniesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Company objects. + */ + public CompletableFuture> list( + CompaniesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Company object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Company object with the given id. + */ + public CompletableFuture retrieve(String id, CompaniesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Company object with the given id. + */ + public CompletableFuture retrieve( + String id, CompaniesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/hris/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..3c888981d --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncDependentsClient.java b/src/main/java/com/merge/api/hris/AsyncDependentsClient.java new file mode 100644 index 000000000..ce2cb2872 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncDependentsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Dependent; +import com.merge.api.hris.types.DependentsListRequest; +import com.merge.api.hris.types.DependentsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncDependentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDependentsClient rawClient; + + public AsyncDependentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDependentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDependentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Dependent objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Dependent objects. + */ + public CompletableFuture> list(DependentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Dependent objects. + */ + public CompletableFuture> list( + DependentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Dependent object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Dependent object with the given id. + */ + public CompletableFuture retrieve(String id, DependentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Dependent object with the given id. + */ + public CompletableFuture retrieve( + String id, DependentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncEmployeePayrollRunsClient.java b/src/main/java/com/merge/api/hris/AsyncEmployeePayrollRunsClient.java new file mode 100644 index 000000000..2a779566d --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncEmployeePayrollRunsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployeePayrollRun; +import com.merge.api.hris.types.EmployeePayrollRunsListRequest; +import com.merge.api.hris.types.EmployeePayrollRunsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncEmployeePayrollRunsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEmployeePayrollRunsClient rawClient; + + public AsyncEmployeePayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEmployeePayrollRunsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEmployeePayrollRunsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public CompletableFuture> list(EmployeePayrollRunsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public CompletableFuture> list( + EmployeePayrollRunsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public CompletableFuture retrieve(String id, EmployeePayrollRunsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public CompletableFuture retrieve( + String id, EmployeePayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncEmployeesClient.java b/src/main/java/com/merge/api/hris/AsyncEmployeesClient.java new file mode 100644 index 000000000..ab7d27e47 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncEmployeesClient.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employee; +import com.merge.api.hris.types.EmployeeEndpointRequest; +import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesListRequest; +import com.merge.api.hris.types.EmployeesRetrieveRequest; +import com.merge.api.hris.types.IgnoreCommonModelRequest; +import com.merge.api.hris.types.MetaResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncEmployeesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEmployeesClient rawClient; + + public AsyncEmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEmployeesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEmployeesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture> list(EmployeesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture> list( + EmployeesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Employee object with the given values. + */ + public CompletableFuture create(EmployeeEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Employee object with the given values. + */ + public CompletableFuture create(EmployeeEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture retrieve(String id, EmployeesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture retrieve( + String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Employee POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Employee POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncEmployerBenefitsClient.java b/src/main/java/com/merge/api/hris/AsyncEmployerBenefitsClient.java new file mode 100644 index 000000000..5204462ce --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncEmployerBenefitsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployerBenefit; +import com.merge.api.hris.types.EmployerBenefitsListRequest; +import com.merge.api.hris.types.EmployerBenefitsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncEmployerBenefitsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEmployerBenefitsClient rawClient; + + public AsyncEmployerBenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEmployerBenefitsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEmployerBenefitsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public CompletableFuture> list(EmployerBenefitsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public CompletableFuture> list( + EmployerBenefitsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public CompletableFuture retrieve(String id, EmployerBenefitsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public CompletableFuture retrieve( + String id, EmployerBenefitsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncEmploymentsClient.java b/src/main/java/com/merge/api/hris/AsyncEmploymentsClient.java new file mode 100644 index 000000000..e608eb230 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncEmploymentsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employment; +import com.merge.api.hris.types.EmploymentsListRequest; +import com.merge.api.hris.types.EmploymentsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncEmploymentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawEmploymentsClient rawClient; + + public AsyncEmploymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawEmploymentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawEmploymentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Employment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Employment objects. + */ + public CompletableFuture> list(EmploymentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Employment objects. + */ + public CompletableFuture> list( + EmploymentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Employment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Employment object with the given id. + */ + public CompletableFuture retrieve(String id, EmploymentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Employment object with the given id. + */ + public CompletableFuture retrieve( + String id, EmploymentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/hris/AsyncFieldMappingClient.java new file mode 100644 index 000000000..7d2b6f848 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncFieldMappingClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CreateFieldMappingRequest; +import com.merge.api.hris.types.ExternalTargetFieldApiResponse; +import com.merge.api.hris.types.FieldMappingApiInstanceResponse; +import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsRetrieveRequest; +import com.merge.api.hris.types.PatchedEditFieldMappingRequest; +import com.merge.api.hris.types.RemoteFieldApiResponse; +import com.merge.api.hris.types.RemoteFieldsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncForceResyncClient.java b/src/main/java/com/merge/api/hris/AsyncForceResyncClient.java new file mode 100644 index 000000000..6c4ccf5d3 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.SyncStatus; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/hris/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..e529229e7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.GenerateRemoteKeyRequest; +import com.merge.api.hris.types.RemoteKey; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncGroupsClient.java b/src/main/java/com/merge/api/hris/AsyncGroupsClient.java new file mode 100644 index 000000000..f08ada98f --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncGroupsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Group; +import com.merge.api.hris.types.GroupsListRequest; +import com.merge.api.hris.types.GroupsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncGroupsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGroupsClient rawClient; + + public AsyncGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncHrisClient.java b/src/main/java/com/merge/api/hris/AsyncHrisClient.java new file mode 100644 index 000000000..ac96dc28d --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncHrisClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncHrisClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier bankInfoClient; + + protected final Supplier benefitsClient; + + protected final Supplier companiesClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier dependentsClient; + + protected final Supplier employeePayrollRunsClient; + + protected final Supplier employeesClient; + + protected final Supplier employerBenefitsClient; + + protected final Supplier employmentsClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier groupsClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier locationsClient; + + protected final Supplier passthroughClient; + + protected final Supplier payGroupsClient; + + protected final Supplier payrollRunsClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier teamsClient; + + protected final Supplier timeOffClient; + + protected final Supplier timeOffBalancesClient; + + protected final Supplier timesheetEntriesClient; + + protected final Supplier webhookReceiversClient; + + public AsyncHrisClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.bankInfoClient = Suppliers.memoize(() -> new AsyncBankInfoClient(clientOptions)); + this.benefitsClient = Suppliers.memoize(() -> new AsyncBenefitsClient(clientOptions)); + this.companiesClient = Suppliers.memoize(() -> new AsyncCompaniesClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.dependentsClient = Suppliers.memoize(() -> new AsyncDependentsClient(clientOptions)); + this.employeePayrollRunsClient = Suppliers.memoize(() -> new AsyncEmployeePayrollRunsClient(clientOptions)); + this.employeesClient = Suppliers.memoize(() -> new AsyncEmployeesClient(clientOptions)); + this.employerBenefitsClient = Suppliers.memoize(() -> new AsyncEmployerBenefitsClient(clientOptions)); + this.employmentsClient = Suppliers.memoize(() -> new AsyncEmploymentsClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.groupsClient = Suppliers.memoize(() -> new AsyncGroupsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.locationsClient = Suppliers.memoize(() -> new AsyncLocationsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.payGroupsClient = Suppliers.memoize(() -> new AsyncPayGroupsClient(clientOptions)); + this.payrollRunsClient = Suppliers.memoize(() -> new AsyncPayrollRunsClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.teamsClient = Suppliers.memoize(() -> new AsyncTeamsClient(clientOptions)); + this.timeOffClient = Suppliers.memoize(() -> new AsyncTimeOffClient(clientOptions)); + this.timeOffBalancesClient = Suppliers.memoize(() -> new AsyncTimeOffBalancesClient(clientOptions)); + this.timesheetEntriesClient = Suppliers.memoize(() -> new AsyncTimesheetEntriesClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncBankInfoClient bankInfo() { + return this.bankInfoClient.get(); + } + + public AsyncBenefitsClient benefits() { + return this.benefitsClient.get(); + } + + public AsyncCompaniesClient companies() { + return this.companiesClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncDependentsClient dependents() { + return this.dependentsClient.get(); + } + + public AsyncEmployeePayrollRunsClient employeePayrollRuns() { + return this.employeePayrollRunsClient.get(); + } + + public AsyncEmployeesClient employees() { + return this.employeesClient.get(); + } + + public AsyncEmployerBenefitsClient employerBenefits() { + return this.employerBenefitsClient.get(); + } + + public AsyncEmploymentsClient employments() { + return this.employmentsClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncGroupsClient groups() { + return this.groupsClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncLocationsClient locations() { + return this.locationsClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncPayGroupsClient payGroups() { + return this.payGroupsClient.get(); + } + + public AsyncPayrollRunsClient payrollRuns() { + return this.payrollRunsClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncTeamsClient teams() { + return this.teamsClient.get(); + } + + public AsyncTimeOffClient timeOff() { + return this.timeOffClient.get(); + } + + public AsyncTimeOffBalancesClient timeOffBalances() { + return this.timeOffBalancesClient.get(); + } + + public AsyncTimesheetEntriesClient timesheetEntries() { + return this.timesheetEntriesClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncIssuesClient.java b/src/main/java/com/merge/api/hris/AsyncIssuesClient.java new file mode 100644 index 000000000..aba84a1c1 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Issue; +import com.merge.api.hris.types.IssuesListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/hris/AsyncLinkTokenClient.java new file mode 100644 index 000000000..f2ebd7ba7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.EndUserDetailsRequest; +import com.merge.api.hris.types.LinkToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/hris/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..f0a72db23 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AccountDetailsAndActions; +import com.merge.api.hris.types.LinkedAccountsListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncLocationsClient.java b/src/main/java/com/merge/api/hris/AsyncLocationsClient.java new file mode 100644 index 000000000..06ab90591 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncLocationsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Location; +import com.merge.api.hris.types.LocationsListRequest; +import com.merge.api.hris.types.LocationsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncLocationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLocationsClient rawClient; + + public AsyncLocationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLocationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLocationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Location objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Location objects. + */ + public CompletableFuture> list(LocationsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Location objects. + */ + public CompletableFuture> list( + LocationsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Location object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Location object with the given id. + */ + public CompletableFuture retrieve(String id, LocationsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Location object with the given id. + */ + public CompletableFuture retrieve( + String id, LocationsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncPassthroughClient.java b/src/main/java/com/merge/api/hris/AsyncPassthroughClient.java new file mode 100644 index 000000000..a5623c8c1 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.DataPassthroughRequest; +import com.merge.api.hris.types.RemoteResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncPayGroupsClient.java b/src/main/java/com/merge/api/hris/AsyncPayGroupsClient.java new file mode 100644 index 000000000..ff3099f48 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncPayGroupsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PayGroup; +import com.merge.api.hris.types.PayGroupsListRequest; +import com.merge.api.hris.types.PayGroupsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncPayGroupsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPayGroupsClient rawClient; + + public AsyncPayGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPayGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPayGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PayGroup objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of PayGroup objects. + */ + public CompletableFuture> list(PayGroupsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of PayGroup objects. + */ + public CompletableFuture> list( + PayGroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a PayGroup object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a PayGroup object with the given id. + */ + public CompletableFuture retrieve(String id, PayGroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a PayGroup object with the given id. + */ + public CompletableFuture retrieve( + String id, PayGroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncPayrollRunsClient.java b/src/main/java/com/merge/api/hris/AsyncPayrollRunsClient.java new file mode 100644 index 000000000..fd1501d62 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncPayrollRunsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PayrollRun; +import com.merge.api.hris.types.PayrollRunsListRequest; +import com.merge.api.hris.types.PayrollRunsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncPayrollRunsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPayrollRunsClient rawClient; + + public AsyncPayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPayrollRunsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPayrollRunsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PayrollRun objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of PayrollRun objects. + */ + public CompletableFuture> list(PayrollRunsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of PayrollRun objects. + */ + public CompletableFuture> list( + PayrollRunsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public CompletableFuture retrieve(String id, PayrollRunsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public CompletableFuture retrieve( + String id, PayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..6622d0cac --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountDetails; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/hris/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..36a401330 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawAccountTokenClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..dfb81c48d --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AsyncPassthroughReciept; +import com.merge.api.hris.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.hris.types.DataPassthroughRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughReciept.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..fe41b8863 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AuditLogEvent; +import com.merge.api.hris.types.AuditTrailListRequest; +import com.merge.api.hris.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..089570ee4 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AvailableActions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java b/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java new file mode 100644 index 000000000..28c436fb7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.BankInfo; +import com.merge.api.hris.types.BankInfoListRequest; +import com.merge.api.hris.types.BankInfoRetrieveRequest; +import com.merge.api.hris.types.PaginatedBankInfoList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBankInfoClient { + protected final ClientOptions clientOptions; + + public AsyncRawBankInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BankInfo objects. + */ + public CompletableFuture>> list() { + return list(BankInfoListRequest.builder().build()); + } + + /** + * Returns a list of BankInfo objects. + */ + public CompletableFuture>> list(BankInfoListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BankInfo objects. + */ + public CompletableFuture>> list( + BankInfoListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/bank-info"); + if (request.getAccountType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_type", request.getAccountType().get().toString(), false); + } + if (request.getBankName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "bank_name", request.getBankName().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get().toString(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedBankInfoList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBankInfoList.class); + Optional startingAfter = parsedResponse.getNext(); + BankInfoListRequest nextRequest = BankInfoListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a BankInfo object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, BankInfoRetrieveRequest.builder().build()); + } + + /** + * Returns a BankInfo object with the given id. + */ + public CompletableFuture> retrieve(String id, BankInfoRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BankInfo object with the given id. + */ + public CompletableFuture> retrieve( + String id, BankInfoRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/bank-info") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankInfo.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java b/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java new file mode 100644 index 000000000..2cfa05fe6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java @@ -0,0 +1,262 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Benefit; +import com.merge.api.hris.types.BenefitsListRequest; +import com.merge.api.hris.types.BenefitsRetrieveRequest; +import com.merge.api.hris.types.PaginatedBenefitList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawBenefitsClient { + protected final ClientOptions clientOptions; + + public AsyncRawBenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Benefit objects. + */ + public CompletableFuture>> list() { + return list(BenefitsListRequest.builder().build()); + } + + /** + * Returns a list of Benefit objects. + */ + public CompletableFuture>> list(BenefitsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Benefit objects. + */ + public CompletableFuture>> list( + BenefitsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/benefits"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedBenefitList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBenefitList.class); + Optional startingAfter = parsedResponse.getNext(); + BenefitsListRequest nextRequest = BenefitsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Benefit object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, BenefitsRetrieveRequest.builder().build()); + } + + /** + * Returns a Benefit object with the given id. + */ + public CompletableFuture> retrieve(String id, BenefitsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Benefit object with the given id. + */ + public CompletableFuture> retrieve( + String id, BenefitsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/benefits") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Benefit.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java b/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java new file mode 100644 index 000000000..ecebc12b3 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.CompaniesListRequest; +import com.merge.api.hris.types.CompaniesRetrieveRequest; +import com.merge.api.hris.types.Company; +import com.merge.api.hris.types.PaginatedCompanyList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCompaniesClient { + protected final ClientOptions clientOptions; + + public AsyncRawCompaniesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Company objects. + */ + public CompletableFuture>> list() { + return list(CompaniesListRequest.builder().build()); + } + + /** + * Returns a list of Company objects. + */ + public CompletableFuture>> list(CompaniesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Company objects. + */ + public CompletableFuture>> list( + CompaniesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/companies"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCompanyList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCompanyList.class); + Optional startingAfter = parsedResponse.getNext(); + CompaniesListRequest nextRequest = CompaniesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Company object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CompaniesRetrieveRequest.builder().build()); + } + + /** + * Returns a Company object with the given id. + */ + public CompletableFuture> retrieve(String id, CompaniesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Company object with the given id. + */ + public CompletableFuture> retrieve( + String id, CompaniesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/companies") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Company.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..2f3fddc64 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java b/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java new file mode 100644 index 000000000..9a2e1c674 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java @@ -0,0 +1,264 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Dependent; +import com.merge.api.hris.types.DependentsListRequest; +import com.merge.api.hris.types.DependentsRetrieveRequest; +import com.merge.api.hris.types.PaginatedDependentList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDependentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawDependentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Dependent objects. + */ + public CompletableFuture>> list() { + return list(DependentsListRequest.builder().build()); + } + + /** + * Returns a list of Dependent objects. + */ + public CompletableFuture>> list(DependentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Dependent objects. + */ + public CompletableFuture>> list( + DependentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/dependents"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedDependentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedDependentList.class); + Optional startingAfter = parsedResponse.getNext(); + DependentsListRequest nextRequest = DependentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Dependent object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, DependentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Dependent object with the given id. + */ + public CompletableFuture> retrieve(String id, DependentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Dependent object with the given id. + */ + public CompletableFuture> retrieve( + String id, DependentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/dependents") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Dependent.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java new file mode 100644 index 000000000..f44635d78 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java @@ -0,0 +1,287 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployeePayrollRun; +import com.merge.api.hris.types.EmployeePayrollRunsListRequest; +import com.merge.api.hris.types.EmployeePayrollRunsRetrieveRequest; +import com.merge.api.hris.types.PaginatedEmployeePayrollRunList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEmployeePayrollRunsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEmployeePayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public CompletableFuture>> list() { + return list(EmployeePayrollRunsListRequest.builder().build()); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public CompletableFuture>> list( + EmployeePayrollRunsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public CompletableFuture>> list( + EmployeePayrollRunsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employee-payroll-runs"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPayrollRunId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "payroll_run_id", request.getPayrollRunId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEmployeePayrollRunList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedEmployeePayrollRunList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployeePayrollRunsListRequest nextRequest = EmployeePayrollRunsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EmployeePayrollRunsRetrieveRequest.builder().build()); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public CompletableFuture> retrieve( + String id, EmployeePayrollRunsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public CompletableFuture> retrieve( + String id, EmployeePayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employee-payroll-runs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeePayrollRun.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java new file mode 100644 index 000000000..b4dc7af32 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java @@ -0,0 +1,583 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employee; +import com.merge.api.hris.types.EmployeeEndpointRequest; +import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesListRequest; +import com.merge.api.hris.types.EmployeesRetrieveRequest; +import com.merge.api.hris.types.IgnoreCommonModelRequest; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.PaginatedEmployeeList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEmployeesClient { + protected final ClientOptions clientOptions; + + public AsyncRawEmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture>> list() { + return list(EmployeesListRequest.builder().build()); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture>> list(EmployeesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Employee objects. + */ + public CompletableFuture>> list( + EmployeesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDisplayFullName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "display_full_name", request.getDisplayFullName().get(), false); + } + if (request.getEmploymentStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "employment_status", + request.getEmploymentStatus().get().toString(), + false); + } + if (request.getEmploymentType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employment_type", request.getEmploymentType().get(), false); + } + if (request.getFirstName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "first_name", request.getFirstName().get(), false); + } + if (request.getGroups().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "groups", request.getGroups().get(), false); + } + if (request.getHomeLocationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "home_location_id", request.getHomeLocationId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobTitle().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_title", request.getJobTitle().get(), false); + } + if (request.getLastName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "last_name", request.getLastName().get(), false); + } + if (request.getManagerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "manager_id", request.getManagerId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPayGroupId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "pay_group_id", request.getPayGroupId().get(), false); + } + if (request.getPersonalEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "personal_email", request.getPersonalEmail().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getTeamId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "team_id", request.getTeamId().get(), false); + } + if (request.getTerminatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "terminated_after", + request.getTerminatedAfter().get().toString(), + false); + } + if (request.getTerminatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "terminated_before", + request.getTerminatedBefore().get().toString(), + false); + } + if (request.getWorkEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "work_email", request.getWorkEmail().get(), false); + } + if (request.getWorkLocationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "work_location_id", request.getWorkLocationId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEmployeeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployeesListRequest nextRequest = EmployeesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Employee object with the given values. + */ + public CompletableFuture> create(EmployeeEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Employee object with the given values. + */ + public CompletableFuture> create( + EmployeeEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeeResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EmployeesRetrieveRequest.builder().build()); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture> retrieve(String id, EmployeesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Employee object with the given id. + */ + public CompletableFuture> retrieve( + String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public CompletableFuture> ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Employee POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Employee POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java new file mode 100644 index 000000000..0ac7bfe8e --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java @@ -0,0 +1,254 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployerBenefit; +import com.merge.api.hris.types.EmployerBenefitsListRequest; +import com.merge.api.hris.types.EmployerBenefitsRetrieveRequest; +import com.merge.api.hris.types.PaginatedEmployerBenefitList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEmployerBenefitsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEmployerBenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public CompletableFuture>> list() { + return list(EmployerBenefitsListRequest.builder().build()); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public CompletableFuture>> list( + EmployerBenefitsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public CompletableFuture>> list( + EmployerBenefitsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employer-benefits"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEmployerBenefitList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedEmployerBenefitList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployerBenefitsListRequest nextRequest = EmployerBenefitsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EmployerBenefitsRetrieveRequest.builder().build()); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public CompletableFuture> retrieve( + String id, EmployerBenefitsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public CompletableFuture> retrieve( + String id, EmployerBenefitsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employer-benefits") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployerBenefit.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java new file mode 100644 index 000000000..b375e6ef0 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java @@ -0,0 +1,290 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employment; +import com.merge.api.hris.types.EmploymentsListRequest; +import com.merge.api.hris.types.EmploymentsRetrieveRequest; +import com.merge.api.hris.types.PaginatedEmploymentList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawEmploymentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawEmploymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Employment objects. + */ + public CompletableFuture>> list() { + return list(EmploymentsListRequest.builder().build()); + } + + /** + * Returns a list of Employment objects. + */ + public CompletableFuture>> list( + EmploymentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Employment objects. + */ + public CompletableFuture>> list( + EmploymentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get().toString(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedEmploymentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedEmploymentList.class); + Optional startingAfter = parsedResponse.getNext(); + EmploymentsListRequest nextRequest = EmploymentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Employment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, EmploymentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Employment object with the given id. + */ + public CompletableFuture> retrieve(String id, EmploymentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Employment object with the given id. + */ + public CompletableFuture> retrieve( + String id, EmploymentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employment.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..0481a2509 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CreateFieldMappingRequest; +import com.merge.api.hris.types.ExternalTargetFieldApiResponse; +import com.merge.api.hris.types.FieldMappingApiInstanceResponse; +import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsRetrieveRequest; +import com.merge.api.hris.types.PatchedEditFieldMappingRequest; +import com.merge.api.hris.types.RemoteFieldApiResponse; +import com.merge.api.hris.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), RemoteFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..26c692796 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..ac9e46327 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.GenerateRemoteKeyRequest; +import com.merge.api.hris.types.RemoteKey; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java b/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java new file mode 100644 index 000000000..8a8a938d7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Group; +import com.merge.api.hris.types.GroupsListRequest; +import com.merge.api.hris.types.GroupsRetrieveRequest; +import com.merge.api.hris.types.PaginatedGroupList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGroupsClient { + protected final ClientOptions clientOptions; + + public AsyncRawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonlyUsedAsTeam().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_commonly_used_as_team", + request.getIsCommonlyUsedAsTeam().get(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getNames().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "names", request.getNames().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getTypes().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "types", request.getTypes().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java new file mode 100644 index 000000000..8f14d6723 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Issue; +import com.merge.api.hris.types.IssuesListRequest; +import com.merge.api.hris.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..be04a5752 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.EndUserDetailsRequest; +import com.merge.api.hris.types.LinkToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..2f3825d80 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AccountDetailsAndActions; +import com.merge.api.hris.types.LinkedAccountsListRequest; +import com.merge.api.hris.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java b/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java new file mode 100644 index 000000000..fb1bccb00 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java @@ -0,0 +1,276 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Location; +import com.merge.api.hris.types.LocationsListRequest; +import com.merge.api.hris.types.LocationsRetrieveRequest; +import com.merge.api.hris.types.PaginatedLocationList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLocationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLocationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Location objects. + */ + public CompletableFuture>> list() { + return list(LocationsListRequest.builder().build()); + } + + /** + * Returns a list of Location objects. + */ + public CompletableFuture>> list(LocationsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Location objects. + */ + public CompletableFuture>> list( + LocationsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/locations"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getLocationType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "location_type", request.getLocationType().get().toString(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedLocationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLocationList.class); + Optional startingAfter = parsedResponse.getNext(); + LocationsListRequest nextRequest = LocationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Location object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, LocationsRetrieveRequest.builder().build()); + } + + /** + * Returns a Location object with the given id. + */ + public CompletableFuture> retrieve(String id, LocationsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Location object with the given id. + */ + public CompletableFuture> retrieve( + String id, LocationsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/locations") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Location.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..0a1e2e073 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.DataPassthroughRequest; +import com.merge.api.hris.types.RemoteResponse; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java b/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java new file mode 100644 index 000000000..7157ee8bb --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedPayGroupList; +import com.merge.api.hris.types.PayGroup; +import com.merge.api.hris.types.PayGroupsListRequest; +import com.merge.api.hris.types.PayGroupsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPayGroupsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPayGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PayGroup objects. + */ + public CompletableFuture>> list() { + return list(PayGroupsListRequest.builder().build()); + } + + /** + * Returns a list of PayGroup objects. + */ + public CompletableFuture>> list(PayGroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PayGroup objects. + */ + public CompletableFuture>> list( + PayGroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/pay-groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedPayGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPayGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + PayGroupsListRequest nextRequest = PayGroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a PayGroup object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, PayGroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a PayGroup object with the given id. + */ + public CompletableFuture> retrieve(String id, PayGroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PayGroup object with the given id. + */ + public CompletableFuture> retrieve( + String id, PayGroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/pay-groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayGroup.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java b/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java new file mode 100644 index 000000000..52b3022ae --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedPayrollRunList; +import com.merge.api.hris.types.PayrollRun; +import com.merge.api.hris.types.PayrollRunsListRequest; +import com.merge.api.hris.types.PayrollRunsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPayrollRunsClient { + protected final ClientOptions clientOptions; + + public AsyncRawPayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PayrollRun objects. + */ + public CompletableFuture>> list() { + return list(PayrollRunsListRequest.builder().build()); + } + + /** + * Returns a list of PayrollRun objects. + */ + public CompletableFuture>> list( + PayrollRunsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PayrollRun objects. + */ + public CompletableFuture>> list( + PayrollRunsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/payroll-runs"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRunType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_type", request.getRunType().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedPayrollRunList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedPayrollRunList.class); + Optional startingAfter = parsedResponse.getNext(); + PayrollRunsListRequest nextRequest = PayrollRunsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a PayrollRun object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, PayrollRunsRetrieveRequest.builder().build()); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public CompletableFuture> retrieve(String id, PayrollRunsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public CompletableFuture> retrieve( + String id, PayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/payroll-runs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayrollRun.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..8b3fe86a7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.RemoteKey; +import com.merge.api.hris.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java b/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java new file mode 100644 index 000000000..87e00d903 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CommonModelScopeApi; +import com.merge.api.hris.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..9d5d80ac0 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedSyncStatusList; +import com.merge.api.hris.types.SyncStatus; +import com.merge.api.hris.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java b/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java new file mode 100644 index 000000000..62360fa5b --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java @@ -0,0 +1,262 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedTeamList; +import com.merge.api.hris.types.Team; +import com.merge.api.hris.types.TeamsListRequest; +import com.merge.api.hris.types.TeamsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTeamsClient { + protected final ClientOptions clientOptions; + + public AsyncRawTeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture>> list() { + return list(TeamsListRequest.builder().build()); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture>> list(TeamsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture>> list( + TeamsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/teams"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentTeamId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_team_id", request.getParentTeamId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTeamList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + Optional startingAfter = parsedResponse.getNext(); + TeamsListRequest nextRequest = TeamsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TeamsRetrieveRequest.builder().build()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture> retrieve(String id, TeamsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture> retrieve( + String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/teams") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java b/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java new file mode 100644 index 000000000..097ff5b2d --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java @@ -0,0 +1,286 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedTimeOffBalanceList; +import com.merge.api.hris.types.TimeOffBalance; +import com.merge.api.hris.types.TimeOffBalancesListRequest; +import com.merge.api.hris.types.TimeOffBalancesRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTimeOffBalancesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTimeOffBalancesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public CompletableFuture>> list() { + return list(TimeOffBalancesListRequest.builder().build()); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public CompletableFuture>> list( + TimeOffBalancesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public CompletableFuture>> list( + TimeOffBalancesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off-balances"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPolicyType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "policy_type", request.getPolicyType().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTimeOffBalanceList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedTimeOffBalanceList.class); + Optional startingAfter = parsedResponse.getNext(); + TimeOffBalancesListRequest nextRequest = TimeOffBalancesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TimeOffBalancesRetrieveRequest.builder().build()); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public CompletableFuture> retrieve( + String id, TimeOffBalancesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public CompletableFuture> retrieve( + String id, TimeOffBalancesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off-balances") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffBalance.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java b/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java new file mode 100644 index 000000000..34adc8778 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java @@ -0,0 +1,450 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.PaginatedTimeOffList; +import com.merge.api.hris.types.TimeOff; +import com.merge.api.hris.types.TimeOffEndpointRequest; +import com.merge.api.hris.types.TimeOffListRequest; +import com.merge.api.hris.types.TimeOffResponse; +import com.merge.api.hris.types.TimeOffRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTimeOffClient { + protected final ClientOptions clientOptions; + + public AsyncRawTimeOffClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TimeOff objects. + */ + public CompletableFuture>> list() { + return list(TimeOffListRequest.builder().build()); + } + + /** + * Returns a list of TimeOff objects. + */ + public CompletableFuture>> list(TimeOffListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TimeOff objects. + */ + public CompletableFuture>> list( + TimeOffListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off"); + if (request.getApproverId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "approver_id", request.getApproverId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRequestType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "request_type", request.getRequestType().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTimeOffList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimeOffList.class); + Optional startingAfter = parsedResponse.getNext(); + TimeOffListRequest nextRequest = TimeOffListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a TimeOff object with the given values. + */ + public CompletableFuture> create(TimeOffEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a TimeOff object with the given values. + */ + public CompletableFuture> create( + TimeOffEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a TimeOff object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TimeOffRetrieveRequest.builder().build()); + } + + /** + * Returns a TimeOff object with the given id. + */ + public CompletableFuture> retrieve(String id, TimeOffRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TimeOff object with the given id. + */ + public CompletableFuture> retrieve( + String id, TimeOffRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOff.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java b/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java new file mode 100644 index 000000000..0ae156fc8 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java @@ -0,0 +1,426 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.PaginatedTimesheetEntryList; +import com.merge.api.hris.types.TimesheetEntriesListRequest; +import com.merge.api.hris.types.TimesheetEntriesRetrieveRequest; +import com.merge.api.hris.types.TimesheetEntry; +import com.merge.api.hris.types.TimesheetEntryEndpointRequest; +import com.merge.api.hris.types.TimesheetEntryResponse; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTimesheetEntriesClient { + protected final ClientOptions clientOptions; + + public AsyncRawTimesheetEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public CompletableFuture>> list() { + return list(TimesheetEntriesListRequest.builder().build()); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public CompletableFuture>> list( + TimesheetEntriesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public CompletableFuture>> list( + TimesheetEntriesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get().toString(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTimesheetEntryList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedTimesheetEntryList.class); + Optional startingAfter = parsedResponse.getNext(); + TimesheetEntriesListRequest nextRequest = TimesheetEntriesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public CompletableFuture> create( + TimesheetEntryEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public CompletableFuture> create( + TimesheetEntryEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), TimesheetEntryResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TimesheetEntriesRetrieveRequest.builder().build()); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public CompletableFuture> retrieve( + String id, TimesheetEntriesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public CompletableFuture> retrieve( + String id, TimesheetEntriesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimesheetEntry.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..cf43e8b22 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.WebhookReceiver; +import com.merge.api.hris.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/hris/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..84868d239 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.RemoteKey; +import com.merge.api.hris.types.RemoteKeyForRegenerationRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncScopesClient.java b/src/main/java/com/merge/api/hris/AsyncScopesClient.java new file mode 100644 index 000000000..22ac1f039 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CommonModelScopeApi; +import com.merge.api.hris.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/hris/AsyncSyncStatusClient.java new file mode 100644 index 000000000..1f4096291 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.SyncStatus; +import com.merge.api.hris.types.SyncStatusListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncTeamsClient.java b/src/main/java/com/merge/api/hris/AsyncTeamsClient.java new file mode 100644 index 000000000..110d1fd63 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncTeamsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Team; +import com.merge.api.hris.types.TeamsListRequest; +import com.merge.api.hris.types.TeamsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncTeamsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTeamsClient rawClient; + + public AsyncTeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTeamsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTeamsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture> list(TeamsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture> list(TeamsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture retrieve(String id, TeamsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncTimeOffBalancesClient.java b/src/main/java/com/merge/api/hris/AsyncTimeOffBalancesClient.java new file mode 100644 index 000000000..203740e30 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncTimeOffBalancesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.TimeOffBalance; +import com.merge.api.hris.types.TimeOffBalancesListRequest; +import com.merge.api.hris.types.TimeOffBalancesRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncTimeOffBalancesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTimeOffBalancesClient rawClient; + + public AsyncTimeOffBalancesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTimeOffBalancesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTimeOffBalancesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public CompletableFuture> list(TimeOffBalancesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public CompletableFuture> list( + TimeOffBalancesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public CompletableFuture retrieve(String id, TimeOffBalancesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public CompletableFuture retrieve( + String id, TimeOffBalancesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncTimeOffClient.java b/src/main/java/com/merge/api/hris/AsyncTimeOffClient.java new file mode 100644 index 000000000..79c1eea97 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncTimeOffClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.TimeOff; +import com.merge.api.hris.types.TimeOffEndpointRequest; +import com.merge.api.hris.types.TimeOffListRequest; +import com.merge.api.hris.types.TimeOffResponse; +import com.merge.api.hris.types.TimeOffRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncTimeOffClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTimeOffClient rawClient; + + public AsyncTimeOffClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTimeOffClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTimeOffClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TimeOff objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of TimeOff objects. + */ + public CompletableFuture> list(TimeOffListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of TimeOff objects. + */ + public CompletableFuture> list( + TimeOffListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a TimeOff object with the given values. + */ + public CompletableFuture create(TimeOffEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a TimeOff object with the given values. + */ + public CompletableFuture create(TimeOffEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a TimeOff object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a TimeOff object with the given id. + */ + public CompletableFuture retrieve(String id, TimeOffRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a TimeOff object with the given id. + */ + public CompletableFuture retrieve( + String id, TimeOffRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncTimesheetEntriesClient.java b/src/main/java/com/merge/api/hris/AsyncTimesheetEntriesClient.java new file mode 100644 index 000000000..6c537b58a --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncTimesheetEntriesClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.TimesheetEntriesListRequest; +import com.merge.api.hris.types.TimesheetEntriesRetrieveRequest; +import com.merge.api.hris.types.TimesheetEntry; +import com.merge.api.hris.types.TimesheetEntryEndpointRequest; +import com.merge.api.hris.types.TimesheetEntryResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncTimesheetEntriesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTimesheetEntriesClient rawClient; + + public AsyncTimesheetEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTimesheetEntriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTimesheetEntriesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public CompletableFuture> list(TimesheetEntriesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public CompletableFuture> list( + TimesheetEntriesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public CompletableFuture create(TimesheetEntryEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public CompletableFuture create( + TimesheetEntryEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public CompletableFuture retrieve(String id, TimesheetEntriesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public CompletableFuture retrieve( + String id, TimesheetEntriesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/hris/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..e7e73ec95 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.WebhookReceiver; +import com.merge.api.hris.types.WebhookReceiverRequest; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/hris/AuditTrailClient.java b/src/main/java/com/merge/api/hris/AuditTrailClient.java new file mode 100644 index 000000000..69f0a181b --- /dev/null +++ b/src/main/java/com/merge/api/hris/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AuditLogEvent; +import com.merge.api.hris.types.AuditTrailListRequest; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/AvailableActionsClient.java b/src/main/java/com/merge/api/hris/AvailableActionsClient.java new file mode 100644 index 000000000..aa6a784a5 --- /dev/null +++ b/src/main/java/com/merge/api/hris/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AvailableActions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/BankInfoClient.java b/src/main/java/com/merge/api/hris/BankInfoClient.java new file mode 100644 index 000000000..f571ef28c --- /dev/null +++ b/src/main/java/com/merge/api/hris/BankInfoClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.BankInfo; +import com.merge.api.hris.types.BankInfoListRequest; +import com.merge.api.hris.types.BankInfoRetrieveRequest; + +public class BankInfoClient { + protected final ClientOptions clientOptions; + + private final RawBankInfoClient rawClient; + + public BankInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBankInfoClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBankInfoClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of BankInfo objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of BankInfo objects. + */ + public SyncPagingIterable list(BankInfoListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of BankInfo objects. + */ + public SyncPagingIterable list(BankInfoListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a BankInfo object with the given id. + */ + public BankInfo retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a BankInfo object with the given id. + */ + public BankInfo retrieve(String id, BankInfoRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a BankInfo object with the given id. + */ + public BankInfo retrieve(String id, BankInfoRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/BenefitsClient.java b/src/main/java/com/merge/api/hris/BenefitsClient.java new file mode 100644 index 000000000..e4e47da29 --- /dev/null +++ b/src/main/java/com/merge/api/hris/BenefitsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Benefit; +import com.merge.api.hris.types.BenefitsListRequest; +import com.merge.api.hris.types.BenefitsRetrieveRequest; + +public class BenefitsClient { + protected final ClientOptions clientOptions; + + private final RawBenefitsClient rawClient; + + public BenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawBenefitsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawBenefitsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Benefit objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Benefit objects. + */ + public SyncPagingIterable list(BenefitsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Benefit objects. + */ + public SyncPagingIterable list(BenefitsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Benefit object with the given id. + */ + public Benefit retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Benefit object with the given id. + */ + public Benefit retrieve(String id, BenefitsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Benefit object with the given id. + */ + public Benefit retrieve(String id, BenefitsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/CompaniesClient.java b/src/main/java/com/merge/api/hris/CompaniesClient.java new file mode 100644 index 000000000..498fe15c6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/CompaniesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.CompaniesListRequest; +import com.merge.api.hris.types.CompaniesRetrieveRequest; +import com.merge.api.hris.types.Company; + +public class CompaniesClient { + protected final ClientOptions clientOptions; + + private final RawCompaniesClient rawClient; + + public CompaniesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCompaniesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCompaniesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Company objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Company objects. + */ + public SyncPagingIterable list(CompaniesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Company objects. + */ + public SyncPagingIterable list(CompaniesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Company object with the given id. + */ + public Company retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Company object with the given id. + */ + public Company retrieve(String id, CompaniesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Company object with the given id. + */ + public Company retrieve(String id, CompaniesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/DeleteAccountClient.java b/src/main/java/com/merge/api/hris/DeleteAccountClient.java new file mode 100644 index 000000000..72bf4451c --- /dev/null +++ b/src/main/java/com/merge/api/hris/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/DependentsClient.java b/src/main/java/com/merge/api/hris/DependentsClient.java new file mode 100644 index 000000000..f137eb3b7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/DependentsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Dependent; +import com.merge.api.hris.types.DependentsListRequest; +import com.merge.api.hris.types.DependentsRetrieveRequest; + +public class DependentsClient { + protected final ClientOptions clientOptions; + + private final RawDependentsClient rawClient; + + public DependentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDependentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDependentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Dependent objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Dependent objects. + */ + public SyncPagingIterable list(DependentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Dependent objects. + */ + public SyncPagingIterable list(DependentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Dependent object with the given id. + */ + public Dependent retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Dependent object with the given id. + */ + public Dependent retrieve(String id, DependentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Dependent object with the given id. + */ + public Dependent retrieve(String id, DependentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/EmployeePayrollRunsClient.java b/src/main/java/com/merge/api/hris/EmployeePayrollRunsClient.java new file mode 100644 index 000000000..3de517c89 --- /dev/null +++ b/src/main/java/com/merge/api/hris/EmployeePayrollRunsClient.java @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployeePayrollRun; +import com.merge.api.hris.types.EmployeePayrollRunsListRequest; +import com.merge.api.hris.types.EmployeePayrollRunsRetrieveRequest; + +public class EmployeePayrollRunsClient { + protected final ClientOptions clientOptions; + + private final RawEmployeePayrollRunsClient rawClient; + + public EmployeePayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEmployeePayrollRunsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEmployeePayrollRunsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public SyncPagingIterable list(EmployeePayrollRunsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public SyncPagingIterable list( + EmployeePayrollRunsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public EmployeePayrollRun retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public EmployeePayrollRun retrieve(String id, EmployeePayrollRunsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public EmployeePayrollRun retrieve( + String id, EmployeePayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/EmployeesClient.java b/src/main/java/com/merge/api/hris/EmployeesClient.java new file mode 100644 index 000000000..a94c539f0 --- /dev/null +++ b/src/main/java/com/merge/api/hris/EmployeesClient.java @@ -0,0 +1,117 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employee; +import com.merge.api.hris.types.EmployeeEndpointRequest; +import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesListRequest; +import com.merge.api.hris.types.EmployeesRetrieveRequest; +import com.merge.api.hris.types.IgnoreCommonModelRequest; +import com.merge.api.hris.types.MetaResponse; + +public class EmployeesClient { + protected final ClientOptions clientOptions; + + private final RawEmployeesClient rawClient; + + public EmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEmployeesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEmployeesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Employee objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Employee objects. + */ + public SyncPagingIterable list(EmployeesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Employee objects. + */ + public SyncPagingIterable list(EmployeesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Employee object with the given values. + */ + public EmployeeResponse create(EmployeeEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Employee object with the given values. + */ + public EmployeeResponse create(EmployeeEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Employee object with the given id. + */ + public Employee retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Employee object with the given id. + */ + public Employee retrieve(String id, EmployeesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Employee object with the given id. + */ + public Employee retrieve(String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + this.rawClient.ignoreCreate(modelId, request).body(); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); + } + + /** + * Returns metadata for Employee POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Employee POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/EmployerBenefitsClient.java b/src/main/java/com/merge/api/hris/EmployerBenefitsClient.java new file mode 100644 index 000000000..8c9457f85 --- /dev/null +++ b/src/main/java/com/merge/api/hris/EmployerBenefitsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployerBenefit; +import com.merge.api.hris.types.EmployerBenefitsListRequest; +import com.merge.api.hris.types.EmployerBenefitsRetrieveRequest; + +public class EmployerBenefitsClient { + protected final ClientOptions clientOptions; + + private final RawEmployerBenefitsClient rawClient; + + public EmployerBenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEmployerBenefitsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEmployerBenefitsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public SyncPagingIterable list(EmployerBenefitsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public SyncPagingIterable list( + EmployerBenefitsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public EmployerBenefit retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public EmployerBenefit retrieve(String id, EmployerBenefitsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public EmployerBenefit retrieve(String id, EmployerBenefitsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/EmploymentsClient.java b/src/main/java/com/merge/api/hris/EmploymentsClient.java new file mode 100644 index 000000000..3e7e94a69 --- /dev/null +++ b/src/main/java/com/merge/api/hris/EmploymentsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employment; +import com.merge.api.hris.types.EmploymentsListRequest; +import com.merge.api.hris.types.EmploymentsRetrieveRequest; + +public class EmploymentsClient { + protected final ClientOptions clientOptions; + + private final RawEmploymentsClient rawClient; + + public EmploymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawEmploymentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawEmploymentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Employment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Employment objects. + */ + public SyncPagingIterable list(EmploymentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Employment objects. + */ + public SyncPagingIterable list(EmploymentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Employment object with the given id. + */ + public Employment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Employment object with the given id. + */ + public Employment retrieve(String id, EmploymentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Employment object with the given id. + */ + public Employment retrieve(String id, EmploymentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/FieldMappingClient.java b/src/main/java/com/merge/api/hris/FieldMappingClient.java new file mode 100644 index 000000000..0af1275d6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/FieldMappingClient.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CreateFieldMappingRequest; +import com.merge.api.hris.types.ExternalTargetFieldApiResponse; +import com.merge.api.hris.types.FieldMappingApiInstanceResponse; +import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsRetrieveRequest; +import com.merge.api.hris.types.PatchedEditFieldMappingRequest; +import com.merge.api.hris.types.RemoteFieldApiResponse; +import com.merge.api.hris.types.RemoteFieldsRetrieveRequest; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/ForceResyncClient.java b/src/main/java/com/merge/api/hris/ForceResyncClient.java new file mode 100644 index 000000000..2f3ef05ea --- /dev/null +++ b/src/main/java/com/merge/api/hris/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.SyncStatus; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/GenerateKeyClient.java b/src/main/java/com/merge/api/hris/GenerateKeyClient.java new file mode 100644 index 000000000..3557f7a70 --- /dev/null +++ b/src/main/java/com/merge/api/hris/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.GenerateRemoteKeyRequest; +import com.merge.api.hris.types.RemoteKey; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/GroupsClient.java b/src/main/java/com/merge/api/hris/GroupsClient.java new file mode 100644 index 000000000..4f542c585 --- /dev/null +++ b/src/main/java/com/merge/api/hris/GroupsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Group; +import com.merge.api.hris.types.GroupsListRequest; +import com.merge.api.hris.types.GroupsRetrieveRequest; + +public class GroupsClient { + protected final ClientOptions clientOptions; + + private final RawGroupsClient rawClient; + + public GroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/resources/hris/HrisClient.java b/src/main/java/com/merge/api/hris/HrisClient.java similarity index 79% rename from src/main/java/com/merge/api/resources/hris/HrisClient.java rename to src/main/java/com/merge/api/hris/HrisClient.java index 606e2d2db..89d9042aa 100644 --- a/src/main/java/com/merge/api/resources/hris/HrisClient.java +++ b/src/main/java/com/merge/api/hris/HrisClient.java @@ -1,43 +1,10 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris; +package com.merge.api.hris; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; -import com.merge.api.resources.hris.accountdetails.AccountDetailsClient; -import com.merge.api.resources.hris.accounttoken.AccountTokenClient; -import com.merge.api.resources.hris.asyncpassthrough.AsyncPassthroughClient; -import com.merge.api.resources.hris.audittrail.AuditTrailClient; -import com.merge.api.resources.hris.availableactions.AvailableActionsClient; -import com.merge.api.resources.hris.bankinfo.BankInfoClient; -import com.merge.api.resources.hris.benefits.BenefitsClient; -import com.merge.api.resources.hris.companies.CompaniesClient; -import com.merge.api.resources.hris.deleteaccount.DeleteAccountClient; -import com.merge.api.resources.hris.dependents.DependentsClient; -import com.merge.api.resources.hris.employeepayrollruns.EmployeePayrollRunsClient; -import com.merge.api.resources.hris.employees.EmployeesClient; -import com.merge.api.resources.hris.employerbenefits.EmployerBenefitsClient; -import com.merge.api.resources.hris.employments.EmploymentsClient; -import com.merge.api.resources.hris.fieldmapping.FieldMappingClient; -import com.merge.api.resources.hris.forceresync.ForceResyncClient; -import com.merge.api.resources.hris.generatekey.GenerateKeyClient; -import com.merge.api.resources.hris.groups.GroupsClient; -import com.merge.api.resources.hris.issues.IssuesClient; -import com.merge.api.resources.hris.linkedaccounts.LinkedAccountsClient; -import com.merge.api.resources.hris.linktoken.LinkTokenClient; -import com.merge.api.resources.hris.locations.LocationsClient; -import com.merge.api.resources.hris.passthrough.PassthroughClient; -import com.merge.api.resources.hris.paygroups.PayGroupsClient; -import com.merge.api.resources.hris.payrollruns.PayrollRunsClient; -import com.merge.api.resources.hris.regeneratekey.RegenerateKeyClient; -import com.merge.api.resources.hris.scopes.ScopesClient; -import com.merge.api.resources.hris.syncstatus.SyncStatusClient; -import com.merge.api.resources.hris.teams.TeamsClient; -import com.merge.api.resources.hris.timeoff.TimeOffClient; -import com.merge.api.resources.hris.timeoffbalances.TimeOffBalancesClient; -import com.merge.api.resources.hris.timesheetentries.TimesheetEntriesClient; -import com.merge.api.resources.hris.webhookreceivers.WebhookReceiversClient; import java.util.function.Supplier; public class HrisClient { diff --git a/src/main/java/com/merge/api/hris/IssuesClient.java b/src/main/java/com/merge/api/hris/IssuesClient.java new file mode 100644 index 000000000..90efe089a --- /dev/null +++ b/src/main/java/com/merge/api/hris/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Issue; +import com.merge.api.hris.types.IssuesListRequest; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/LinkTokenClient.java b/src/main/java/com/merge/api/hris/LinkTokenClient.java new file mode 100644 index 000000000..c6a50a7f6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.EndUserDetailsRequest; +import com.merge.api.hris.types.LinkToken; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/LinkedAccountsClient.java b/src/main/java/com/merge/api/hris/LinkedAccountsClient.java new file mode 100644 index 000000000..db48c0a73 --- /dev/null +++ b/src/main/java/com/merge/api/hris/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AccountDetailsAndActions; +import com.merge.api.hris.types.LinkedAccountsListRequest; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/LocationsClient.java b/src/main/java/com/merge/api/hris/LocationsClient.java new file mode 100644 index 000000000..db0d6e308 --- /dev/null +++ b/src/main/java/com/merge/api/hris/LocationsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Location; +import com.merge.api.hris.types.LocationsListRequest; +import com.merge.api.hris.types.LocationsRetrieveRequest; + +public class LocationsClient { + protected final ClientOptions clientOptions; + + private final RawLocationsClient rawClient; + + public LocationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLocationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLocationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Location objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Location objects. + */ + public SyncPagingIterable list(LocationsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Location objects. + */ + public SyncPagingIterable list(LocationsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Location object with the given id. + */ + public Location retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Location object with the given id. + */ + public Location retrieve(String id, LocationsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Location object with the given id. + */ + public Location retrieve(String id, LocationsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/PassthroughClient.java b/src/main/java/com/merge/api/hris/PassthroughClient.java new file mode 100644 index 000000000..fead10ab8 --- /dev/null +++ b/src/main/java/com/merge/api/hris/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.DataPassthroughRequest; +import com.merge.api.hris.types.RemoteResponse; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/PayGroupsClient.java b/src/main/java/com/merge/api/hris/PayGroupsClient.java new file mode 100644 index 000000000..afbecf5dc --- /dev/null +++ b/src/main/java/com/merge/api/hris/PayGroupsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PayGroup; +import com.merge.api.hris.types.PayGroupsListRequest; +import com.merge.api.hris.types.PayGroupsRetrieveRequest; + +public class PayGroupsClient { + protected final ClientOptions clientOptions; + + private final RawPayGroupsClient rawClient; + + public PayGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPayGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPayGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PayGroup objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of PayGroup objects. + */ + public SyncPagingIterable list(PayGroupsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of PayGroup objects. + */ + public SyncPagingIterable list(PayGroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a PayGroup object with the given id. + */ + public PayGroup retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a PayGroup object with the given id. + */ + public PayGroup retrieve(String id, PayGroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a PayGroup object with the given id. + */ + public PayGroup retrieve(String id, PayGroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/PayrollRunsClient.java b/src/main/java/com/merge/api/hris/PayrollRunsClient.java new file mode 100644 index 000000000..89b0911e2 --- /dev/null +++ b/src/main/java/com/merge/api/hris/PayrollRunsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PayrollRun; +import com.merge.api.hris.types.PayrollRunsListRequest; +import com.merge.api.hris.types.PayrollRunsRetrieveRequest; + +public class PayrollRunsClient { + protected final ClientOptions clientOptions; + + private final RawPayrollRunsClient rawClient; + + public PayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPayrollRunsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPayrollRunsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of PayrollRun objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of PayrollRun objects. + */ + public SyncPagingIterable list(PayrollRunsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of PayrollRun objects. + */ + public SyncPagingIterable list(PayrollRunsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public PayrollRun retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public PayrollRun retrieve(String id, PayrollRunsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public PayrollRun retrieve(String id, PayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java b/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java new file mode 100644 index 000000000..4148bf17c --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountDetails; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawAccountTokenClient.java b/src/main/java/com/merge/api/hris/RawAccountTokenClient.java new file mode 100644 index 000000000..513d15c16 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawAccountTokenClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AccountToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..eca3662d6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AsyncPassthroughReciept; +import com.merge.api.hris.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.hris.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawAuditTrailClient.java b/src/main/java/com/merge/api/hris/RawAuditTrailClient.java new file mode 100644 index 000000000..626d6ae46 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawAuditTrailClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AuditLogEvent; +import com.merge.api.hris.types.AuditTrailListRequest; +import com.merge.api.hris.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java b/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java new file mode 100644 index 000000000..a5c6d5d5b --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.AvailableActions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawBankInfoClient.java b/src/main/java/com/merge/api/hris/RawBankInfoClient.java new file mode 100644 index 000000000..f2a91636e --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawBankInfoClient.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.BankInfo; +import com.merge.api.hris.types.BankInfoListRequest; +import com.merge.api.hris.types.BankInfoRetrieveRequest; +import com.merge.api.hris.types.PaginatedBankInfoList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBankInfoClient { + protected final ClientOptions clientOptions; + + public RawBankInfoClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of BankInfo objects. + */ + public MergeApiHttpResponse> list() { + return list(BankInfoListRequest.builder().build()); + } + + /** + * Returns a list of BankInfo objects. + */ + public MergeApiHttpResponse> list(BankInfoListRequest request) { + return list(request, null); + } + + /** + * Returns a list of BankInfo objects. + */ + public MergeApiHttpResponse> list( + BankInfoListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/bank-info"); + if (request.getAccountType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_type", request.getAccountType().get().toString(), false); + } + if (request.getBankName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "bank_name", request.getBankName().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get().toString(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedBankInfoList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBankInfoList.class); + Optional startingAfter = parsedResponse.getNext(); + BankInfoListRequest nextRequest = BankInfoListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a BankInfo object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, BankInfoRetrieveRequest.builder().build()); + } + + /** + * Returns a BankInfo object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, BankInfoRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a BankInfo object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, BankInfoRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/bank-info") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankInfo.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawBenefitsClient.java b/src/main/java/com/merge/api/hris/RawBenefitsClient.java new file mode 100644 index 000000000..9270b648a --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawBenefitsClient.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Benefit; +import com.merge.api.hris.types.BenefitsListRequest; +import com.merge.api.hris.types.BenefitsRetrieveRequest; +import com.merge.api.hris.types.PaginatedBenefitList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawBenefitsClient { + protected final ClientOptions clientOptions; + + public RawBenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Benefit objects. + */ + public MergeApiHttpResponse> list() { + return list(BenefitsListRequest.builder().build()); + } + + /** + * Returns a list of Benefit objects. + */ + public MergeApiHttpResponse> list(BenefitsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Benefit objects. + */ + public MergeApiHttpResponse> list( + BenefitsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/benefits"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedBenefitList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBenefitList.class); + Optional startingAfter = parsedResponse.getNext(); + BenefitsListRequest nextRequest = BenefitsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Benefit object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, BenefitsRetrieveRequest.builder().build()); + } + + /** + * Returns a Benefit object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, BenefitsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Benefit object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, BenefitsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/benefits") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Benefit.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawCompaniesClient.java b/src/main/java/com/merge/api/hris/RawCompaniesClient.java new file mode 100644 index 000000000..9fe6da94e --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawCompaniesClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.CompaniesListRequest; +import com.merge.api.hris.types.CompaniesRetrieveRequest; +import com.merge.api.hris.types.Company; +import com.merge.api.hris.types.PaginatedCompanyList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCompaniesClient { + protected final ClientOptions clientOptions; + + public RawCompaniesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Company objects. + */ + public MergeApiHttpResponse> list() { + return list(CompaniesListRequest.builder().build()); + } + + /** + * Returns a list of Company objects. + */ + public MergeApiHttpResponse> list(CompaniesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Company objects. + */ + public MergeApiHttpResponse> list( + CompaniesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/companies"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCompanyList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCompanyList.class); + Optional startingAfter = parsedResponse.getNext(); + CompaniesListRequest nextRequest = CompaniesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Company object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CompaniesRetrieveRequest.builder().build()); + } + + /** + * Returns a Company object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CompaniesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Company object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CompaniesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/companies") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Company.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java b/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java new file mode 100644 index 000000000..b84ae3549 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawDependentsClient.java b/src/main/java/com/merge/api/hris/RawDependentsClient.java new file mode 100644 index 000000000..2fab4ca5e --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawDependentsClient.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Dependent; +import com.merge.api.hris.types.DependentsListRequest; +import com.merge.api.hris.types.DependentsRetrieveRequest; +import com.merge.api.hris.types.PaginatedDependentList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDependentsClient { + protected final ClientOptions clientOptions; + + public RawDependentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Dependent objects. + */ + public MergeApiHttpResponse> list() { + return list(DependentsListRequest.builder().build()); + } + + /** + * Returns a list of Dependent objects. + */ + public MergeApiHttpResponse> list(DependentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Dependent objects. + */ + public MergeApiHttpResponse> list( + DependentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/dependents"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedDependentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDependentList.class); + Optional startingAfter = parsedResponse.getNext(); + DependentsListRequest nextRequest = DependentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Dependent object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, DependentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Dependent object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, DependentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Dependent object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, DependentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/dependents") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Dependent.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java b/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java new file mode 100644 index 000000000..0846b250e --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java @@ -0,0 +1,245 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployeePayrollRun; +import com.merge.api.hris.types.EmployeePayrollRunsListRequest; +import com.merge.api.hris.types.EmployeePayrollRunsRetrieveRequest; +import com.merge.api.hris.types.PaginatedEmployeePayrollRunList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEmployeePayrollRunsClient { + protected final ClientOptions clientOptions; + + public RawEmployeePayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public MergeApiHttpResponse> list() { + return list(EmployeePayrollRunsListRequest.builder().build()); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public MergeApiHttpResponse> list(EmployeePayrollRunsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EmployeePayrollRun objects. + */ + public MergeApiHttpResponse> list( + EmployeePayrollRunsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employee-payroll-runs"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPayrollRunId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "payroll_run_id", request.getPayrollRunId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEmployeePayrollRunList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedEmployeePayrollRunList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployeePayrollRunsListRequest nextRequest = EmployeePayrollRunsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EmployeePayrollRunsRetrieveRequest.builder().build()); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EmployeePayrollRunsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EmployeePayrollRun object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, EmployeePayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employee-payroll-runs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeePayrollRun.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawEmployeesClient.java b/src/main/java/com/merge/api/hris/RawEmployeesClient.java new file mode 100644 index 000000000..ad716786b --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawEmployeesClient.java @@ -0,0 +1,504 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employee; +import com.merge.api.hris.types.EmployeeEndpointRequest; +import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesListRequest; +import com.merge.api.hris.types.EmployeesRetrieveRequest; +import com.merge.api.hris.types.IgnoreCommonModelRequest; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.PaginatedEmployeeList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEmployeesClient { + protected final ClientOptions clientOptions; + + public RawEmployeesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Employee objects. + */ + public MergeApiHttpResponse> list() { + return list(EmployeesListRequest.builder().build()); + } + + /** + * Returns a list of Employee objects. + */ + public MergeApiHttpResponse> list(EmployeesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Employee objects. + */ + public MergeApiHttpResponse> list( + EmployeesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDisplayFullName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "display_full_name", request.getDisplayFullName().get(), false); + } + if (request.getEmploymentStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "employment_status", + request.getEmploymentStatus().get().toString(), + false); + } + if (request.getEmploymentType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employment_type", request.getEmploymentType().get(), false); + } + if (request.getFirstName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "first_name", request.getFirstName().get(), false); + } + if (request.getGroups().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "groups", request.getGroups().get(), false); + } + if (request.getHomeLocationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "home_location_id", request.getHomeLocationId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getJobTitle().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "job_title", request.getJobTitle().get(), false); + } + if (request.getLastName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "last_name", request.getLastName().get(), false); + } + if (request.getManagerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "manager_id", request.getManagerId().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPayGroupId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "pay_group_id", request.getPayGroupId().get(), false); + } + if (request.getPersonalEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "personal_email", request.getPersonalEmail().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getTeamId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "team_id", request.getTeamId().get(), false); + } + if (request.getTerminatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "terminated_after", + request.getTerminatedAfter().get().toString(), + false); + } + if (request.getTerminatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "terminated_before", + request.getTerminatedBefore().get().toString(), + false); + } + if (request.getWorkEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "work_email", request.getWorkEmail().get(), false); + } + if (request.getWorkLocationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "work_location_id", request.getWorkLocationId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEmployeeList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployeesListRequest nextRequest = EmployeesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Employee object with the given values. + */ + public MergeApiHttpResponse create(EmployeeEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Employee object with the given values. + */ + public MergeApiHttpResponse create( + EmployeeEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeeResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Employee object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EmployeesRetrieveRequest.builder().build()); + } + + /** + * Returns an Employee object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EmployeesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Employee object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeSensitiveFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_sensitive_fields", + request.getIncludeSensitiveFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + return ignoreCreate(modelId, request, null); + } + + /** + * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. + */ + public MergeApiHttpResponse ignoreCreate( + String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees/ignore") + .addPathSegment(modelId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Employee POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Employee POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employees/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java b/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java new file mode 100644 index 000000000..2900cc6d2 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.EmployerBenefit; +import com.merge.api.hris.types.EmployerBenefitsListRequest; +import com.merge.api.hris.types.EmployerBenefitsRetrieveRequest; +import com.merge.api.hris.types.PaginatedEmployerBenefitList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEmployerBenefitsClient { + protected final ClientOptions clientOptions; + + public RawEmployerBenefitsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public MergeApiHttpResponse> list() { + return list(EmployerBenefitsListRequest.builder().build()); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public MergeApiHttpResponse> list(EmployerBenefitsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of EmployerBenefit objects. + */ + public MergeApiHttpResponse> list( + EmployerBenefitsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employer-benefits"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEmployerBenefitList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployerBenefitList.class); + Optional startingAfter = parsedResponse.getNext(); + EmployerBenefitsListRequest nextRequest = EmployerBenefitsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EmployerBenefitsRetrieveRequest.builder().build()); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EmployerBenefitsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an EmployerBenefit object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, EmployerBenefitsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employer-benefits") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployerBenefit.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawEmploymentsClient.java b/src/main/java/com/merge/api/hris/RawEmploymentsClient.java new file mode 100644 index 000000000..933c4a05a --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawEmploymentsClient.java @@ -0,0 +1,251 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Employment; +import com.merge.api.hris.types.EmploymentsListRequest; +import com.merge.api.hris.types.EmploymentsRetrieveRequest; +import com.merge.api.hris.types.PaginatedEmploymentList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawEmploymentsClient { + protected final ClientOptions clientOptions; + + public RawEmploymentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Employment objects. + */ + public MergeApiHttpResponse> list() { + return list(EmploymentsListRequest.builder().build()); + } + + /** + * Returns a list of Employment objects. + */ + public MergeApiHttpResponse> list(EmploymentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Employment objects. + */ + public MergeApiHttpResponse> list( + EmploymentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get().toString(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedEmploymentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmploymentList.class); + Optional startingAfter = parsedResponse.getNext(); + EmploymentsListRequest nextRequest = EmploymentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Employment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, EmploymentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Employment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, EmploymentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Employment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, EmploymentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/employments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employment.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawFieldMappingClient.java b/src/main/java/com/merge/api/hris/RawFieldMappingClient.java new file mode 100644 index 000000000..4e987b47c --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawFieldMappingClient.java @@ -0,0 +1,380 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CreateFieldMappingRequest; +import com.merge.api.hris.types.ExternalTargetFieldApiResponse; +import com.merge.api.hris.types.FieldMappingApiInstanceResponse; +import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsRetrieveRequest; +import com.merge.api.hris.types.PatchedEditFieldMappingRequest; +import com.merge.api.hris.types.RemoteFieldApiResponse; +import com.merge.api.hris.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawForceResyncClient.java b/src/main/java/com/merge/api/hris/RawForceResyncClient.java new file mode 100644 index 000000000..8744bc6d1 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawForceResyncClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java b/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java new file mode 100644 index 000000000..4588b5910 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.GenerateRemoteKeyRequest; +import com.merge.api.hris.types.RemoteKey; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawGroupsClient.java b/src/main/java/com/merge/api/hris/RawGroupsClient.java new file mode 100644 index 000000000..abd2d16e2 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawGroupsClient.java @@ -0,0 +1,244 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Group; +import com.merge.api.hris.types.GroupsListRequest; +import com.merge.api.hris.types.GroupsRetrieveRequest; +import com.merge.api.hris.types.PaginatedGroupList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGroupsClient { + protected final ClientOptions clientOptions; + + public RawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonlyUsedAsTeam().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_commonly_used_as_team", + request.getIsCommonlyUsedAsTeam().get(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getNames().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "names", request.getNames().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getTypes().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "types", request.getTypes().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawIssuesClient.java b/src/main/java/com/merge/api/hris/RawIssuesClient.java new file mode 100644 index 000000000..90af373d8 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawIssuesClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Issue; +import com.merge.api.hris.types.IssuesListRequest; +import com.merge.api.hris.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawLinkTokenClient.java b/src/main/java/com/merge/api/hris/RawLinkTokenClient.java new file mode 100644 index 000000000..6121e29bf --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawLinkTokenClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.EndUserDetailsRequest; +import com.merge.api.hris.types.LinkToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java new file mode 100644 index 000000000..7d7a56652 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.AccountDetailsAndActions; +import com.merge.api.hris.types.LinkedAccountsListRequest; +import com.merge.api.hris.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawLocationsClient.java b/src/main/java/com/merge/api/hris/RawLocationsClient.java new file mode 100644 index 000000000..a50e11d9d --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawLocationsClient.java @@ -0,0 +1,239 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Location; +import com.merge.api.hris.types.LocationsListRequest; +import com.merge.api.hris.types.LocationsRetrieveRequest; +import com.merge.api.hris.types.PaginatedLocationList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLocationsClient { + protected final ClientOptions clientOptions; + + public RawLocationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Location objects. + */ + public MergeApiHttpResponse> list() { + return list(LocationsListRequest.builder().build()); + } + + /** + * Returns a list of Location objects. + */ + public MergeApiHttpResponse> list(LocationsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Location objects. + */ + public MergeApiHttpResponse> list( + LocationsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/locations"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getLocationType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "location_type", request.getLocationType().get().toString(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedLocationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLocationList.class); + Optional startingAfter = parsedResponse.getNext(); + LocationsListRequest nextRequest = LocationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Location object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, LocationsRetrieveRequest.builder().build()); + } + + /** + * Returns a Location object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, LocationsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Location object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, LocationsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/locations") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Location.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawPassthroughClient.java b/src/main/java/com/merge/api/hris/RawPassthroughClient.java new file mode 100644 index 000000000..2dbff8a2b --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawPassthroughClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.DataPassthroughRequest; +import com.merge.api.hris.types.RemoteResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawPayGroupsClient.java b/src/main/java/com/merge/api/hris/RawPayGroupsClient.java new file mode 100644 index 000000000..4a93110e9 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawPayGroupsClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedPayGroupList; +import com.merge.api.hris.types.PayGroup; +import com.merge.api.hris.types.PayGroupsListRequest; +import com.merge.api.hris.types.PayGroupsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPayGroupsClient { + protected final ClientOptions clientOptions; + + public RawPayGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PayGroup objects. + */ + public MergeApiHttpResponse> list() { + return list(PayGroupsListRequest.builder().build()); + } + + /** + * Returns a list of PayGroup objects. + */ + public MergeApiHttpResponse> list(PayGroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PayGroup objects. + */ + public MergeApiHttpResponse> list( + PayGroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/pay-groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedPayGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPayGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + PayGroupsListRequest nextRequest = PayGroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a PayGroup object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, PayGroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a PayGroup object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, PayGroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PayGroup object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, PayGroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/pay-groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayGroup.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java b/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java new file mode 100644 index 000000000..6baf0738b --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedPayrollRunList; +import com.merge.api.hris.types.PayrollRun; +import com.merge.api.hris.types.PayrollRunsListRequest; +import com.merge.api.hris.types.PayrollRunsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPayrollRunsClient { + protected final ClientOptions clientOptions; + + public RawPayrollRunsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of PayrollRun objects. + */ + public MergeApiHttpResponse> list() { + return list(PayrollRunsListRequest.builder().build()); + } + + /** + * Returns a list of PayrollRun objects. + */ + public MergeApiHttpResponse> list(PayrollRunsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of PayrollRun objects. + */ + public MergeApiHttpResponse> list( + PayrollRunsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/payroll-runs"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRunType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_type", request.getRunType().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedPayrollRunList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPayrollRunList.class); + Optional startingAfter = parsedResponse.getNext(); + PayrollRunsListRequest nextRequest = PayrollRunsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a PayrollRun object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, PayrollRunsRetrieveRequest.builder().build()); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, PayrollRunsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a PayrollRun object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, PayrollRunsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/payroll-runs") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayrollRun.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java new file mode 100644 index 000000000..b17b98c19 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.RemoteKey; +import com.merge.api.hris.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawScopesClient.java b/src/main/java/com/merge/api/hris/RawScopesClient.java new file mode 100644 index 000000000..e99134096 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawScopesClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CommonModelScopeApi; +import com.merge.api.hris.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawSyncStatusClient.java b/src/main/java/com/merge/api/hris/RawSyncStatusClient.java new file mode 100644 index 000000000..84fa7840e --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawSyncStatusClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedSyncStatusList; +import com.merge.api.hris.types.SyncStatus; +import com.merge.api.hris.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawTeamsClient.java b/src/main/java/com/merge/api/hris/RawTeamsClient.java new file mode 100644 index 000000000..244562aad --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawTeamsClient.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedTeamList; +import com.merge.api.hris.types.Team; +import com.merge.api.hris.types.TeamsListRequest; +import com.merge.api.hris.types.TeamsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTeamsClient { + protected final ClientOptions clientOptions; + + public RawTeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Team objects. + */ + public MergeApiHttpResponse> list() { + return list(TeamsListRequest.builder().build()); + } + + /** + * Returns a list of Team objects. + */ + public MergeApiHttpResponse> list(TeamsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Team objects. + */ + public MergeApiHttpResponse> list( + TeamsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/teams"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentTeamId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_team_id", request.getParentTeamId().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTeamList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + Optional startingAfter = parsedResponse.getNext(); + TeamsListRequest nextRequest = TeamsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Team object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TeamsRetrieveRequest.builder().build()); + } + + /** + * Returns a Team object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Team object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/teams") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java b/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java new file mode 100644 index 000000000..694d43bdd --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java @@ -0,0 +1,245 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.PaginatedTimeOffBalanceList; +import com.merge.api.hris.types.TimeOffBalance; +import com.merge.api.hris.types.TimeOffBalancesListRequest; +import com.merge.api.hris.types.TimeOffBalancesRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTimeOffBalancesClient { + protected final ClientOptions clientOptions; + + public RawTimeOffBalancesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public MergeApiHttpResponse> list() { + return list(TimeOffBalancesListRequest.builder().build()); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public MergeApiHttpResponse> list(TimeOffBalancesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public MergeApiHttpResponse> list( + TimeOffBalancesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off-balances"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getPolicyType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "policy_type", request.getPolicyType().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTimeOffBalanceList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimeOffBalanceList.class); + Optional startingAfter = parsedResponse.getNext(); + TimeOffBalancesListRequest nextRequest = TimeOffBalancesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TimeOffBalancesRetrieveRequest.builder().build()); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TimeOffBalancesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, TimeOffBalancesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off-balances") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffBalance.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawTimeOffClient.java b/src/main/java/com/merge/api/hris/RawTimeOffClient.java new file mode 100644 index 000000000..151883a0e --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawTimeOffClient.java @@ -0,0 +1,384 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.PaginatedTimeOffList; +import com.merge.api.hris.types.TimeOff; +import com.merge.api.hris.types.TimeOffEndpointRequest; +import com.merge.api.hris.types.TimeOffListRequest; +import com.merge.api.hris.types.TimeOffResponse; +import com.merge.api.hris.types.TimeOffRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTimeOffClient { + protected final ClientOptions clientOptions; + + public RawTimeOffClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TimeOff objects. + */ + public MergeApiHttpResponse> list() { + return list(TimeOffListRequest.builder().build()); + } + + /** + * Returns a list of TimeOff objects. + */ + public MergeApiHttpResponse> list(TimeOffListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TimeOff objects. + */ + public MergeApiHttpResponse> list( + TimeOffListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off"); + if (request.getApproverId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "approver_id", request.getApproverId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRequestType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "request_type", request.getRequestType().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTimeOffList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimeOffList.class); + Optional startingAfter = parsedResponse.getNext(); + TimeOffListRequest nextRequest = TimeOffListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a TimeOff object with the given values. + */ + public MergeApiHttpResponse create(TimeOffEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a TimeOff object with the given values. + */ + public MergeApiHttpResponse create(TimeOffEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a TimeOff object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TimeOffRetrieveRequest.builder().build()); + } + + /** + * Returns a TimeOff object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TimeOffRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TimeOff object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, TimeOffRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOff.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/time-off/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java b/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java new file mode 100644 index 000000000..79ce7ab45 --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java @@ -0,0 +1,356 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.PaginatedTimesheetEntryList; +import com.merge.api.hris.types.TimesheetEntriesListRequest; +import com.merge.api.hris.types.TimesheetEntriesRetrieveRequest; +import com.merge.api.hris.types.TimesheetEntry; +import com.merge.api.hris.types.TimesheetEntryEndpointRequest; +import com.merge.api.hris.types.TimesheetEntryResponse; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTimesheetEntriesClient { + protected final ClientOptions clientOptions; + + public RawTimesheetEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public MergeApiHttpResponse> list() { + return list(TimesheetEntriesListRequest.builder().build()); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public MergeApiHttpResponse> list(TimesheetEntriesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public MergeApiHttpResponse> list( + TimesheetEntriesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } + if (request.getEndedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_after", request.getEndedAfter().get().toString(), false); + } + if (request.getEndedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ended_before", request.getEndedBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get().toString(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getStartedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_after", request.getStartedAfter().get().toString(), false); + } + if (request.getStartedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "started_before", request.getStartedBefore().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTimesheetEntryList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimesheetEntryList.class); + Optional startingAfter = parsedResponse.getNext(); + TimesheetEntriesListRequest nextRequest = TimesheetEntriesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public MergeApiHttpResponse create(TimesheetEntryEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public MergeApiHttpResponse create( + TimesheetEntryEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimesheetEntryResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TimesheetEntriesRetrieveRequest.builder().build()); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TimesheetEntriesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, TimesheetEntriesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimesheetEntry.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/timesheet-entries/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java new file mode 100644 index 000000000..ec362ddae --- /dev/null +++ b/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.WebhookReceiver; +import com.merge.api.hris.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("hris/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/hris/RegenerateKeyClient.java b/src/main/java/com/merge/api/hris/RegenerateKeyClient.java new file mode 100644 index 000000000..24db1abec --- /dev/null +++ b/src/main/java/com/merge/api/hris/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.RemoteKey; +import com.merge.api.hris.types.RemoteKeyForRegenerationRequest; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/ScopesClient.java b/src/main/java/com/merge/api/hris/ScopesClient.java new file mode 100644 index 000000000..95cc5d6b7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.CommonModelScopeApi; +import com.merge.api.hris.types.LinkedAccountCommonModelScopeDeserializerRequest; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/SyncStatusClient.java b/src/main/java/com/merge/api/hris/SyncStatusClient.java new file mode 100644 index 000000000..f659cf201 --- /dev/null +++ b/src/main/java/com/merge/api/hris/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.SyncStatus; +import com.merge.api.hris.types.SyncStatusListRequest; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/TeamsClient.java b/src/main/java/com/merge/api/hris/TeamsClient.java new file mode 100644 index 000000000..2d6ba5087 --- /dev/null +++ b/src/main/java/com/merge/api/hris/TeamsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.Team; +import com.merge.api.hris.types.TeamsListRequest; +import com.merge.api.hris.types.TeamsRetrieveRequest; + +public class TeamsClient { + protected final ClientOptions clientOptions; + + private final RawTeamsClient rawClient; + + public TeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTeamsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTeamsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Team objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Team objects. + */ + public SyncPagingIterable list(TeamsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Team objects. + */ + public SyncPagingIterable list(TeamsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Team object with the given id. + */ + public Team retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Team object with the given id. + */ + public Team retrieve(String id, TeamsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Team object with the given id. + */ + public Team retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/TimeOffBalancesClient.java b/src/main/java/com/merge/api/hris/TimeOffBalancesClient.java new file mode 100644 index 000000000..080eb36ee --- /dev/null +++ b/src/main/java/com/merge/api/hris/TimeOffBalancesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.TimeOffBalance; +import com.merge.api.hris.types.TimeOffBalancesListRequest; +import com.merge.api.hris.types.TimeOffBalancesRetrieveRequest; + +public class TimeOffBalancesClient { + protected final ClientOptions clientOptions; + + private final RawTimeOffBalancesClient rawClient; + + public TimeOffBalancesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTimeOffBalancesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTimeOffBalancesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public SyncPagingIterable list(TimeOffBalancesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of TimeOffBalance objects. + */ + public SyncPagingIterable list(TimeOffBalancesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public TimeOffBalance retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public TimeOffBalance retrieve(String id, TimeOffBalancesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a TimeOffBalance object with the given id. + */ + public TimeOffBalance retrieve(String id, TimeOffBalancesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/TimeOffClient.java b/src/main/java/com/merge/api/hris/TimeOffClient.java new file mode 100644 index 000000000..8490bd57e --- /dev/null +++ b/src/main/java/com/merge/api/hris/TimeOffClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.TimeOff; +import com.merge.api.hris.types.TimeOffEndpointRequest; +import com.merge.api.hris.types.TimeOffListRequest; +import com.merge.api.hris.types.TimeOffResponse; +import com.merge.api.hris.types.TimeOffRetrieveRequest; + +public class TimeOffClient { + protected final ClientOptions clientOptions; + + private final RawTimeOffClient rawClient; + + public TimeOffClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTimeOffClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTimeOffClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TimeOff objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of TimeOff objects. + */ + public SyncPagingIterable list(TimeOffListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of TimeOff objects. + */ + public SyncPagingIterable list(TimeOffListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a TimeOff object with the given values. + */ + public TimeOffResponse create(TimeOffEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a TimeOff object with the given values. + */ + public TimeOffResponse create(TimeOffEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a TimeOff object with the given id. + */ + public TimeOff retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a TimeOff object with the given id. + */ + public TimeOff retrieve(String id, TimeOffRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a TimeOff object with the given id. + */ + public TimeOff retrieve(String id, TimeOffRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for TimeOff POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/TimesheetEntriesClient.java b/src/main/java/com/merge/api/hris/TimesheetEntriesClient.java new file mode 100644 index 000000000..fefa9d135 --- /dev/null +++ b/src/main/java/com/merge/api/hris/TimesheetEntriesClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.hris.types.MetaResponse; +import com.merge.api.hris.types.TimesheetEntriesListRequest; +import com.merge.api.hris.types.TimesheetEntriesRetrieveRequest; +import com.merge.api.hris.types.TimesheetEntry; +import com.merge.api.hris.types.TimesheetEntryEndpointRequest; +import com.merge.api.hris.types.TimesheetEntryResponse; + +public class TimesheetEntriesClient { + protected final ClientOptions clientOptions; + + private final RawTimesheetEntriesClient rawClient; + + public TimesheetEntriesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTimesheetEntriesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTimesheetEntriesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public SyncPagingIterable list(TimesheetEntriesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of TimesheetEntry objects. + */ + public SyncPagingIterable list(TimesheetEntriesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public TimesheetEntryResponse create(TimesheetEntryEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a TimesheetEntry object with the given values. + */ + public TimesheetEntryResponse create(TimesheetEntryEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public TimesheetEntry retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public TimesheetEntry retrieve(String id, TimesheetEntriesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a TimesheetEntry object with the given id. + */ + public TimesheetEntry retrieve(String id, TimesheetEntriesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for TimesheetEntry POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/WebhookReceiversClient.java b/src/main/java/com/merge/api/hris/WebhookReceiversClient.java new file mode 100644 index 000000000..3b49c039e --- /dev/null +++ b/src/main/java/com/merge/api/hris/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.hris.types.WebhookReceiver; +import com.merge.api.hris.types.WebhookReceiverRequest; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/hris/types/AccountDetails.java b/src/main/java/com/merge/api/hris/types/AccountDetails.java new file mode 100644 index 000000000..d79068675 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AccountDetails.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..9e450b52e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatusEnum status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatusEnum status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatusEnum getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(CategoryEnum category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatusEnum status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

The tenant or domain the customer has provided access to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..0cd9cdfcb --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..c3025c707 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountDetailsAndActionsStatusEnum { + COMPLETE("COMPLETE"), + + INCOMPLETE("INCOMPLETE"), + + RELINK_NEEDED("RELINK_NEEDED"), + + IDLE("IDLE"); + + private final String value; + + AccountDetailsAndActionsStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/AccountIntegration.java b/src/main/java/com/merge/api/hris/types/AccountIntegration.java new file mode 100644 index 000000000..d2df5d64f --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AccountIntegration.java @@ -0,0 +1,463 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

Company name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

Category or categories this integration is in beta status for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

Company logo in square shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

Company logo in rectangular shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AccountToken.java b/src/main/java/com/merge/api/hris/types/AccountToken.java new file mode 100644 index 000000000..0916d8037 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/AccountTypeEnum.java b/src/main/java/com/merge/api/hris/types/AccountTypeEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/types/AccountTypeEnum.java rename to src/main/java/com/merge/api/hris/types/AccountTypeEnum.java index 14d48fae3..534839dac 100644 --- a/src/main/java/com/merge/api/resources/hris/types/AccountTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/AccountTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/AdvancedMetadata.java b/src/main/java/com/merge/api/hris/types/AdvancedMetadata.java new file mode 100644 index 000000000..5c1532028 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/hris/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..d93afa7fc --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/hris/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..29cd64695 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AuditLogEvent.java b/src/main/java/com/merge/api/hris/types/AuditLogEvent.java new file mode 100644 index 000000000..5f93ef538 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AuditLogEvent.java @@ -0,0 +1,449 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final RoleEnum role; + + private final String ipAddress; + + private final EventTypeEnum eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + RoleEnum role, + String ipAddress, + EventTypeEnum eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ */ + @JsonProperty("role") + public RoleEnum getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ */ + @JsonProperty("event_type") + public EventTypeEnum getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + IpAddressStage role(@NotNull RoleEnum role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + EventDescriptionStage eventType(@NotNull EventTypeEnum eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private RoleEnum role; + + private String ipAddress; + + private EventTypeEnum eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

+ *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull RoleEnum role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

Designates the type of event that occurred.

+ *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull EventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The User's email at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

The User's full name at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/hris/types/AuditTrailListRequest.java new file mode 100644 index 000000000..fdf8b6244 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AuditTrailListRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AvailableActions.java b/src/main/java/com/merge/api/hris/types/AvailableActions.java new file mode 100644 index 000000000..df5879d14 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/BankInfo.java b/src/main/java/com/merge/api/hris/types/BankInfo.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/types/BankInfo.java rename to src/main/java/com/merge/api/hris/types/BankInfo.java index 85d3963ec..0f0ceb455 100644 --- a/src/main/java/com/merge/api/resources/hris/types/BankInfo.java +++ b/src/main/java/com/merge/api/hris/types/BankInfo.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -39,7 +39,7 @@ public final class BankInfo { private final Optional bankName; - private final Optional accountType; + private final Optional accountType; private final Optional remoteCreatedAt; @@ -60,7 +60,7 @@ private BankInfo( Optional accountNumber, Optional routingNumber, Optional bankName, - Optional accountType, + Optional accountType, Optional remoteCreatedAt, Optional remoteWasDeleted, Optional> fieldMappings, @@ -151,7 +151,7 @@ public Optional getBankName() { * */ @JsonProperty("account_type") - public Optional getAccountType() { + public Optional getAccountType() { return accountType; } @@ -253,7 +253,7 @@ public static final class Builder { private Optional bankName = Optional.empty(); - private Optional accountType = Optional.empty(); + private Optional accountType = Optional.empty(); private Optional remoteCreatedAt = Optional.empty(); @@ -374,12 +374,12 @@ public Builder bankName(String bankName) { } @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { + public Builder accountType(Optional accountType) { this.accountType = accountType; return this; } - public Builder accountType(BankInfoAccountType accountType) { + public Builder accountType(AccountTypeEnum accountType) { this.accountType = Optional.ofNullable(accountType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/BankInfoEmployee.java b/src/main/java/com/merge/api/hris/types/BankInfoEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/BankInfoEmployee.java rename to src/main/java/com/merge/api/hris/types/BankInfoEmployee.java index 2fa1119b5..105cf99c4 100644 --- a/src/main/java/com/merge/api/resources/hris/types/BankInfoEmployee.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public BankInfoEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public BankInfoEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/bankinfo/requests/BankInfoListRequest.java b/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/bankinfo/requests/BankInfoListRequest.java rename to src/main/java/com/merge/api/hris/types/BankInfoListRequest.java index 4c376d118..7d99a97a8 100644 --- a/src/main/java/com/merge/api/resources/hris/bankinfo/requests/BankInfoListRequest.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.bankinfo.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,10 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.bankinfo.types.BankInfoListRequestAccountType; -import com.merge.api.resources.hris.bankinfo.types.BankInfoListRequestOrderBy; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankInfoListRequest.Builder.class) public final class BankInfoListRequest { + private final Optional> expand; + private final Optional accountType; private final Optional bankName; @@ -35,8 +37,6 @@ public final class BankInfoListRequest { private final Optional employeeId; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -60,13 +60,13 @@ public final class BankInfoListRequest { private final Map additionalProperties; private BankInfoListRequest( + Optional> expand, Optional accountType, Optional bankName, Optional createdAfter, Optional createdBefore, Optional cursor, Optional employeeId, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -78,13 +78,13 @@ private BankInfoListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.accountType = accountType; this.bankName = bankName; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.employeeId = employeeId; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -98,6 +98,14 @@ private BankInfoListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return BankInfo's with this account type. Options: ('SAVINGS', 'CHECKING') *
    @@ -150,14 +158,6 @@ public Optional getEmployeeId() { return employeeId; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -250,13 +250,13 @@ public Map getAdditionalProperties() { } private boolean equalTo(BankInfoListRequest other) { - return accountType.equals(other.accountType) + return expand.equals(other.expand) + && accountType.equals(other.accountType) && bankName.equals(other.bankName) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && employeeId.equals(other.employeeId) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -272,13 +272,13 @@ private boolean equalTo(BankInfoListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.accountType, this.bankName, this.createdAfter, this.createdBefore, this.cursor, this.employeeId, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -302,6 +302,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional accountType = Optional.empty(); private Optional bankName = Optional.empty(); @@ -314,8 +316,6 @@ public static final class Builder { private Optional employeeId = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -342,13 +342,13 @@ public static final class Builder { private Builder() {} public Builder from(BankInfoListRequest other) { + expand(other.getExpand()); accountType(other.getAccountType()); bankName(other.getBankName()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); employeeId(other.getEmployeeId()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -362,6 +362,22 @@ public Builder from(BankInfoListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) public Builder accountType(Optional accountType) { this.accountType = accountType; @@ -428,17 +444,6 @@ public Builder employeeId(String employeeId) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -551,13 +556,13 @@ public Builder showEnumOrigins(String showEnumOrigins) { public BankInfoListRequest build() { return new BankInfoListRequest( + expand, accountType, bankName, createdAfter, createdBefore, cursor, employeeId, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/hris/bankinfo/types/BankInfoListRequestAccountType.java b/src/main/java/com/merge/api/hris/types/BankInfoListRequestAccountType.java similarity index 89% rename from src/main/java/com/merge/api/resources/hris/bankinfo/types/BankInfoListRequestAccountType.java rename to src/main/java/com/merge/api/hris/types/BankInfoListRequestAccountType.java index 78f82f35b..72736cc03 100644 --- a/src/main/java/com/merge/api/resources/hris/bankinfo/types/BankInfoListRequestAccountType.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequestAccountType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.bankinfo.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/bankinfo/types/BankInfoListRequestOrderBy.java b/src/main/java/com/merge/api/hris/types/BankInfoListRequestOrderBy.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/bankinfo/types/BankInfoListRequestOrderBy.java rename to src/main/java/com/merge/api/hris/types/BankInfoListRequestOrderBy.java index 0113d6aff..3a8a78dbb 100644 --- a/src/main/java/com/merge/api/resources/hris/bankinfo/types/BankInfoListRequestOrderBy.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequestOrderBy.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.bankinfo.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/bankinfo/requests/BankInfoRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequest.java similarity index 75% rename from src/main/java/com/merge/api/resources/hris/bankinfo/requests/BankInfoRetrieveRequest.java rename to src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequest.java index b3b148909..416068551 100644 --- a/src/main/java/com/merge/api/resources/hris/bankinfo/requests/BankInfoRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.bankinfo.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -20,10 +22,12 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankInfoRetrieveRequest.Builder.class) public final class BankInfoRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -31,13 +35,15 @@ public final class BankInfoRetrieveRequest { private final Map additionalProperties; private BankInfoRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -47,7 +53,7 @@ private BankInfoRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -59,6 +65,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -89,13 +103,15 @@ public Map getAdditionalProperties() { private boolean equalTo(BankInfoRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -109,10 +125,12 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -125,22 +143,28 @@ private Builder() {} public Builder from(BankInfoRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(String expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -152,6 +176,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -176,7 +211,7 @@ public Builder showEnumOrigins(String showEnumOrigins) { public BankInfoRetrieveRequest build() { return new BankInfoRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/hris/types/Benefit.java b/src/main/java/com/merge/api/hris/types/Benefit.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/Benefit.java rename to src/main/java/com/merge/api/hris/types/Benefit.java index 0e73c7aff..d419fad27 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Benefit.java +++ b/src/main/java/com/merge/api/hris/types/Benefit.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/BenefitEmployee.java b/src/main/java/com/merge/api/hris/types/BenefitEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/BenefitEmployee.java rename to src/main/java/com/merge/api/hris/types/BenefitEmployee.java index 9b0c4a1f7..896e9bf1b 100644 --- a/src/main/java/com/merge/api/resources/hris/types/BenefitEmployee.java +++ b/src/main/java/com/merge/api/hris/types/BenefitEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public BenefitEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public BenefitEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/BenefitPlanTypeEnum.java b/src/main/java/com/merge/api/hris/types/BenefitPlanTypeEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/types/BenefitPlanTypeEnum.java rename to src/main/java/com/merge/api/hris/types/BenefitPlanTypeEnum.java index 5a58e1602..d0e4dc0ce 100644 --- a/src/main/java/com/merge/api/resources/hris/types/BenefitPlanTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/BenefitPlanTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/benefits/requests/BenefitsListRequest.java b/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/benefits/requests/BenefitsListRequest.java rename to src/main/java/com/merge/api/hris/types/BenefitsListRequest.java index 9888695b9..67e7836d8 100644 --- a/src/main/java/com/merge/api/resources/hris/benefits/requests/BenefitsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.benefits.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -13,7 +13,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BenefitsListRequest.Builder.class) public final class BenefitsListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -29,8 +33,6 @@ public final class BenefitsListRequest { private final Optional employeeId; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -48,11 +50,11 @@ public final class BenefitsListRequest { private final Map additionalProperties; private BenefitsListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional employeeId, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,11 +63,11 @@ private BenefitsListRequest( Optional pageSize, Optional remoteId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.employeeId = employeeId; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -76,6 +78,14 @@ private BenefitsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -108,14 +118,6 @@ public Optional getEmployeeId() { return employeeId; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -184,11 +186,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(BenefitsListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && employeeId.equals(other.employeeId) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -201,11 +203,11 @@ private boolean equalTo(BenefitsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.employeeId, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -226,6 +228,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -234,8 +238,6 @@ public static final class Builder { private Optional employeeId = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -256,11 +258,11 @@ public static final class Builder { private Builder() {} public Builder from(BenefitsListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); employeeId(other.getEmployeeId()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -271,6 +273,22 @@ public Builder from(BenefitsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -315,17 +333,6 @@ public Builder employeeId(String employeeId) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -405,11 +412,11 @@ public Builder remoteId(String remoteId) { public BenefitsListRequest build() { return new BenefitsListRequest( + expand, createdAfter, createdBefore, cursor, employeeId, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequest.java new file mode 100644 index 000000000..90ab52b4e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BenefitsRetrieveRequest.Builder.class) +public final class BenefitsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private BenefitsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BenefitsRetrieveRequest && equalTo((BenefitsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BenefitsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BenefitsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public BenefitsRetrieveRequest build() { + return new BenefitsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/CategoriesEnum.java b/src/main/java/com/merge/api/hris/types/CategoriesEnum.java new file mode 100644 index 000000000..7ece078c4 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoriesEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoriesEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/CategoryEnum.java b/src/main/java/com/merge/api/hris/types/CategoryEnum.java new file mode 100644 index 000000000..957d35e0f --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoryEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/hris/types/CommonModelScopeApi.java new file mode 100644 index 000000000..db551224e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/CommonModelScopeApi.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/hris/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..5f6c42d19 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/companies/requests/CompaniesListRequest.java b/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/companies/requests/CompaniesListRequest.java rename to src/main/java/com/merge/api/hris/types/CompaniesListRequest.java index 806cdb13d..b5bb60f49 100644 --- a/src/main/java/com/merge/api/resources/hris/companies/requests/CompaniesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.companies.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/CompaniesRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/CompaniesRetrieveRequest.java new file mode 100644 index 000000000..550ad59c3 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/CompaniesRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CompaniesRetrieveRequest.Builder.class) +public final class CompaniesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private CompaniesRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompaniesRetrieveRequest && equalTo((CompaniesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompaniesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CompaniesRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public CompaniesRetrieveRequest build() { + return new CompaniesRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/Company.java b/src/main/java/com/merge/api/hris/types/Company.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/Company.java rename to src/main/java/com/merge/api/hris/types/Company.java index 6a0cf919a..8f55a3b78 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Company.java +++ b/src/main/java/com/merge/api/hris/types/Company.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/CountryEnum.java b/src/main/java/com/merge/api/hris/types/CountryEnum.java new file mode 100644 index 000000000..5f1e4aaad --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/CountryEnum.java @@ -0,0 +1,518 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CountryEnum { + AF("AF"), + + AX("AX"), + + AL("AL"), + + DZ("DZ"), + + AS("AS"), + + AD("AD"), + + AO("AO"), + + AI("AI"), + + AQ("AQ"), + + AG("AG"), + + AR("AR"), + + AM("AM"), + + AW("AW"), + + AU("AU"), + + AT("AT"), + + AZ("AZ"), + + BS("BS"), + + BH("BH"), + + BD("BD"), + + BB("BB"), + + BY("BY"), + + BE("BE"), + + BZ("BZ"), + + BJ("BJ"), + + BM("BM"), + + BT("BT"), + + BO("BO"), + + BQ("BQ"), + + BA("BA"), + + BW("BW"), + + BV("BV"), + + BR("BR"), + + IO("IO"), + + BN("BN"), + + BG("BG"), + + BF("BF"), + + BI("BI"), + + CV("CV"), + + KH("KH"), + + CM("CM"), + + CA("CA"), + + KY("KY"), + + CF("CF"), + + TD("TD"), + + CL("CL"), + + CN("CN"), + + CX("CX"), + + CC("CC"), + + CO("CO"), + + KM("KM"), + + CG("CG"), + + CD("CD"), + + CK("CK"), + + CR("CR"), + + CI("CI"), + + HR("HR"), + + CU("CU"), + + CW("CW"), + + CY("CY"), + + CZ("CZ"), + + DK("DK"), + + DJ("DJ"), + + DM("DM"), + + DO("DO"), + + EC("EC"), + + EG("EG"), + + SV("SV"), + + GQ("GQ"), + + ER("ER"), + + EE("EE"), + + SZ("SZ"), + + ET("ET"), + + FK("FK"), + + FO("FO"), + + FJ("FJ"), + + FI("FI"), + + FR("FR"), + + GF("GF"), + + PF("PF"), + + TF("TF"), + + GA("GA"), + + GM("GM"), + + GE("GE"), + + DE("DE"), + + GH("GH"), + + GI("GI"), + + GR("GR"), + + GL("GL"), + + GD("GD"), + + GP("GP"), + + GU("GU"), + + GT("GT"), + + GG("GG"), + + GN("GN"), + + GW("GW"), + + GY("GY"), + + HT("HT"), + + HM("HM"), + + VA("VA"), + + HN("HN"), + + HK("HK"), + + HU("HU"), + + IS("IS"), + + IN("IN"), + + ID("ID"), + + IR("IR"), + + IQ("IQ"), + + IE("IE"), + + IM("IM"), + + IL("IL"), + + IT("IT"), + + JM("JM"), + + JP("JP"), + + JE("JE"), + + JO("JO"), + + KZ("KZ"), + + KE("KE"), + + KI("KI"), + + KW("KW"), + + KG("KG"), + + LA("LA"), + + LV("LV"), + + LB("LB"), + + LS("LS"), + + LR("LR"), + + LY("LY"), + + LI("LI"), + + LT("LT"), + + LU("LU"), + + MO("MO"), + + MG("MG"), + + MW("MW"), + + MY("MY"), + + MV("MV"), + + ML("ML"), + + MT("MT"), + + MH("MH"), + + MQ("MQ"), + + MR("MR"), + + MU("MU"), + + YT("YT"), + + MX("MX"), + + FM("FM"), + + MD("MD"), + + MC("MC"), + + MN("MN"), + + ME("ME"), + + MS("MS"), + + MA("MA"), + + MZ("MZ"), + + MM("MM"), + + NA("NA"), + + NR("NR"), + + NP("NP"), + + NL("NL"), + + NC("NC"), + + NZ("NZ"), + + NI("NI"), + + NE("NE"), + + NG("NG"), + + NU("NU"), + + NF("NF"), + + KP("KP"), + + MK("MK"), + + MP("MP"), + + NO("NO"), + + OM("OM"), + + PK("PK"), + + PW("PW"), + + PS("PS"), + + PA("PA"), + + PG("PG"), + + PY("PY"), + + PE("PE"), + + PH("PH"), + + PN("PN"), + + PL("PL"), + + PT("PT"), + + PR("PR"), + + QA("QA"), + + RE("RE"), + + RO("RO"), + + RU("RU"), + + RW("RW"), + + BL("BL"), + + SH("SH"), + + KN("KN"), + + LC("LC"), + + MF("MF"), + + PM("PM"), + + VC("VC"), + + WS("WS"), + + SM("SM"), + + ST("ST"), + + SA("SA"), + + SN("SN"), + + RS("RS"), + + SC("SC"), + + SL("SL"), + + SG("SG"), + + SX("SX"), + + SK("SK"), + + SI("SI"), + + SB("SB"), + + SO("SO"), + + ZA("ZA"), + + GS("GS"), + + KR("KR"), + + SS("SS"), + + ES("ES"), + + LK("LK"), + + SD("SD"), + + SR("SR"), + + SJ("SJ"), + + SE("SE"), + + CH("CH"), + + SY("SY"), + + TW("TW"), + + TJ("TJ"), + + TZ("TZ"), + + TH("TH"), + + TL("TL"), + + TG("TG"), + + TK("TK"), + + TO("TO"), + + TT("TT"), + + TN("TN"), + + TR("TR"), + + TM("TM"), + + TC("TC"), + + TV("TV"), + + UG("UG"), + + UA("UA"), + + AE("AE"), + + GB("GB"), + + UM("UM"), + + US("US"), + + UY("UY"), + + UZ("UZ"), + + VU("VU"), + + VE("VE"), + + VN("VN"), + + VG("VG"), + + VI("VI"), + + WF("WF"), + + EH("EH"), + + YE("YE"), + + ZM("ZM"), + + ZW("ZW"); + + private final String value; + + CountryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/hris/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..7ed1f1ee1 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/CreateFieldMappingRequest.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final String targetFieldName; + + private final String targetFieldDescription; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + String targetFieldName, + String targetFieldDescription, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return The name of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_name") + public String getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_description") + public String getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TargetFieldNameStage builder() { + return new Builder(); + } + + public interface TargetFieldNameStage { + TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); + + Builder from(CreateFieldMappingRequest other); + } + + public interface TargetFieldDescriptionStage { + RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); + } + + public interface RemoteMethodStage { + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + } + + public interface RemoteUrlPathStage { + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TargetFieldNameStage, + TargetFieldDescriptionStage, + RemoteMethodStage, + RemoteUrlPathStage, + CommonModelNameStage, + _FinalStage { + private String targetFieldName; + + private String targetFieldDescription; + + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + return this; + } + + /** + *

    The name of the target field you want this remote field to map to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_name") + public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

    The description of the target field you want this remote field to map to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_description") + public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

    The method of the remote endpoint where the remote field is coming from.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

    The path of the remote endpoint where the remote field is coming from.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

    The name of the Common Model that the remote field corresponds to in a given category.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

    If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/hris/types/DataPassthroughRequest.java new file mode 100644 index 000000000..e4597817a --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/DataPassthroughRequest.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final MethodEnum method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + MethodEnum method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public MethodEnum getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull MethodEnum method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + _FinalStage data(Optional data); + + _FinalStage data(String data); + + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(RequestFormatEnum requestFormat); + + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private MethodEnum method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull MethodEnum method) { + this.method = method; + return this; + } + + /** + *

    The path of the request in the third party's platform.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

    Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

    The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

    Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

    The data with the request. You must include a request_format parameter matching the data's format

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

    An optional override of the third party's base url for the request.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/DebugModeLog.java b/src/main/java/com/merge/api/hris/types/DebugModeLog.java new file mode 100644 index 000000000..3afc11775 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/hris/types/DebugModelLogSummary.java new file mode 100644 index 000000000..01771a74b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/Deduction.java b/src/main/java/com/merge/api/hris/types/Deduction.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/Deduction.java rename to src/main/java/com/merge/api/hris/types/Deduction.java index 120f26772..11f44c158 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Deduction.java +++ b/src/main/java/com/merge/api/hris/types/Deduction.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/Dependent.java b/src/main/java/com/merge/api/hris/types/Dependent.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/Dependent.java rename to src/main/java/com/merge/api/hris/types/Dependent.java index 3145491f7..b417240da 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Dependent.java +++ b/src/main/java/com/merge/api/hris/types/Dependent.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,13 +37,13 @@ public final class Dependent { private final Optional lastName; - private final Optional relationship; + private final Optional relationship; private final Optional employee; private final Optional dateOfBirth; - private final Optional gender; + private final Optional gender; private final Optional phoneNumber; @@ -69,10 +69,10 @@ private Dependent( Optional firstName, Optional middleName, Optional lastName, - Optional relationship, + Optional relationship, Optional employee, Optional dateOfBirth, - Optional gender, + Optional gender, Optional phoneNumber, Optional homeLocation, Optional isStudent, @@ -164,7 +164,7 @@ public Optional getLastName() { *
*/ @JsonProperty("relationship") - public Optional getRelationship() { + public Optional getRelationship() { return relationship; } @@ -195,7 +195,7 @@ public Optional getDateOfBirth() { * */ @JsonProperty("gender") - public Optional getGender() { + public Optional getGender() { return gender; } @@ -329,13 +329,13 @@ public static final class Builder { private Optional lastName = Optional.empty(); - private Optional relationship = Optional.empty(); + private Optional relationship = Optional.empty(); private Optional employee = Optional.empty(); private Optional dateOfBirth = Optional.empty(); - private Optional gender = Optional.empty(); + private Optional gender = Optional.empty(); private Optional phoneNumber = Optional.empty(); @@ -456,12 +456,12 @@ public Builder lastName(String lastName) { } @JsonSetter(value = "relationship", nulls = Nulls.SKIP) - public Builder relationship(Optional relationship) { + public Builder relationship(Optional relationship) { this.relationship = relationship; return this; } - public Builder relationship(DependentRelationship relationship) { + public Builder relationship(RelationshipEnum relationship) { this.relationship = Optional.ofNullable(relationship); return this; } @@ -489,12 +489,12 @@ public Builder dateOfBirth(OffsetDateTime dateOfBirth) { } @JsonSetter(value = "gender", nulls = Nulls.SKIP) - public Builder gender(Optional gender) { + public Builder gender(Optional gender) { this.gender = gender; return this; } - public Builder gender(DependentGender gender) { + public Builder gender(GenderEnum gender) { this.gender = Optional.ofNullable(gender); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/dependents/requests/DependentsListRequest.java b/src/main/java/com/merge/api/hris/types/DependentsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/dependents/requests/DependentsListRequest.java rename to src/main/java/com/merge/api/hris/types/DependentsListRequest.java index 627683ac4..3db599881 100644 --- a/src/main/java/com/merge/api/resources/hris/dependents/requests/DependentsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/DependentsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.dependents.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/dependents/requests/DependentsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/DependentsRetrieveRequest.java similarity index 76% rename from src/main/java/com/merge/api/resources/hris/dependents/requests/DependentsRetrieveRequest.java rename to src/main/java/com/merge/api/hris/types/DependentsRetrieveRequest.java index 5d9466ae4..a4f38fbfe 100644 --- a/src/main/java/com/merge/api/resources/hris/dependents/requests/DependentsRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/DependentsRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.dependents.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -24,14 +24,18 @@ public final class DependentsRetrieveRequest { private final Optional includeSensitiveFields; + private final Optional includeShellData; + private final Map additionalProperties; private DependentsRetrieveRequest( Optional includeRemoteData, Optional includeSensitiveFields, + Optional includeShellData, Map additionalProperties) { this.includeRemoteData = includeRemoteData; this.includeSensitiveFields = includeSensitiveFields; + this.includeShellData = includeShellData; this.additionalProperties = additionalProperties; } @@ -51,6 +55,14 @@ public Optional getIncludeSensitiveFields() { return includeSensitiveFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -64,12 +76,13 @@ public Map getAdditionalProperties() { private boolean equalTo(DependentsRetrieveRequest other) { return includeRemoteData.equals(other.includeRemoteData) - && includeSensitiveFields.equals(other.includeSensitiveFields); + && includeSensitiveFields.equals(other.includeSensitiveFields) + && includeShellData.equals(other.includeShellData); } @java.lang.Override public int hashCode() { - return Objects.hash(this.includeRemoteData, this.includeSensitiveFields); + return Objects.hash(this.includeRemoteData, this.includeSensitiveFields, this.includeShellData); } @java.lang.Override @@ -87,6 +100,8 @@ public static final class Builder { private Optional includeSensitiveFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -95,6 +110,7 @@ private Builder() {} public Builder from(DependentsRetrieveRequest other) { includeRemoteData(other.getIncludeRemoteData()); includeSensitiveFields(other.getIncludeSensitiveFields()); + includeShellData(other.getIncludeShellData()); return this; } @@ -120,8 +136,20 @@ public Builder includeSensitiveFields(Boolean includeSensitiveFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + public DependentsRetrieveRequest build() { - return new DependentsRetrieveRequest(includeRemoteData, includeSensitiveFields, additionalProperties); + return new DependentsRetrieveRequest( + includeRemoteData, includeSensitiveFields, includeShellData, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/hris/types/Earning.java b/src/main/java/com/merge/api/hris/types/Earning.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/types/Earning.java rename to src/main/java/com/merge/api/hris/types/Earning.java index 6958d177b..80315dd01 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Earning.java +++ b/src/main/java/com/merge/api/hris/types/Earning.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,7 +35,7 @@ public final class Earning { private final Optional amount; - private final Optional type; + private final Optional type; private final Optional remoteWasDeleted; @@ -52,7 +52,7 @@ private Earning( Optional modifiedAt, Optional employeePayrollRun, Optional amount, - Optional type, + Optional type, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -122,7 +122,7 @@ public Optional getAmount() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -206,7 +206,7 @@ public static final class Builder { private Optional amount = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -300,12 +300,12 @@ public Builder amount(Double amount) { } @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(EarningType type) { + public Builder type(EarningTypeEnum type) { this.type = Optional.ofNullable(type); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/EarningTypeEnum.java b/src/main/java/com/merge/api/hris/types/EarningTypeEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/types/EarningTypeEnum.java rename to src/main/java/com/merge/api/hris/types/EarningTypeEnum.java index 27dfaaee2..ef9a42090 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EarningTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/EarningTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/Employee.java b/src/main/java/com/merge/api/hris/types/Employee.java new file mode 100644 index 000000000..e6705a5a8 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/Employee.java @@ -0,0 +1,1138 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Employee.Builder.class) +public final class Employee { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional employeeNumber; + + private final Optional company; + + private final Optional firstName; + + private final Optional lastName; + + private final Optional preferredName; + + private final Optional displayFullName; + + private final Optional username; + + private final Optional>> groups; + + private final Optional workEmail; + + private final Optional personalEmail; + + private final Optional mobilePhoneNumber; + + private final Optional>> employments; + + private final Optional homeLocation; + + private final Optional workLocation; + + private final Optional manager; + + private final Optional team; + + private final Optional payGroup; + + private final Optional ssn; + + private final Optional gender; + + private final Optional ethnicity; + + private final Optional maritalStatus; + + private final Optional dateOfBirth; + + private final Optional hireDate; + + private final Optional startDate; + + private final Optional remoteCreatedAt; + + private final Optional employmentStatus; + + private final Optional terminationDate; + + private final Optional avatar; + + private final Optional> customFields; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Employee( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional employeeNumber, + Optional company, + Optional firstName, + Optional lastName, + Optional preferredName, + Optional displayFullName, + Optional username, + Optional>> groups, + Optional workEmail, + Optional personalEmail, + Optional mobilePhoneNumber, + Optional>> employments, + Optional homeLocation, + Optional workLocation, + Optional manager, + Optional team, + Optional payGroup, + Optional ssn, + Optional gender, + Optional ethnicity, + Optional maritalStatus, + Optional dateOfBirth, + Optional hireDate, + Optional startDate, + Optional remoteCreatedAt, + Optional employmentStatus, + Optional terminationDate, + Optional avatar, + Optional> customFields, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.employeeNumber = employeeNumber; + this.company = company; + this.firstName = firstName; + this.lastName = lastName; + this.preferredName = preferredName; + this.displayFullName = displayFullName; + this.username = username; + this.groups = groups; + this.workEmail = workEmail; + this.personalEmail = personalEmail; + this.mobilePhoneNumber = mobilePhoneNumber; + this.employments = employments; + this.homeLocation = homeLocation; + this.workLocation = workLocation; + this.manager = manager; + this.team = team; + this.payGroup = payGroup; + this.ssn = ssn; + this.gender = gender; + this.ethnicity = ethnicity; + this.maritalStatus = maritalStatus; + this.dateOfBirth = dateOfBirth; + this.hireDate = hireDate; + this.startDate = startDate; + this.remoteCreatedAt = remoteCreatedAt; + this.employmentStatus = employmentStatus; + this.terminationDate = terminationDate; + this.avatar = avatar; + this.customFields = customFields; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The employee's number that appears in the third-party integration's UI. + */ + @JsonProperty("employee_number") + public Optional getEmployeeNumber() { + return employeeNumber; + } + + /** + * @return The ID of the employee's company. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The employee's first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The employee's last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return The employee's preferred first name. + */ + @JsonProperty("preferred_name") + public Optional getPreferredName() { + return preferredName; + } + + /** + * @return The employee's full name, to use for display purposes. If a preferred first name is available, the full name will include the preferred first name. + */ + @JsonProperty("display_full_name") + public Optional getDisplayFullName() { + return displayFullName; + } + + /** + * @return The employee's username that appears in the remote UI. + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + @JsonProperty("groups") + public Optional>> getGroups() { + return groups; + } + + /** + * @return The employee's work email. + */ + @JsonProperty("work_email") + public Optional getWorkEmail() { + return workEmail; + } + + /** + * @return The employee's personal email. + */ + @JsonProperty("personal_email") + public Optional getPersonalEmail() { + return personalEmail; + } + + /** + * @return The employee's mobile phone number. + */ + @JsonProperty("mobile_phone_number") + public Optional getMobilePhoneNumber() { + return mobilePhoneNumber; + } + + /** + * @return Array of Employment IDs for this Employee. + */ + @JsonProperty("employments") + public Optional>> getEmployments() { + return employments; + } + + /** + * @return The employee's home address. + */ + @JsonProperty("home_location") + public Optional getHomeLocation() { + return homeLocation; + } + + /** + * @return The employee's work address. + */ + @JsonProperty("work_location") + public Optional getWorkLocation() { + return workLocation; + } + + /** + * @return The employee ID of the employee's manager. + */ + @JsonProperty("manager") + public Optional getManager() { + return manager; + } + + /** + * @return The employee's team. + */ + @JsonProperty("team") + public Optional getTeam() { + return team; + } + + /** + * @return The employee's pay group + */ + @JsonProperty("pay_group") + public Optional getPayGroup() { + return payGroup; + } + + /** + * @return The employee's social security number. + */ + @JsonProperty("ssn") + public Optional getSsn() { + return ssn; + } + + /** + * @return The employee's gender. + *
    + *
  • MALE - MALE
  • + *
  • FEMALE - FEMALE
  • + *
  • NON-BINARY - NON-BINARY
  • + *
  • OTHER - OTHER
  • + *
  • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
  • + *
+ */ + @JsonProperty("gender") + public Optional getGender() { + return gender; + } + + /** + * @return The employee's ethnicity. + *
    + *
  • AMERICAN_INDIAN_OR_ALASKA_NATIVE - AMERICAN_INDIAN_OR_ALASKA_NATIVE
  • + *
  • ASIAN_OR_INDIAN_SUBCONTINENT - ASIAN_OR_INDIAN_SUBCONTINENT
  • + *
  • BLACK_OR_AFRICAN_AMERICAN - BLACK_OR_AFRICAN_AMERICAN
  • + *
  • HISPANIC_OR_LATINO - HISPANIC_OR_LATINO
  • + *
  • NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER
  • + *
  • TWO_OR_MORE_RACES - TWO_OR_MORE_RACES
  • + *
  • WHITE - WHITE
  • + *
  • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
  • + *
+ */ + @JsonProperty("ethnicity") + public Optional getEthnicity() { + return ethnicity; + } + + /** + * @return The employee's filing status as related to marital status. + *
    + *
  • SINGLE - SINGLE
  • + *
  • MARRIED_FILING_JOINTLY - MARRIED_FILING_JOINTLY
  • + *
  • MARRIED_FILING_SEPARATELY - MARRIED_FILING_SEPARATELY
  • + *
  • HEAD_OF_HOUSEHOLD - HEAD_OF_HOUSEHOLD
  • + *
  • QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD
  • + *
+ */ + @JsonProperty("marital_status") + public Optional getMaritalStatus() { + return maritalStatus; + } + + /** + * @return The employee's date of birth. + */ + @JsonProperty("date_of_birth") + public Optional getDateOfBirth() { + return dateOfBirth; + } + + /** + * @return The date that the employee was hired, usually the day that an offer letter is signed. If an employee has multiple hire dates from previous employments, this represents the most recent hire date. Note: If you're looking for the employee's start date, refer to the start_date field. + */ + @JsonProperty("hire_date") + public Optional getHireDate() { + return hireDate; + } + + /** + * @return The date that the employee started working. If an employee was rehired, the most recent start date will be returned. + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return When the third party's employee was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return The employment status of the employee. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • PENDING - PENDING
  • + *
  • INACTIVE - INACTIVE
  • + *
+ */ + @JsonProperty("employment_status") + public Optional getEmploymentStatus() { + return employmentStatus; + } + + /** + * @return The employee's termination date. + */ + @JsonProperty("termination_date") + public Optional getTerminationDate() { + return terminationDate; + } + + /** + * @return The URL of the employee's avatar image. + */ + @JsonProperty("avatar") + public Optional getAvatar() { + return avatar; + } + + /** + * @return Custom fields configured for a given model. + */ + @JsonProperty("custom_fields") + public Optional> getCustomFields() { + return customFields; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Employee && equalTo((Employee) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Employee other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && employeeNumber.equals(other.employeeNumber) + && company.equals(other.company) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && preferredName.equals(other.preferredName) + && displayFullName.equals(other.displayFullName) + && username.equals(other.username) + && groups.equals(other.groups) + && workEmail.equals(other.workEmail) + && personalEmail.equals(other.personalEmail) + && mobilePhoneNumber.equals(other.mobilePhoneNumber) + && employments.equals(other.employments) + && homeLocation.equals(other.homeLocation) + && workLocation.equals(other.workLocation) + && manager.equals(other.manager) + && team.equals(other.team) + && payGroup.equals(other.payGroup) + && ssn.equals(other.ssn) + && gender.equals(other.gender) + && ethnicity.equals(other.ethnicity) + && maritalStatus.equals(other.maritalStatus) + && dateOfBirth.equals(other.dateOfBirth) + && hireDate.equals(other.hireDate) + && startDate.equals(other.startDate) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && employmentStatus.equals(other.employmentStatus) + && terminationDate.equals(other.terminationDate) + && avatar.equals(other.avatar) + && customFields.equals(other.customFields) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.employeeNumber, + this.company, + this.firstName, + this.lastName, + this.preferredName, + this.displayFullName, + this.username, + this.groups, + this.workEmail, + this.personalEmail, + this.mobilePhoneNumber, + this.employments, + this.homeLocation, + this.workLocation, + this.manager, + this.team, + this.payGroup, + this.ssn, + this.gender, + this.ethnicity, + this.maritalStatus, + this.dateOfBirth, + this.hireDate, + this.startDate, + this.remoteCreatedAt, + this.employmentStatus, + this.terminationDate, + this.avatar, + this.customFields, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional employeeNumber = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional preferredName = Optional.empty(); + + private Optional displayFullName = Optional.empty(); + + private Optional username = Optional.empty(); + + private Optional>> groups = Optional.empty(); + + private Optional workEmail = Optional.empty(); + + private Optional personalEmail = Optional.empty(); + + private Optional mobilePhoneNumber = Optional.empty(); + + private Optional>> employments = Optional.empty(); + + private Optional homeLocation = Optional.empty(); + + private Optional workLocation = Optional.empty(); + + private Optional manager = Optional.empty(); + + private Optional team = Optional.empty(); + + private Optional payGroup = Optional.empty(); + + private Optional ssn = Optional.empty(); + + private Optional gender = Optional.empty(); + + private Optional ethnicity = Optional.empty(); + + private Optional maritalStatus = Optional.empty(); + + private Optional dateOfBirth = Optional.empty(); + + private Optional hireDate = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional employmentStatus = Optional.empty(); + + private Optional terminationDate = Optional.empty(); + + private Optional avatar = Optional.empty(); + + private Optional> customFields = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Employee other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + employeeNumber(other.getEmployeeNumber()); + company(other.getCompany()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + preferredName(other.getPreferredName()); + displayFullName(other.getDisplayFullName()); + username(other.getUsername()); + groups(other.getGroups()); + workEmail(other.getWorkEmail()); + personalEmail(other.getPersonalEmail()); + mobilePhoneNumber(other.getMobilePhoneNumber()); + employments(other.getEmployments()); + homeLocation(other.getHomeLocation()); + workLocation(other.getWorkLocation()); + manager(other.getManager()); + team(other.getTeam()); + payGroup(other.getPayGroup()); + ssn(other.getSsn()); + gender(other.getGender()); + ethnicity(other.getEthnicity()); + maritalStatus(other.getMaritalStatus()); + dateOfBirth(other.getDateOfBirth()); + hireDate(other.getHireDate()); + startDate(other.getStartDate()); + remoteCreatedAt(other.getRemoteCreatedAt()); + employmentStatus(other.getEmploymentStatus()); + terminationDate(other.getTerminationDate()); + avatar(other.getAvatar()); + customFields(other.getCustomFields()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "employee_number", nulls = Nulls.SKIP) + public Builder employeeNumber(Optional employeeNumber) { + this.employeeNumber = employeeNumber; + return this; + } + + public Builder employeeNumber(String employeeNumber) { + this.employeeNumber = Optional.ofNullable(employeeNumber); + return this; + } + + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(EmployeeCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public Builder firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + public Builder firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @JsonSetter(value = "last_name", nulls = Nulls.SKIP) + public Builder lastName(Optional lastName) { + this.lastName = lastName; + return this; + } + + public Builder lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + @JsonSetter(value = "preferred_name", nulls = Nulls.SKIP) + public Builder preferredName(Optional preferredName) { + this.preferredName = preferredName; + return this; + } + + public Builder preferredName(String preferredName) { + this.preferredName = Optional.ofNullable(preferredName); + return this; + } + + @JsonSetter(value = "display_full_name", nulls = Nulls.SKIP) + public Builder displayFullName(Optional displayFullName) { + this.displayFullName = displayFullName; + return this; + } + + public Builder displayFullName(String displayFullName) { + this.displayFullName = Optional.ofNullable(displayFullName); + return this; + } + + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + @JsonSetter(value = "groups", nulls = Nulls.SKIP) + public Builder groups(Optional>> groups) { + this.groups = groups; + return this; + } + + public Builder groups(List> groups) { + this.groups = Optional.ofNullable(groups); + return this; + } + + @JsonSetter(value = "work_email", nulls = Nulls.SKIP) + public Builder workEmail(Optional workEmail) { + this.workEmail = workEmail; + return this; + } + + public Builder workEmail(String workEmail) { + this.workEmail = Optional.ofNullable(workEmail); + return this; + } + + @JsonSetter(value = "personal_email", nulls = Nulls.SKIP) + public Builder personalEmail(Optional personalEmail) { + this.personalEmail = personalEmail; + return this; + } + + public Builder personalEmail(String personalEmail) { + this.personalEmail = Optional.ofNullable(personalEmail); + return this; + } + + @JsonSetter(value = "mobile_phone_number", nulls = Nulls.SKIP) + public Builder mobilePhoneNumber(Optional mobilePhoneNumber) { + this.mobilePhoneNumber = mobilePhoneNumber; + return this; + } + + public Builder mobilePhoneNumber(String mobilePhoneNumber) { + this.mobilePhoneNumber = Optional.ofNullable(mobilePhoneNumber); + return this; + } + + @JsonSetter(value = "employments", nulls = Nulls.SKIP) + public Builder employments(Optional>> employments) { + this.employments = employments; + return this; + } + + public Builder employments(List> employments) { + this.employments = Optional.ofNullable(employments); + return this; + } + + @JsonSetter(value = "home_location", nulls = Nulls.SKIP) + public Builder homeLocation(Optional homeLocation) { + this.homeLocation = homeLocation; + return this; + } + + public Builder homeLocation(EmployeeHomeLocation homeLocation) { + this.homeLocation = Optional.ofNullable(homeLocation); + return this; + } + + @JsonSetter(value = "work_location", nulls = Nulls.SKIP) + public Builder workLocation(Optional workLocation) { + this.workLocation = workLocation; + return this; + } + + public Builder workLocation(EmployeeWorkLocation workLocation) { + this.workLocation = Optional.ofNullable(workLocation); + return this; + } + + @JsonSetter(value = "manager", nulls = Nulls.SKIP) + public Builder manager(Optional manager) { + this.manager = manager; + return this; + } + + public Builder manager(EmployeeManager manager) { + this.manager = Optional.ofNullable(manager); + return this; + } + + @JsonSetter(value = "team", nulls = Nulls.SKIP) + public Builder team(Optional team) { + this.team = team; + return this; + } + + public Builder team(EmployeeTeam team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "pay_group", nulls = Nulls.SKIP) + public Builder payGroup(Optional payGroup) { + this.payGroup = payGroup; + return this; + } + + public Builder payGroup(EmployeePayGroup payGroup) { + this.payGroup = Optional.ofNullable(payGroup); + return this; + } + + @JsonSetter(value = "ssn", nulls = Nulls.SKIP) + public Builder ssn(Optional ssn) { + this.ssn = ssn; + return this; + } + + public Builder ssn(String ssn) { + this.ssn = Optional.ofNullable(ssn); + return this; + } + + @JsonSetter(value = "gender", nulls = Nulls.SKIP) + public Builder gender(Optional gender) { + this.gender = gender; + return this; + } + + public Builder gender(GenderEnum gender) { + this.gender = Optional.ofNullable(gender); + return this; + } + + @JsonSetter(value = "ethnicity", nulls = Nulls.SKIP) + public Builder ethnicity(Optional ethnicity) { + this.ethnicity = ethnicity; + return this; + } + + public Builder ethnicity(EthnicityEnum ethnicity) { + this.ethnicity = Optional.ofNullable(ethnicity); + return this; + } + + @JsonSetter(value = "marital_status", nulls = Nulls.SKIP) + public Builder maritalStatus(Optional maritalStatus) { + this.maritalStatus = maritalStatus; + return this; + } + + public Builder maritalStatus(MaritalStatusEnum maritalStatus) { + this.maritalStatus = Optional.ofNullable(maritalStatus); + return this; + } + + @JsonSetter(value = "date_of_birth", nulls = Nulls.SKIP) + public Builder dateOfBirth(Optional dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + public Builder dateOfBirth(OffsetDateTime dateOfBirth) { + this.dateOfBirth = Optional.ofNullable(dateOfBirth); + return this; + } + + @JsonSetter(value = "hire_date", nulls = Nulls.SKIP) + public Builder hireDate(Optional hireDate) { + this.hireDate = hireDate; + return this; + } + + public Builder hireDate(OffsetDateTime hireDate) { + this.hireDate = Optional.ofNullable(hireDate); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(OffsetDateTime startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + @JsonSetter(value = "employment_status", nulls = Nulls.SKIP) + public Builder employmentStatus(Optional employmentStatus) { + this.employmentStatus = employmentStatus; + return this; + } + + public Builder employmentStatus(EmploymentStatusEnum employmentStatus) { + this.employmentStatus = Optional.ofNullable(employmentStatus); + return this; + } + + @JsonSetter(value = "termination_date", nulls = Nulls.SKIP) + public Builder terminationDate(Optional terminationDate) { + this.terminationDate = terminationDate; + return this; + } + + public Builder terminationDate(OffsetDateTime terminationDate) { + this.terminationDate = Optional.ofNullable(terminationDate); + return this; + } + + @JsonSetter(value = "avatar", nulls = Nulls.SKIP) + public Builder avatar(Optional avatar) { + this.avatar = avatar; + return this; + } + + public Builder avatar(String avatar) { + this.avatar = Optional.ofNullable(avatar); + return this; + } + + @JsonSetter(value = "custom_fields", nulls = Nulls.SKIP) + public Builder customFields(Optional> customFields) { + this.customFields = customFields; + return this; + } + + public Builder customFields(Map customFields) { + this.customFields = Optional.ofNullable(customFields); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Employee build() { + return new Employee( + id, + remoteId, + createdAt, + modifiedAt, + employeeNumber, + company, + firstName, + lastName, + preferredName, + displayFullName, + username, + groups, + workEmail, + personalEmail, + mobilePhoneNumber, + employments, + homeLocation, + workLocation, + manager, + team, + payGroup, + ssn, + gender, + ethnicity, + maritalStatus, + dateOfBirth, + hireDate, + startDate, + remoteCreatedAt, + employmentStatus, + terminationDate, + avatar, + customFields, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/EmployeeCompany.java b/src/main/java/com/merge/api/hris/types/EmployeeCompany.java new file mode 100644 index 000000000..2b5ecc60d --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeeCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EmployeeCompany.Deserializer.class) +public final class EmployeeCompany { + private final Object value; + + private final int type; + + private EmployeeCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Company) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeeCompany && equalTo((EmployeeCompany) other); + } + + private boolean equalTo(EmployeeCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EmployeeCompany of(String value) { + return new EmployeeCompany(value, 0); + } + + public static EmployeeCompany of(Company value) { + return new EmployeeCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Company value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EmployeeCompany.class); + } + + @java.lang.Override + public EmployeeCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Company.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeEmploymentsItem.java b/src/main/java/com/merge/api/hris/types/EmployeeEmploymentsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeEmploymentsItem.java rename to src/main/java/com/merge/api/hris/types/EmployeeEmploymentsItem.java index 9f3f5b3ff..ceb438789 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeEmploymentsItem.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeEmploymentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public EmployeeEmploymentsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeEmploymentsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeeEndpointRequest.java b/src/main/java/com/merge/api/hris/types/EmployeeEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/hris/employees/requests/EmployeeEndpointRequest.java rename to src/main/java/com/merge/api/hris/types/EmployeeEndpointRequest.java index fc8068d49..cba7f123d 100644 --- a/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeeEndpointRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employees.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.types.EmployeeRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeGroupsItem.java b/src/main/java/com/merge/api/hris/types/EmployeeGroupsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeGroupsItem.java rename to src/main/java/com/merge/api/hris/types/EmployeeGroupsItem.java index 3da2da8a3..3d6ed8f2c 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeGroupsItem.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeGroupsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmployeeGroupsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeGroupsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeHomeLocation.java b/src/main/java/com/merge/api/hris/types/EmployeeHomeLocation.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeHomeLocation.java rename to src/main/java/com/merge/api/hris/types/EmployeeHomeLocation.java index b38e370db..a9175b685 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeHomeLocation.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeHomeLocation.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmployeeHomeLocation deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeHomeLocation deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeManager.java b/src/main/java/com/merge/api/hris/types/EmployeeManager.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeManager.java rename to src/main/java/com/merge/api/hris/types/EmployeeManager.java index 2d4195fb6..2e4bad6b0 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeManager.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeManager.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmployeeManager deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeManager deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeePayGroup.java b/src/main/java/com/merge/api/hris/types/EmployeePayGroup.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeePayGroup.java rename to src/main/java/com/merge/api/hris/types/EmployeePayGroup.java index be598a8ea..e4016be8d 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeePayGroup.java +++ b/src/main/java/com/merge/api/hris/types/EmployeePayGroup.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmployeePayGroup deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeePayGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeePayrollRun.java b/src/main/java/com/merge/api/hris/types/EmployeePayrollRun.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/EmployeePayrollRun.java rename to src/main/java/com/merge/api/hris/types/EmployeePayrollRun.java index 62794ff04..287d67f5b 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeePayrollRun.java +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRun.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeePayrollRunEmployee.java b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeePayrollRunEmployee.java rename to src/main/java/com/merge/api/hris/types/EmployeePayrollRunEmployee.java index 4f9879b19..51b2d9c7a 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeePayrollRunEmployee.java +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -34,8 +37,6 @@ public final class EmployeePayrollRunsListRequest { private final Optional endedBefore; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,13 +60,13 @@ public final class EmployeePayrollRunsListRequest { private final Map additionalProperties; private EmployeePayrollRunsListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional employeeId, Optional endedAfter, Optional endedBefore, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -77,13 +78,13 @@ private EmployeePayrollRunsListRequest( Optional startedAfter, Optional startedBefore, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.employeeId = employeeId; this.endedAfter = endedAfter; this.endedBefore = endedBefore; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -97,6 +98,14 @@ private EmployeePayrollRunsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -145,14 +154,6 @@ public Optional getEndedBefore() { return endedBefore; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -245,13 +246,13 @@ public Map getAdditionalProperties() { } private boolean equalTo(EmployeePayrollRunsListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && employeeId.equals(other.employeeId) && endedAfter.equals(other.endedAfter) && endedBefore.equals(other.endedBefore) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -267,13 +268,13 @@ private boolean equalTo(EmployeePayrollRunsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.employeeId, this.endedAfter, this.endedBefore, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -297,6 +298,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -309,8 +312,6 @@ public static final class Builder { private Optional endedBefore = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -337,13 +338,13 @@ public static final class Builder { private Builder() {} public Builder from(EmployeePayrollRunsListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); employeeId(other.getEmployeeId()); endedAfter(other.getEndedAfter()); endedBefore(other.getEndedBefore()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -357,6 +358,22 @@ public Builder from(EmployeePayrollRunsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EmployeePayrollRunsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -423,17 +440,6 @@ public Builder endedBefore(OffsetDateTime endedBefore) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EmployeePayrollRunsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -546,13 +552,13 @@ public Builder startedBefore(OffsetDateTime startedBefore) { public EmployeePayrollRunsListRequest build() { return new EmployeePayrollRunsListRequest( + expand, createdAfter, createdBefore, cursor, employeeId, endedAfter, endedBefore, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequestExpandItem.java new file mode 100644 index 000000000..e11acd3eb --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeePayrollRunsListRequestExpandItem { + EMPLOYEE("employee"), + + PAYROLL_RUN("payroll_run"); + + private final String value; + + EmployeePayrollRunsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsRetrieveRequest.java new file mode 100644 index 000000000..464a4bbb2 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsRetrieveRequest.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeePayrollRunsRetrieveRequest.Builder.class) +public final class EmployeePayrollRunsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private EmployeePayrollRunsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeePayrollRunsRetrieveRequest + && equalTo((EmployeePayrollRunsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeePayrollRunsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployeePayrollRunsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EmployeePayrollRunsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public EmployeePayrollRunsRetrieveRequest build() { + return new EmployeePayrollRunsRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..f8efa1c5b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeePayrollRunsRetrieveRequestExpandItem { + EMPLOYEE("employee"), + + PAYROLL_RUN("payroll_run"); + + private final String value; + + EmployeePayrollRunsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequest.java b/src/main/java/com/merge/api/hris/types/EmployeeRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeRequest.java rename to src/main/java/com/merge/api/hris/types/EmployeeRequest.java index 581244b3a..9ed03f463 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -59,11 +59,11 @@ public final class EmployeeRequest { private final Optional ssn; - private final Optional gender; + private final Optional gender; - private final Optional ethnicity; + private final Optional ethnicity; - private final Optional maritalStatus; + private final Optional maritalStatus; private final Optional dateOfBirth; @@ -71,7 +71,7 @@ public final class EmployeeRequest { private final Optional startDate; - private final Optional employmentStatus; + private final Optional employmentStatus; private final Optional terminationDate; @@ -102,13 +102,13 @@ private EmployeeRequest( Optional team, Optional payGroup, Optional ssn, - Optional gender, - Optional ethnicity, - Optional maritalStatus, + Optional gender, + Optional ethnicity, + Optional maritalStatus, Optional dateOfBirth, Optional hireDate, Optional startDate, - Optional employmentStatus, + Optional employmentStatus, Optional terminationDate, Optional avatar, Optional> integrationParams, @@ -298,7 +298,7 @@ public Optional getSsn() { * */ @JsonProperty("gender") - public Optional getGender() { + public Optional getGender() { return gender; } @@ -316,7 +316,7 @@ public Optional getGender() { * */ @JsonProperty("ethnicity") - public Optional getEthnicity() { + public Optional getEthnicity() { return ethnicity; } @@ -331,7 +331,7 @@ public Optional getEthnicity() { * */ @JsonProperty("marital_status") - public Optional getMaritalStatus() { + public Optional getMaritalStatus() { return maritalStatus; } @@ -368,7 +368,7 @@ public Optional getStartDate() { * */ @JsonProperty("employment_status") - public Optional getEmploymentStatus() { + public Optional getEmploymentStatus() { return employmentStatus; } @@ -522,11 +522,11 @@ public static final class Builder { private Optional ssn = Optional.empty(); - private Optional gender = Optional.empty(); + private Optional gender = Optional.empty(); - private Optional ethnicity = Optional.empty(); + private Optional ethnicity = Optional.empty(); - private Optional maritalStatus = Optional.empty(); + private Optional maritalStatus = Optional.empty(); private Optional dateOfBirth = Optional.empty(); @@ -534,7 +534,7 @@ public static final class Builder { private Optional startDate = Optional.empty(); - private Optional employmentStatus = Optional.empty(); + private Optional employmentStatus = Optional.empty(); private Optional terminationDate = Optional.empty(); @@ -781,34 +781,34 @@ public Builder ssn(String ssn) { } @JsonSetter(value = "gender", nulls = Nulls.SKIP) - public Builder gender(Optional gender) { + public Builder gender(Optional gender) { this.gender = gender; return this; } - public Builder gender(EmployeeRequestGender gender) { + public Builder gender(GenderEnum gender) { this.gender = Optional.ofNullable(gender); return this; } @JsonSetter(value = "ethnicity", nulls = Nulls.SKIP) - public Builder ethnicity(Optional ethnicity) { + public Builder ethnicity(Optional ethnicity) { this.ethnicity = ethnicity; return this; } - public Builder ethnicity(EmployeeRequestEthnicity ethnicity) { + public Builder ethnicity(EthnicityEnum ethnicity) { this.ethnicity = Optional.ofNullable(ethnicity); return this; } @JsonSetter(value = "marital_status", nulls = Nulls.SKIP) - public Builder maritalStatus(Optional maritalStatus) { + public Builder maritalStatus(Optional maritalStatus) { this.maritalStatus = maritalStatus; return this; } - public Builder maritalStatus(EmployeeRequestMaritalStatus maritalStatus) { + public Builder maritalStatus(MaritalStatusEnum maritalStatus) { this.maritalStatus = Optional.ofNullable(maritalStatus); return this; } @@ -847,12 +847,12 @@ public Builder startDate(OffsetDateTime startDate) { } @JsonSetter(value = "employment_status", nulls = Nulls.SKIP) - public Builder employmentStatus(Optional employmentStatus) { + public Builder employmentStatus(Optional employmentStatus) { this.employmentStatus = employmentStatus; return this; } - public Builder employmentStatus(EmployeeRequestEmploymentStatus employmentStatus) { + public Builder employmentStatus(EmploymentStatusEnum employmentStatus) { this.employmentStatus = Optional.ofNullable(employmentStatus); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestCompany.java b/src/main/java/com/merge/api/hris/types/EmployeeRequestCompany.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeRequestCompany.java rename to src/main/java/com/merge/api/hris/types/EmployeeRequestCompany.java index e4747ef60..64ddf4a6c 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestCompany.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequestCompany.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public EmployeeRequestCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEmploymentsItem.java b/src/main/java/com/merge/api/hris/types/EmployeeRequestEmploymentsItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEmploymentsItem.java rename to src/main/java/com/merge/api/hris/types/EmployeeRequestEmploymentsItem.java index bc8793854..f16e6fcf2 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEmploymentsItem.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequestEmploymentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public EmployeeRequestManager deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeRequestManager deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestPayGroup.java b/src/main/java/com/merge/api/hris/types/EmployeeRequestPayGroup.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeRequestPayGroup.java rename to src/main/java/com/merge/api/hris/types/EmployeeRequestPayGroup.java index 15849e3aa..1cb816218 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestPayGroup.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequestPayGroup.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public EmployeeRequestPayGroup deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeRequestPayGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestTeam.java b/src/main/java/com/merge/api/hris/types/EmployeeRequestTeam.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeRequestTeam.java rename to src/main/java/com/merge/api/hris/types/EmployeeRequestTeam.java index 38ec18cfb..9b4b4556d 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestTeam.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequestTeam.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmployeeRequestTeam deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeRequestTeam deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestWorkLocation.java b/src/main/java/com/merge/api/hris/types/EmployeeRequestWorkLocation.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeRequestWorkLocation.java rename to src/main/java/com/merge/api/hris/types/EmployeeRequestWorkLocation.java index 733ccfb7e..1ebb4ec6c 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestWorkLocation.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequestWorkLocation.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmployeeTeam deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeTeam deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeWorkLocation.java b/src/main/java/com/merge/api/hris/types/EmployeeWorkLocation.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployeeWorkLocation.java rename to src/main/java/com/merge/api/hris/types/EmployeeWorkLocation.java index 749eb6fb0..0054ec927 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeWorkLocation.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeWorkLocation.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmployeeWorkLocation deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmployeeWorkLocation deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java b/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java new file mode 100644 index 000000000..caefbd900 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java @@ -0,0 +1,1044 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeesListRequest.Builder.class) +public final class EmployeesListRequest { + private final Optional> expand; + + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional displayFullName; + + private final Optional employmentStatus; + + private final Optional employmentType; + + private final Optional firstName; + + private final Optional groups; + + private final Optional homeLocationId; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeSensitiveFields; + + private final Optional includeShellData; + + private final Optional jobTitle; + + private final Optional lastName; + + private final Optional managerId; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional payGroupId; + + private final Optional personalEmail; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Optional startedAfter; + + private final Optional startedBefore; + + private final Optional teamId; + + private final Optional terminatedAfter; + + private final Optional terminatedBefore; + + private final Optional workEmail; + + private final Optional workLocationId; + + private final Map additionalProperties; + + private EmployeesListRequest( + Optional> expand, + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional displayFullName, + Optional employmentStatus, + Optional employmentType, + Optional firstName, + Optional groups, + Optional homeLocationId, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeSensitiveFields, + Optional includeShellData, + Optional jobTitle, + Optional lastName, + Optional managerId, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional payGroupId, + Optional personalEmail, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Optional startedAfter, + Optional startedBefore, + Optional teamId, + Optional terminatedAfter, + Optional terminatedBefore, + Optional workEmail, + Optional workLocationId, + Map additionalProperties) { + this.expand = expand; + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.displayFullName = displayFullName; + this.employmentStatus = employmentStatus; + this.employmentType = employmentType; + this.firstName = firstName; + this.groups = groups; + this.homeLocationId = homeLocationId; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeSensitiveFields = includeSensitiveFields; + this.includeShellData = includeShellData; + this.jobTitle = jobTitle; + this.lastName = lastName; + this.managerId = managerId; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.payGroupId = payGroupId; + this.personalEmail = personalEmail; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.startedAfter = startedAfter; + this.startedBefore = startedBefore; + this.teamId = teamId; + this.terminatedAfter = terminatedAfter; + this.terminatedBefore = terminatedBefore; + this.workEmail = workEmail; + this.workLocationId = workLocationId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return employees for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return employees with this display name. + */ + @JsonProperty("display_full_name") + public Optional getDisplayFullName() { + return displayFullName; + } + + /** + * @return If provided, will only return employees with this employment status. + *
    + *
  • ACTIVE - ACTIVE
  • + *
  • PENDING - PENDING
  • + *
  • INACTIVE - INACTIVE
  • + *
+ */ + @JsonProperty("employment_status") + public Optional getEmploymentStatus() { + return employmentStatus; + } + + /** + * @return If provided, will only return employees that have an employment of the specified employment_type. + */ + @JsonProperty("employment_type") + public Optional getEmploymentType() { + return employmentType; + } + + /** + * @return If provided, will only return employees with this first name. + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return If provided, will only return employees matching the group ids; multiple groups can be separated by commas. + */ + @JsonProperty("groups") + public Optional getGroups() { + return groups; + } + + /** + * @return If provided, will only return employees for this home location. + */ + @JsonProperty("home_location_id") + public Optional getHomeLocationId() { + return homeLocationId; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include sensitive fields (such as social security numbers) in the response. + */ + @JsonProperty("include_sensitive_fields") + public Optional getIncludeSensitiveFields() { + return includeSensitiveFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return employees that have an employment of the specified job_title. + */ + @JsonProperty("job_title") + public Optional getJobTitle() { + return jobTitle; + } + + /** + * @return If provided, will only return employees with this last name. + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return If provided, will only return employees for this manager. + */ + @JsonProperty("manager_id") + public Optional getManagerId() { + return managerId; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If provided, will only return employees for this pay group + */ + @JsonProperty("pay_group_id") + public Optional getPayGroupId() { + return payGroupId; + } + + /** + * @return If provided, will only return Employees with this personal email + */ + @JsonProperty("personal_email") + public Optional getPersonalEmail() { + return personalEmail; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + /** + * @return If provided, will only return employees that started after this datetime. + */ + @JsonProperty("started_after") + public Optional getStartedAfter() { + return startedAfter; + } + + /** + * @return If provided, will only return employees that started before this datetime. + */ + @JsonProperty("started_before") + public Optional getStartedBefore() { + return startedBefore; + } + + /** + * @return If provided, will only return employees for this team. + */ + @JsonProperty("team_id") + public Optional getTeamId() { + return teamId; + } + + /** + * @return If provided, will only return employees that were terminated after this datetime. + */ + @JsonProperty("terminated_after") + public Optional getTerminatedAfter() { + return terminatedAfter; + } + + /** + * @return If provided, will only return employees that were terminated before this datetime. + */ + @JsonProperty("terminated_before") + public Optional getTerminatedBefore() { + return terminatedBefore; + } + + /** + * @return If provided, will only return Employees with this work email + */ + @JsonProperty("work_email") + public Optional getWorkEmail() { + return workEmail; + } + + /** + * @return If provided, will only return employees for this location. + */ + @JsonProperty("work_location_id") + public Optional getWorkLocationId() { + return workLocationId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeesListRequest && equalTo((EmployeesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeesListRequest other) { + return expand.equals(other.expand) + && companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && displayFullName.equals(other.displayFullName) + && employmentStatus.equals(other.employmentStatus) + && employmentType.equals(other.employmentType) + && firstName.equals(other.firstName) + && groups.equals(other.groups) + && homeLocationId.equals(other.homeLocationId) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeSensitiveFields.equals(other.includeSensitiveFields) + && includeShellData.equals(other.includeShellData) + && jobTitle.equals(other.jobTitle) + && lastName.equals(other.lastName) + && managerId.equals(other.managerId) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && payGroupId.equals(other.payGroupId) + && personalEmail.equals(other.personalEmail) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && startedAfter.equals(other.startedAfter) + && startedBefore.equals(other.startedBefore) + && teamId.equals(other.teamId) + && terminatedAfter.equals(other.terminatedAfter) + && terminatedBefore.equals(other.terminatedBefore) + && workEmail.equals(other.workEmail) + && workLocationId.equals(other.workLocationId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.displayFullName, + this.employmentStatus, + this.employmentType, + this.firstName, + this.groups, + this.homeLocationId, + this.includeDeletedData, + this.includeRemoteData, + this.includeSensitiveFields, + this.includeShellData, + this.jobTitle, + this.lastName, + this.managerId, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.payGroupId, + this.personalEmail, + this.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.startedAfter, + this.startedBefore, + this.teamId, + this.terminatedAfter, + this.terminatedBefore, + this.workEmail, + this.workLocationId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional displayFullName = Optional.empty(); + + private Optional employmentStatus = Optional.empty(); + + private Optional employmentType = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional groups = Optional.empty(); + + private Optional homeLocationId = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeSensitiveFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional jobTitle = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional managerId = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional payGroupId = Optional.empty(); + + private Optional personalEmail = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional startedAfter = Optional.empty(); + + private Optional startedBefore = Optional.empty(); + + private Optional teamId = Optional.empty(); + + private Optional terminatedAfter = Optional.empty(); + + private Optional terminatedBefore = Optional.empty(); + + private Optional workEmail = Optional.empty(); + + private Optional workLocationId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployeesListRequest other) { + expand(other.getExpand()); + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + displayFullName(other.getDisplayFullName()); + employmentStatus(other.getEmploymentStatus()); + employmentType(other.getEmploymentType()); + firstName(other.getFirstName()); + groups(other.getGroups()); + homeLocationId(other.getHomeLocationId()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeSensitiveFields(other.getIncludeSensitiveFields()); + includeShellData(other.getIncludeShellData()); + jobTitle(other.getJobTitle()); + lastName(other.getLastName()); + managerId(other.getManagerId()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + payGroupId(other.getPayGroupId()); + personalEmail(other.getPersonalEmail()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + startedAfter(other.getStartedAfter()); + startedBefore(other.getStartedBefore()); + teamId(other.getTeamId()); + terminatedAfter(other.getTerminatedAfter()); + terminatedBefore(other.getTerminatedBefore()); + workEmail(other.getWorkEmail()); + workLocationId(other.getWorkLocationId()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EmployeesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "display_full_name", nulls = Nulls.SKIP) + public Builder displayFullName(Optional displayFullName) { + this.displayFullName = displayFullName; + return this; + } + + public Builder displayFullName(String displayFullName) { + this.displayFullName = Optional.ofNullable(displayFullName); + return this; + } + + @JsonSetter(value = "employment_status", nulls = Nulls.SKIP) + public Builder employmentStatus(Optional employmentStatus) { + this.employmentStatus = employmentStatus; + return this; + } + + public Builder employmentStatus(EmployeesListRequestEmploymentStatus employmentStatus) { + this.employmentStatus = Optional.ofNullable(employmentStatus); + return this; + } + + @JsonSetter(value = "employment_type", nulls = Nulls.SKIP) + public Builder employmentType(Optional employmentType) { + this.employmentType = employmentType; + return this; + } + + public Builder employmentType(String employmentType) { + this.employmentType = Optional.ofNullable(employmentType); + return this; + } + + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public Builder firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + public Builder firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + @JsonSetter(value = "groups", nulls = Nulls.SKIP) + public Builder groups(Optional groups) { + this.groups = groups; + return this; + } + + public Builder groups(String groups) { + this.groups = Optional.ofNullable(groups); + return this; + } + + @JsonSetter(value = "home_location_id", nulls = Nulls.SKIP) + public Builder homeLocationId(Optional homeLocationId) { + this.homeLocationId = homeLocationId; + return this; + } + + public Builder homeLocationId(String homeLocationId) { + this.homeLocationId = Optional.ofNullable(homeLocationId); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_sensitive_fields", nulls = Nulls.SKIP) + public Builder includeSensitiveFields(Optional includeSensitiveFields) { + this.includeSensitiveFields = includeSensitiveFields; + return this; + } + + public Builder includeSensitiveFields(Boolean includeSensitiveFields) { + this.includeSensitiveFields = Optional.ofNullable(includeSensitiveFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "job_title", nulls = Nulls.SKIP) + public Builder jobTitle(Optional jobTitle) { + this.jobTitle = jobTitle; + return this; + } + + public Builder jobTitle(String jobTitle) { + this.jobTitle = Optional.ofNullable(jobTitle); + return this; + } + + @JsonSetter(value = "last_name", nulls = Nulls.SKIP) + public Builder lastName(Optional lastName) { + this.lastName = lastName; + return this; + } + + public Builder lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + @JsonSetter(value = "manager_id", nulls = Nulls.SKIP) + public Builder managerId(Optional managerId) { + this.managerId = managerId; + return this; + } + + public Builder managerId(String managerId) { + this.managerId = Optional.ofNullable(managerId); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "pay_group_id", nulls = Nulls.SKIP) + public Builder payGroupId(Optional payGroupId) { + this.payGroupId = payGroupId; + return this; + } + + public Builder payGroupId(String payGroupId) { + this.payGroupId = Optional.ofNullable(payGroupId); + return this; + } + + @JsonSetter(value = "personal_email", nulls = Nulls.SKIP) + public Builder personalEmail(Optional personalEmail) { + this.personalEmail = personalEmail; + return this; + } + + public Builder personalEmail(String personalEmail) { + this.personalEmail = Optional.ofNullable(personalEmail); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(EmployeesListRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(EmployeesListRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + @JsonSetter(value = "started_after", nulls = Nulls.SKIP) + public Builder startedAfter(Optional startedAfter) { + this.startedAfter = startedAfter; + return this; + } + + public Builder startedAfter(OffsetDateTime startedAfter) { + this.startedAfter = Optional.ofNullable(startedAfter); + return this; + } + + @JsonSetter(value = "started_before", nulls = Nulls.SKIP) + public Builder startedBefore(Optional startedBefore) { + this.startedBefore = startedBefore; + return this; + } + + public Builder startedBefore(OffsetDateTime startedBefore) { + this.startedBefore = Optional.ofNullable(startedBefore); + return this; + } + + @JsonSetter(value = "team_id", nulls = Nulls.SKIP) + public Builder teamId(Optional teamId) { + this.teamId = teamId; + return this; + } + + public Builder teamId(String teamId) { + this.teamId = Optional.ofNullable(teamId); + return this; + } + + @JsonSetter(value = "terminated_after", nulls = Nulls.SKIP) + public Builder terminatedAfter(Optional terminatedAfter) { + this.terminatedAfter = terminatedAfter; + return this; + } + + public Builder terminatedAfter(OffsetDateTime terminatedAfter) { + this.terminatedAfter = Optional.ofNullable(terminatedAfter); + return this; + } + + @JsonSetter(value = "terminated_before", nulls = Nulls.SKIP) + public Builder terminatedBefore(Optional terminatedBefore) { + this.terminatedBefore = terminatedBefore; + return this; + } + + public Builder terminatedBefore(OffsetDateTime terminatedBefore) { + this.terminatedBefore = Optional.ofNullable(terminatedBefore); + return this; + } + + @JsonSetter(value = "work_email", nulls = Nulls.SKIP) + public Builder workEmail(Optional workEmail) { + this.workEmail = workEmail; + return this; + } + + public Builder workEmail(String workEmail) { + this.workEmail = Optional.ofNullable(workEmail); + return this; + } + + @JsonSetter(value = "work_location_id", nulls = Nulls.SKIP) + public Builder workLocationId(Optional workLocationId) { + this.workLocationId = workLocationId; + return this; + } + + public Builder workLocationId(String workLocationId) { + this.workLocationId = Optional.ofNullable(workLocationId); + return this; + } + + public EmployeesListRequest build() { + return new EmployeesListRequest( + expand, + companyId, + createdAfter, + createdBefore, + cursor, + displayFullName, + employmentStatus, + employmentType, + firstName, + groups, + homeLocationId, + includeDeletedData, + includeRemoteData, + includeSensitiveFields, + includeShellData, + jobTitle, + lastName, + managerId, + modifiedAfter, + modifiedBefore, + pageSize, + payGroupId, + personalEmail, + remoteFields, + remoteId, + showEnumOrigins, + startedAfter, + startedBefore, + teamId, + terminatedAfter, + terminatedBefore, + workEmail, + workLocationId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestEmploymentStatus.java b/src/main/java/com/merge/api/hris/types/EmployeesListRequestEmploymentStatus.java similarity index 89% rename from src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestEmploymentStatus.java rename to src/main/java/com/merge/api/hris/types/EmployeesListRequestEmploymentStatus.java index 6d6087cd2..4436217d9 100644 --- a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestEmploymentStatus.java +++ b/src/main/java/com/merge/api/hris/types/EmployeesListRequestEmploymentStatus.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employees.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/EmployeesListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/EmployeesListRequestExpandItem.java new file mode 100644 index 000000000..e17e1ffec --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeesListRequestExpandItem.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeesListRequestExpandItem { + COMPANY("company"), + + EMPLOYMENTS("employments"), + + GROUPS("groups"), + + HOME_LOCATION("home_location"), + + MANAGER("manager"), + + PAY_GROUP("pay_group"), + + TEAM("team"), + + WORK_LOCATION("work_location"); + + private final String value; + + EmployeesListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/EmployeesListRequestRemoteFields.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/EmployeesListRequestRemoteFields.java index f6a5e374b..186b694c2 100644 --- a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/EmployeesListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employees.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/EmployeesListRequestShowEnumOrigins.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/EmployeesListRequestShowEnumOrigins.java index 7c3926a06..7eb503de9 100644 --- a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/EmployeesListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employees.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequest.java new file mode 100644 index 000000000..dde331795 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequest.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployeesRetrieveRequest.Builder.class) +public final class EmployeesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeSensitiveFields; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private EmployeesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeSensitiveFields, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeSensitiveFields = includeSensitiveFields; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include sensitive fields (such as social security numbers) in the response. + */ + @JsonProperty("include_sensitive_fields") + public Optional getIncludeSensitiveFields() { + return includeSensitiveFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeesRetrieveRequest && equalTo((EmployeesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeSensitiveFields.equals(other.includeSensitiveFields) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.includeRemoteData, + this.includeSensitiveFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeSensitiveFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployeesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeSensitiveFields(other.getIncludeSensitiveFields()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EmployeesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_sensitive_fields", nulls = Nulls.SKIP) + public Builder includeSensitiveFields(Optional includeSensitiveFields) { + this.includeSensitiveFields = includeSensitiveFields; + return this; + } + + public Builder includeSensitiveFields(Boolean includeSensitiveFields) { + this.includeSensitiveFields = Optional.ofNullable(includeSensitiveFields); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(EmployeesRetrieveRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(EmployeesRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public EmployeesRetrieveRequest build() { + return new EmployeesRetrieveRequest( + expand, + includeRemoteData, + includeSensitiveFields, + includeShellData, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..ad48e22f4 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestExpandItem.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmployeesRetrieveRequestExpandItem { + COMPANY("company"), + + EMPLOYMENTS("employments"), + + GROUPS("groups"), + + HOME_LOCATION("home_location"), + + MANAGER("manager"), + + PAY_GROUP("pay_group"), + + TEAM("team"), + + WORK_LOCATION("work_location"); + + private final String value; + + EmployeesRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestRemoteFields.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestRemoteFields.java index 0fd335c84..ce068c0dd 100644 --- a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employees.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestShowEnumOrigins.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestShowEnumOrigins.java index 6d9e8533a..2b4104721 100644 --- a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/EmployeesRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employees.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployerBenefit.java b/src/main/java/com/merge/api/hris/types/EmployerBenefit.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmployerBenefit.java rename to src/main/java/com/merge/api/hris/types/EmployerBenefit.java index 95a11dd3d..fced41886 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmployerBenefit.java +++ b/src/main/java/com/merge/api/hris/types/EmployerBenefit.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -31,7 +31,7 @@ public final class EmployerBenefit { private final Optional modifiedAt; - private final Optional benefitPlanType; + private final Optional benefitPlanType; private final Optional name; @@ -52,7 +52,7 @@ private EmployerBenefit( Optional remoteId, Optional createdAt, Optional modifiedAt, - Optional benefitPlanType, + Optional benefitPlanType, Optional name, Optional description, Optional deductionCode, @@ -114,7 +114,7 @@ public Optional getModifiedAt() { * */ @JsonProperty("benefit_plan_type") - public Optional getBenefitPlanType() { + public Optional getBenefitPlanType() { return benefitPlanType; } @@ -220,7 +220,7 @@ public static final class Builder { private Optional modifiedAt = Optional.empty(); - private Optional benefitPlanType = Optional.empty(); + private Optional benefitPlanType = Optional.empty(); private Optional name = Optional.empty(); @@ -299,12 +299,12 @@ public Builder modifiedAt(OffsetDateTime modifiedAt) { } @JsonSetter(value = "benefit_plan_type", nulls = Nulls.SKIP) - public Builder benefitPlanType(Optional benefitPlanType) { + public Builder benefitPlanType(Optional benefitPlanType) { this.benefitPlanType = benefitPlanType; return this; } - public Builder benefitPlanType(EmployerBenefitBenefitPlanType benefitPlanType) { + public Builder benefitPlanType(BenefitPlanTypeEnum benefitPlanType) { this.benefitPlanType = Optional.ofNullable(benefitPlanType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/employerbenefits/requests/EmployerBenefitsListRequest.java b/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/employerbenefits/requests/EmployerBenefitsListRequest.java rename to src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java index b81920c98..24fa5c816 100644 --- a/src/main/java/com/merge/api/resources/hris/employerbenefits/requests/EmployerBenefitsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employerbenefits.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/EmployerBenefitsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/EmployerBenefitsRetrieveRequest.java new file mode 100644 index 000000000..737ac6328 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployerBenefitsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmployerBenefitsRetrieveRequest.Builder.class) +public final class EmployerBenefitsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private EmployerBenefitsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployerBenefitsRetrieveRequest && equalTo((EmployerBenefitsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployerBenefitsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmployerBenefitsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public EmployerBenefitsRetrieveRequest build() { + return new EmployerBenefitsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/Employment.java b/src/main/java/com/merge/api/hris/types/Employment.java similarity index 94% rename from src/main/java/com/merge/api/resources/hris/types/Employment.java rename to src/main/java/com/merge/api/hris/types/Employment.java index f55590829..453903d1d 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Employment.java +++ b/src/main/java/com/merge/api/hris/types/Employment.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,19 +37,19 @@ public final class Employment { private final Optional payRate; - private final Optional payPeriod; + private final Optional payPeriod; - private final Optional payFrequency; + private final Optional payFrequency; - private final Optional payCurrency; + private final Optional payCurrency; private final Optional payGroup; - private final Optional flsaStatus; + private final Optional flsaStatus; private final Optional effectiveDate; - private final Optional employmentType; + private final Optional employmentType; private final Optional remoteWasDeleted; @@ -67,13 +67,13 @@ private Employment( Optional employee, Optional jobTitle, Optional payRate, - Optional payPeriod, - Optional payFrequency, - Optional payCurrency, + Optional payPeriod, + Optional payFrequency, + Optional payCurrency, Optional payGroup, - Optional flsaStatus, + Optional flsaStatus, Optional effectiveDate, - Optional employmentType, + Optional employmentType, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -166,7 +166,7 @@ public Optional getPayRate() { * */ @JsonProperty("pay_period") - public Optional getPayPeriod() { + public Optional getPayPeriod() { return payPeriod; } @@ -185,7 +185,7 @@ public Optional getPayPeriod() { * */ @JsonProperty("pay_frequency") - public Optional getPayFrequency() { + public Optional getPayFrequency() { return payFrequency; } @@ -501,7 +501,7 @@ public Optional getPayFrequency() { * */ @JsonProperty("pay_currency") - public Optional getPayCurrency() { + public Optional getPayCurrency() { return payCurrency; } @@ -523,7 +523,7 @@ public Optional getPayGroup() { * */ @JsonProperty("flsa_status") - public Optional getFlsaStatus() { + public Optional getFlsaStatus() { return flsaStatus; } @@ -546,7 +546,7 @@ public Optional getEffectiveDate() { * */ @JsonProperty("employment_type") - public Optional getEmploymentType() { + public Optional getEmploymentType() { return employmentType; } @@ -646,19 +646,19 @@ public static final class Builder { private Optional payRate = Optional.empty(); - private Optional payPeriod = Optional.empty(); + private Optional payPeriod = Optional.empty(); - private Optional payFrequency = Optional.empty(); + private Optional payFrequency = Optional.empty(); - private Optional payCurrency = Optional.empty(); + private Optional payCurrency = Optional.empty(); private Optional payGroup = Optional.empty(); - private Optional flsaStatus = Optional.empty(); + private Optional flsaStatus = Optional.empty(); private Optional effectiveDate = Optional.empty(); - private Optional employmentType = Optional.empty(); + private Optional employmentType = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -770,34 +770,34 @@ public Builder payRate(Double payRate) { } @JsonSetter(value = "pay_period", nulls = Nulls.SKIP) - public Builder payPeriod(Optional payPeriod) { + public Builder payPeriod(Optional payPeriod) { this.payPeriod = payPeriod; return this; } - public Builder payPeriod(EmploymentPayPeriod payPeriod) { + public Builder payPeriod(PayPeriodEnum payPeriod) { this.payPeriod = Optional.ofNullable(payPeriod); return this; } @JsonSetter(value = "pay_frequency", nulls = Nulls.SKIP) - public Builder payFrequency(Optional payFrequency) { + public Builder payFrequency(Optional payFrequency) { this.payFrequency = payFrequency; return this; } - public Builder payFrequency(EmploymentPayFrequency payFrequency) { + public Builder payFrequency(PayFrequencyEnum payFrequency) { this.payFrequency = Optional.ofNullable(payFrequency); return this; } @JsonSetter(value = "pay_currency", nulls = Nulls.SKIP) - public Builder payCurrency(Optional payCurrency) { + public Builder payCurrency(Optional payCurrency) { this.payCurrency = payCurrency; return this; } - public Builder payCurrency(EmploymentPayCurrency payCurrency) { + public Builder payCurrency(PayCurrencyEnum payCurrency) { this.payCurrency = Optional.ofNullable(payCurrency); return this; } @@ -814,12 +814,12 @@ public Builder payGroup(EmploymentPayGroup payGroup) { } @JsonSetter(value = "flsa_status", nulls = Nulls.SKIP) - public Builder flsaStatus(Optional flsaStatus) { + public Builder flsaStatus(Optional flsaStatus) { this.flsaStatus = flsaStatus; return this; } - public Builder flsaStatus(EmploymentFlsaStatus flsaStatus) { + public Builder flsaStatus(FlsaStatusEnum flsaStatus) { this.flsaStatus = Optional.ofNullable(flsaStatus); return this; } @@ -836,12 +836,12 @@ public Builder effectiveDate(OffsetDateTime effectiveDate) { } @JsonSetter(value = "employment_type", nulls = Nulls.SKIP) - public Builder employmentType(Optional employmentType) { + public Builder employmentType(Optional employmentType) { this.employmentType = employmentType; return this; } - public Builder employmentType(EmploymentEmploymentType employmentType) { + public Builder employmentType(EmploymentTypeEnum employmentType) { this.employmentType = Optional.ofNullable(employmentType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentEmployee.java b/src/main/java/com/merge/api/hris/types/EmploymentEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmploymentEmployee.java rename to src/main/java/com/merge/api/hris/types/EmploymentEmployee.java index bf9050797..07bbecc9f 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentEmployee.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmploymentEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmploymentEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayGroup.java b/src/main/java/com/merge/api/hris/types/EmploymentPayGroup.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/EmploymentPayGroup.java rename to src/main/java/com/merge/api/hris/types/EmploymentPayGroup.java index 115e641ac..0a536ed65 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayGroup.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentPayGroup.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public EmploymentPayGroup deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public EmploymentPayGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentStatusEnum.java b/src/main/java/com/merge/api/hris/types/EmploymentStatusEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/types/EmploymentStatusEnum.java rename to src/main/java/com/merge/api/hris/types/EmploymentStatusEnum.java index 151d2094f..3c9857f97 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentStatusEnum.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentTypeEnum.java b/src/main/java/com/merge/api/hris/types/EmploymentTypeEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/types/EmploymentTypeEnum.java rename to src/main/java/com/merge/api/hris/types/EmploymentTypeEnum.java index 30f02df94..88ef0d80b 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/employments/requests/EmploymentsListRequest.java b/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/hris/employments/requests/EmploymentsListRequest.java rename to src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java index 96a6f19df..30a3f54b2 100644 --- a/src/main/java/com/merge/api/resources/hris/employments/requests/EmploymentsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employments.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,12 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.employments.types.EmploymentsListRequestExpand; -import com.merge.api.resources.hris.employments.types.EmploymentsListRequestOrderBy; -import com.merge.api.resources.hris.employments.types.EmploymentsListRequestRemoteFields; -import com.merge.api.resources.hris.employments.types.EmploymentsListRequestShowEnumOrigins; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -25,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EmploymentsListRequest.Builder.class) public final class EmploymentsListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -33,8 +33,6 @@ public final class EmploymentsListRequest { private final Optional employeeId; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -58,11 +56,11 @@ public final class EmploymentsListRequest { private final Map additionalProperties; private EmploymentsListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional employeeId, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -74,11 +72,11 @@ private EmploymentsListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.employeeId = employeeId; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -92,6 +90,14 @@ private EmploymentsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -124,14 +130,6 @@ public Optional getEmployeeId() { return employeeId; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -224,11 +222,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(EmploymentsListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && employeeId.equals(other.employeeId) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -244,11 +242,11 @@ private boolean equalTo(EmploymentsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.employeeId, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -272,6 +270,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -280,8 +280,6 @@ public static final class Builder { private Optional employeeId = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -308,11 +306,11 @@ public static final class Builder { private Builder() {} public Builder from(EmploymentsListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); employeeId(other.getEmployeeId()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -326,6 +324,22 @@ public Builder from(EmploymentsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EmploymentsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -370,17 +384,6 @@ public Builder employeeId(String employeeId) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EmploymentsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -493,11 +496,11 @@ public Builder showEnumOrigins(EmploymentsListRequestShowEnumOrigins showEnumOri public EmploymentsListRequest build() { return new EmploymentsListRequest( + expand, createdAfter, createdBefore, cursor, employeeId, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/hris/types/EmploymentsListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestExpandItem.java new file mode 100644 index 000000000..886c84210 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentsListRequestExpandItem { + EMPLOYEE("employee"), + + PAY_GROUP("pay_group"); + + private final String value; + + EmploymentsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestOrderBy.java b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestOrderBy.java similarity index 89% rename from src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestOrderBy.java rename to src/main/java/com/merge/api/hris/types/EmploymentsListRequestOrderBy.java index 949bbfa9b..7a49daa11 100644 --- a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestOrderBy.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestOrderBy.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employments.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestRemoteFields.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/EmploymentsListRequestRemoteFields.java index 6481c5a09..6824df0f9 100644 --- a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employments.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestShowEnumOrigins.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/EmploymentsListRequestShowEnumOrigins.java index b4329a1ac..39b276872 100644 --- a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employments.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequest.java new file mode 100644 index 000000000..bfcb49795 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EmploymentsRetrieveRequest.Builder.class) +public final class EmploymentsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private EmploymentsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmploymentsRetrieveRequest && equalTo((EmploymentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmploymentsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EmploymentsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(EmploymentsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(EmploymentsRetrieveRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(EmploymentsRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public EmploymentsRetrieveRequest build() { + return new EmploymentsRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..d943eb455 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EmploymentsRetrieveRequestExpandItem { + EMPLOYEE("employee"), + + PAY_GROUP("pay_group"); + + private final String value; + + EmploymentsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestRemoteFields.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestRemoteFields.java index f89a7c3e5..6438a3d99 100644 --- a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employments.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestShowEnumOrigins.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestShowEnumOrigins.java index 37ef6d569..1278ee1a0 100644 --- a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.employments.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/hris/types/EnabledActionsEnum.java new file mode 100644 index 000000000..e29798aae --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EnabledActionsEnum { + READ("READ"), + + WRITE("WRITE"); + + private final String value; + + EnabledActionsEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/EncodingEnum.java b/src/main/java/com/merge/api/hris/types/EncodingEnum.java new file mode 100644 index 000000000..00a09e52a --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EncodingEnum { + RAW("RAW"), + + BASE_64("BASE64"), + + GZIP_BASE_64("GZIP_BASE64"); + + private final String value; + + EncodingEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..80d64dd14 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java @@ -0,0 +1,607 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + _FinalStage language(Optional language); + + _FinalStage language(LanguageEnum language); + + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + return this; + } + + /** + *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

Your end user's organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

A JSON object containing integration-specific configuration options.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

The following subset of IETF language tags can be used to configure localization.

+ *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/hris/types/ErrorValidationProblem.java new file mode 100644 index 000000000..0921ac826 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ErrorValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/EthnicityEnum.java b/src/main/java/com/merge/api/hris/types/EthnicityEnum.java similarity index 94% rename from src/main/java/com/merge/api/resources/hris/types/EthnicityEnum.java rename to src/main/java/com/merge/api/hris/types/EthnicityEnum.java index 6a4575d14..c4a36e6c5 100644 --- a/src/main/java/com/merge/api/resources/hris/types/EthnicityEnum.java +++ b/src/main/java/com/merge/api/hris/types/EthnicityEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/EventTypeEnum.java b/src/main/java/com/merge/api/hris/types/EventTypeEnum.java new file mode 100644 index 000000000..fbaa18157 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EventTypeEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EventTypeEnum { + CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), + + DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), + + CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), + + DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), + + REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), + + INVITED_USER("INVITED_USER"), + + TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), + + TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), + + DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), + + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT("DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"), + + CREATED_DESTINATION("CREATED_DESTINATION"), + + DELETED_DESTINATION("DELETED_DESTINATION"), + + CHANGED_DESTINATION("CHANGED_DESTINATION"), + + CHANGED_SCOPES("CHANGED_SCOPES"), + + CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), + + CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), + + ENABLED_INTEGRATION("ENABLED_INTEGRATION"), + + DISABLED_INTEGRATION("DISABLED_INTEGRATION"), + + ENABLED_CATEGORY("ENABLED_CATEGORY"), + + DISABLED_CATEGORY("DISABLED_CATEGORY"), + + CHANGED_PASSWORD("CHANGED_PASSWORD"), + + RESET_PASSWORD("RESET_PASSWORD"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), + + DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), + + DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), + + MUTED_ISSUE("MUTED_ISSUE"), + + GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), + + ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), + + DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), + + MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), + + END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); + + private final String value; + + EventTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..0cbe531e8 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..5bab3198a --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> benefit; + + private final Optional> employerBenefit; + + private final Optional> company; + + private final Optional> employeePayrollRun; + + private final Optional> employee; + + private final Optional> employment; + + private final Optional> location; + + private final Optional> payrollRun; + + private final Optional> team; + + private final Optional> timeOff; + + private final Optional> timeOffBalance; + + private final Optional> bankInfo; + + private final Optional> payGroup; + + private final Optional> group; + + private final Optional> dependent; + + private final Optional> timesheetEntry; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> benefit, + Optional> employerBenefit, + Optional> company, + Optional> employeePayrollRun, + Optional> employee, + Optional> employment, + Optional> location, + Optional> payrollRun, + Optional> team, + Optional> timeOff, + Optional> timeOffBalance, + Optional> bankInfo, + Optional> payGroup, + Optional> group, + Optional> dependent, + Optional> timesheetEntry, + Map additionalProperties) { + this.benefit = benefit; + this.employerBenefit = employerBenefit; + this.company = company; + this.employeePayrollRun = employeePayrollRun; + this.employee = employee; + this.employment = employment; + this.location = location; + this.payrollRun = payrollRun; + this.team = team; + this.timeOff = timeOff; + this.timeOffBalance = timeOffBalance; + this.bankInfo = bankInfo; + this.payGroup = payGroup; + this.group = group; + this.dependent = dependent; + this.timesheetEntry = timesheetEntry; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Benefit") + public Optional> getBenefit() { + return benefit; + } + + @JsonProperty("EmployerBenefit") + public Optional> getEmployerBenefit() { + return employerBenefit; + } + + @JsonProperty("Company") + public Optional> getCompany() { + return company; + } + + @JsonProperty("EmployeePayrollRun") + public Optional> getEmployeePayrollRun() { + return employeePayrollRun; + } + + @JsonProperty("Employee") + public Optional> getEmployee() { + return employee; + } + + @JsonProperty("Employment") + public Optional> getEmployment() { + return employment; + } + + @JsonProperty("Location") + public Optional> getLocation() { + return location; + } + + @JsonProperty("PayrollRun") + public Optional> getPayrollRun() { + return payrollRun; + } + + @JsonProperty("Team") + public Optional> getTeam() { + return team; + } + + @JsonProperty("TimeOff") + public Optional> getTimeOff() { + return timeOff; + } + + @JsonProperty("TimeOffBalance") + public Optional> getTimeOffBalance() { + return timeOffBalance; + } + + @JsonProperty("BankInfo") + public Optional> getBankInfo() { + return bankInfo; + } + + @JsonProperty("PayGroup") + public Optional> getPayGroup() { + return payGroup; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("Dependent") + public Optional> getDependent() { + return dependent; + } + + @JsonProperty("TimesheetEntry") + public Optional> getTimesheetEntry() { + return timesheetEntry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return benefit.equals(other.benefit) + && employerBenefit.equals(other.employerBenefit) + && company.equals(other.company) + && employeePayrollRun.equals(other.employeePayrollRun) + && employee.equals(other.employee) + && employment.equals(other.employment) + && location.equals(other.location) + && payrollRun.equals(other.payrollRun) + && team.equals(other.team) + && timeOff.equals(other.timeOff) + && timeOffBalance.equals(other.timeOffBalance) + && bankInfo.equals(other.bankInfo) + && payGroup.equals(other.payGroup) + && group.equals(other.group) + && dependent.equals(other.dependent) + && timesheetEntry.equals(other.timesheetEntry); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.benefit, + this.employerBenefit, + this.company, + this.employeePayrollRun, + this.employee, + this.employment, + this.location, + this.payrollRun, + this.team, + this.timeOff, + this.timeOffBalance, + this.bankInfo, + this.payGroup, + this.group, + this.dependent, + this.timesheetEntry); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> benefit = Optional.empty(); + + private Optional> employerBenefit = Optional.empty(); + + private Optional> company = Optional.empty(); + + private Optional> employeePayrollRun = Optional.empty(); + + private Optional> employee = Optional.empty(); + + private Optional> employment = Optional.empty(); + + private Optional> location = Optional.empty(); + + private Optional> payrollRun = Optional.empty(); + + private Optional> team = Optional.empty(); + + private Optional> timeOff = Optional.empty(); + + private Optional> timeOffBalance = Optional.empty(); + + private Optional> bankInfo = Optional.empty(); + + private Optional> payGroup = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> dependent = Optional.empty(); + + private Optional> timesheetEntry = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + benefit(other.getBenefit()); + employerBenefit(other.getEmployerBenefit()); + company(other.getCompany()); + employeePayrollRun(other.getEmployeePayrollRun()); + employee(other.getEmployee()); + employment(other.getEmployment()); + location(other.getLocation()); + payrollRun(other.getPayrollRun()); + team(other.getTeam()); + timeOff(other.getTimeOff()); + timeOffBalance(other.getTimeOffBalance()); + bankInfo(other.getBankInfo()); + payGroup(other.getPayGroup()); + group(other.getGroup()); + dependent(other.getDependent()); + timesheetEntry(other.getTimesheetEntry()); + return this; + } + + @JsonSetter(value = "Benefit", nulls = Nulls.SKIP) + public Builder benefit(Optional> benefit) { + this.benefit = benefit; + return this; + } + + public Builder benefit(List benefit) { + this.benefit = Optional.ofNullable(benefit); + return this; + } + + @JsonSetter(value = "EmployerBenefit", nulls = Nulls.SKIP) + public Builder employerBenefit(Optional> employerBenefit) { + this.employerBenefit = employerBenefit; + return this; + } + + public Builder employerBenefit(List employerBenefit) { + this.employerBenefit = Optional.ofNullable(employerBenefit); + return this; + } + + @JsonSetter(value = "Company", nulls = Nulls.SKIP) + public Builder company(Optional> company) { + this.company = company; + return this; + } + + public Builder company(List company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "EmployeePayrollRun", nulls = Nulls.SKIP) + public Builder employeePayrollRun(Optional> employeePayrollRun) { + this.employeePayrollRun = employeePayrollRun; + return this; + } + + public Builder employeePayrollRun(List employeePayrollRun) { + this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); + return this; + } + + @JsonSetter(value = "Employee", nulls = Nulls.SKIP) + public Builder employee(Optional> employee) { + this.employee = employee; + return this; + } + + public Builder employee(List employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "Employment", nulls = Nulls.SKIP) + public Builder employment(Optional> employment) { + this.employment = employment; + return this; + } + + public Builder employment(List employment) { + this.employment = Optional.ofNullable(employment); + return this; + } + + @JsonSetter(value = "Location", nulls = Nulls.SKIP) + public Builder location(Optional> location) { + this.location = location; + return this; + } + + public Builder location(List location) { + this.location = Optional.ofNullable(location); + return this; + } + + @JsonSetter(value = "PayrollRun", nulls = Nulls.SKIP) + public Builder payrollRun(Optional> payrollRun) { + this.payrollRun = payrollRun; + return this; + } + + public Builder payrollRun(List payrollRun) { + this.payrollRun = Optional.ofNullable(payrollRun); + return this; + } + + @JsonSetter(value = "Team", nulls = Nulls.SKIP) + public Builder team(Optional> team) { + this.team = team; + return this; + } + + public Builder team(List team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "TimeOff", nulls = Nulls.SKIP) + public Builder timeOff(Optional> timeOff) { + this.timeOff = timeOff; + return this; + } + + public Builder timeOff(List timeOff) { + this.timeOff = Optional.ofNullable(timeOff); + return this; + } + + @JsonSetter(value = "TimeOffBalance", nulls = Nulls.SKIP) + public Builder timeOffBalance(Optional> timeOffBalance) { + this.timeOffBalance = timeOffBalance; + return this; + } + + public Builder timeOffBalance(List timeOffBalance) { + this.timeOffBalance = Optional.ofNullable(timeOffBalance); + return this; + } + + @JsonSetter(value = "BankInfo", nulls = Nulls.SKIP) + public Builder bankInfo(Optional> bankInfo) { + this.bankInfo = bankInfo; + return this; + } + + public Builder bankInfo(List bankInfo) { + this.bankInfo = Optional.ofNullable(bankInfo); + return this; + } + + @JsonSetter(value = "PayGroup", nulls = Nulls.SKIP) + public Builder payGroup(Optional> payGroup) { + this.payGroup = payGroup; + return this; + } + + public Builder payGroup(List payGroup) { + this.payGroup = Optional.ofNullable(payGroup); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "Dependent", nulls = Nulls.SKIP) + public Builder dependent(Optional> dependent) { + this.dependent = dependent; + return this; + } + + public Builder dependent(List dependent) { + this.dependent = Optional.ofNullable(dependent); + return this; + } + + @JsonSetter(value = "TimesheetEntry", nulls = Nulls.SKIP) + public Builder timesheetEntry(Optional> timesheetEntry) { + this.timesheetEntry = timesheetEntry; + return this; + } + + public Builder timesheetEntry(List timesheetEntry) { + this.timesheetEntry = Optional.ofNullable(timesheetEntry); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse( + benefit, + employerBenefit, + company, + employeePayrollRun, + employee, + employment, + location, + payrollRun, + team, + timeOff, + timeOffBalance, + bankInfo, + payGroup, + group, + dependent, + timesheetEntry, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..df5a64ddf --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..35fd34c90 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..584ce4440 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..076441522 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> benefit; + + private final Optional> employerBenefit; + + private final Optional> company; + + private final Optional> employeePayrollRun; + + private final Optional> employee; + + private final Optional> employment; + + private final Optional> location; + + private final Optional> payrollRun; + + private final Optional> team; + + private final Optional> timeOff; + + private final Optional> timeOffBalance; + + private final Optional> bankInfo; + + private final Optional> payGroup; + + private final Optional> group; + + private final Optional> dependent; + + private final Optional> timesheetEntry; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> benefit, + Optional> employerBenefit, + Optional> company, + Optional> employeePayrollRun, + Optional> employee, + Optional> employment, + Optional> location, + Optional> payrollRun, + Optional> team, + Optional> timeOff, + Optional> timeOffBalance, + Optional> bankInfo, + Optional> payGroup, + Optional> group, + Optional> dependent, + Optional> timesheetEntry, + Map additionalProperties) { + this.benefit = benefit; + this.employerBenefit = employerBenefit; + this.company = company; + this.employeePayrollRun = employeePayrollRun; + this.employee = employee; + this.employment = employment; + this.location = location; + this.payrollRun = payrollRun; + this.team = team; + this.timeOff = timeOff; + this.timeOffBalance = timeOffBalance; + this.bankInfo = bankInfo; + this.payGroup = payGroup; + this.group = group; + this.dependent = dependent; + this.timesheetEntry = timesheetEntry; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Benefit") + public Optional> getBenefit() { + return benefit; + } + + @JsonProperty("EmployerBenefit") + public Optional> getEmployerBenefit() { + return employerBenefit; + } + + @JsonProperty("Company") + public Optional> getCompany() { + return company; + } + + @JsonProperty("EmployeePayrollRun") + public Optional> getEmployeePayrollRun() { + return employeePayrollRun; + } + + @JsonProperty("Employee") + public Optional> getEmployee() { + return employee; + } + + @JsonProperty("Employment") + public Optional> getEmployment() { + return employment; + } + + @JsonProperty("Location") + public Optional> getLocation() { + return location; + } + + @JsonProperty("PayrollRun") + public Optional> getPayrollRun() { + return payrollRun; + } + + @JsonProperty("Team") + public Optional> getTeam() { + return team; + } + + @JsonProperty("TimeOff") + public Optional> getTimeOff() { + return timeOff; + } + + @JsonProperty("TimeOffBalance") + public Optional> getTimeOffBalance() { + return timeOffBalance; + } + + @JsonProperty("BankInfo") + public Optional> getBankInfo() { + return bankInfo; + } + + @JsonProperty("PayGroup") + public Optional> getPayGroup() { + return payGroup; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("Dependent") + public Optional> getDependent() { + return dependent; + } + + @JsonProperty("TimesheetEntry") + public Optional> getTimesheetEntry() { + return timesheetEntry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return benefit.equals(other.benefit) + && employerBenefit.equals(other.employerBenefit) + && company.equals(other.company) + && employeePayrollRun.equals(other.employeePayrollRun) + && employee.equals(other.employee) + && employment.equals(other.employment) + && location.equals(other.location) + && payrollRun.equals(other.payrollRun) + && team.equals(other.team) + && timeOff.equals(other.timeOff) + && timeOffBalance.equals(other.timeOffBalance) + && bankInfo.equals(other.bankInfo) + && payGroup.equals(other.payGroup) + && group.equals(other.group) + && dependent.equals(other.dependent) + && timesheetEntry.equals(other.timesheetEntry); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.benefit, + this.employerBenefit, + this.company, + this.employeePayrollRun, + this.employee, + this.employment, + this.location, + this.payrollRun, + this.team, + this.timeOff, + this.timeOffBalance, + this.bankInfo, + this.payGroup, + this.group, + this.dependent, + this.timesheetEntry); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> benefit = Optional.empty(); + + private Optional> employerBenefit = Optional.empty(); + + private Optional> company = Optional.empty(); + + private Optional> employeePayrollRun = Optional.empty(); + + private Optional> employee = Optional.empty(); + + private Optional> employment = Optional.empty(); + + private Optional> location = Optional.empty(); + + private Optional> payrollRun = Optional.empty(); + + private Optional> team = Optional.empty(); + + private Optional> timeOff = Optional.empty(); + + private Optional> timeOffBalance = Optional.empty(); + + private Optional> bankInfo = Optional.empty(); + + private Optional> payGroup = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> dependent = Optional.empty(); + + private Optional> timesheetEntry = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + benefit(other.getBenefit()); + employerBenefit(other.getEmployerBenefit()); + company(other.getCompany()); + employeePayrollRun(other.getEmployeePayrollRun()); + employee(other.getEmployee()); + employment(other.getEmployment()); + location(other.getLocation()); + payrollRun(other.getPayrollRun()); + team(other.getTeam()); + timeOff(other.getTimeOff()); + timeOffBalance(other.getTimeOffBalance()); + bankInfo(other.getBankInfo()); + payGroup(other.getPayGroup()); + group(other.getGroup()); + dependent(other.getDependent()); + timesheetEntry(other.getTimesheetEntry()); + return this; + } + + @JsonSetter(value = "Benefit", nulls = Nulls.SKIP) + public Builder benefit(Optional> benefit) { + this.benefit = benefit; + return this; + } + + public Builder benefit(List benefit) { + this.benefit = Optional.ofNullable(benefit); + return this; + } + + @JsonSetter(value = "EmployerBenefit", nulls = Nulls.SKIP) + public Builder employerBenefit(Optional> employerBenefit) { + this.employerBenefit = employerBenefit; + return this; + } + + public Builder employerBenefit(List employerBenefit) { + this.employerBenefit = Optional.ofNullable(employerBenefit); + return this; + } + + @JsonSetter(value = "Company", nulls = Nulls.SKIP) + public Builder company(Optional> company) { + this.company = company; + return this; + } + + public Builder company(List company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "EmployeePayrollRun", nulls = Nulls.SKIP) + public Builder employeePayrollRun(Optional> employeePayrollRun) { + this.employeePayrollRun = employeePayrollRun; + return this; + } + + public Builder employeePayrollRun(List employeePayrollRun) { + this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); + return this; + } + + @JsonSetter(value = "Employee", nulls = Nulls.SKIP) + public Builder employee(Optional> employee) { + this.employee = employee; + return this; + } + + public Builder employee(List employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "Employment", nulls = Nulls.SKIP) + public Builder employment(Optional> employment) { + this.employment = employment; + return this; + } + + public Builder employment(List employment) { + this.employment = Optional.ofNullable(employment); + return this; + } + + @JsonSetter(value = "Location", nulls = Nulls.SKIP) + public Builder location(Optional> location) { + this.location = location; + return this; + } + + public Builder location(List location) { + this.location = Optional.ofNullable(location); + return this; + } + + @JsonSetter(value = "PayrollRun", nulls = Nulls.SKIP) + public Builder payrollRun(Optional> payrollRun) { + this.payrollRun = payrollRun; + return this; + } + + public Builder payrollRun(List payrollRun) { + this.payrollRun = Optional.ofNullable(payrollRun); + return this; + } + + @JsonSetter(value = "Team", nulls = Nulls.SKIP) + public Builder team(Optional> team) { + this.team = team; + return this; + } + + public Builder team(List team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "TimeOff", nulls = Nulls.SKIP) + public Builder timeOff(Optional> timeOff) { + this.timeOff = timeOff; + return this; + } + + public Builder timeOff(List timeOff) { + this.timeOff = Optional.ofNullable(timeOff); + return this; + } + + @JsonSetter(value = "TimeOffBalance", nulls = Nulls.SKIP) + public Builder timeOffBalance(Optional> timeOffBalance) { + this.timeOffBalance = timeOffBalance; + return this; + } + + public Builder timeOffBalance(List timeOffBalance) { + this.timeOffBalance = Optional.ofNullable(timeOffBalance); + return this; + } + + @JsonSetter(value = "BankInfo", nulls = Nulls.SKIP) + public Builder bankInfo(Optional> bankInfo) { + this.bankInfo = bankInfo; + return this; + } + + public Builder bankInfo(List bankInfo) { + this.bankInfo = Optional.ofNullable(bankInfo); + return this; + } + + @JsonSetter(value = "PayGroup", nulls = Nulls.SKIP) + public Builder payGroup(Optional> payGroup) { + this.payGroup = payGroup; + return this; + } + + public Builder payGroup(List payGroup) { + this.payGroup = Optional.ofNullable(payGroup); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "Dependent", nulls = Nulls.SKIP) + public Builder dependent(Optional> dependent) { + this.dependent = dependent; + return this; + } + + public Builder dependent(List dependent) { + this.dependent = Optional.ofNullable(dependent); + return this; + } + + @JsonSetter(value = "TimesheetEntry", nulls = Nulls.SKIP) + public Builder timesheetEntry(Optional> timesheetEntry) { + this.timesheetEntry = timesheetEntry; + return this; + } + + public Builder timesheetEntry(List timesheetEntry) { + this.timesheetEntry = Optional.ofNullable(timesheetEntry); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse( + benefit, + employerBenefit, + company, + employeePayrollRun, + employee, + employment, + location, + payrollRun, + team, + timeOff, + timeOffBalance, + bankInfo, + payGroup, + group, + dependent, + timesheetEntry, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..6acedbd30 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/hris/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..ffa8663af --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingInstanceResponse.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..7ccfc9dec --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/hris/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..232de7fae --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/hris/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..757dd3ece --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/FlsaStatusEnum.java b/src/main/java/com/merge/api/hris/types/FlsaStatusEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/types/FlsaStatusEnum.java rename to src/main/java/com/merge/api/hris/types/FlsaStatusEnum.java index c9adbcaa1..912126ac4 100644 --- a/src/main/java/com/merge/api/resources/hris/types/FlsaStatusEnum.java +++ b/src/main/java/com/merge/api/hris/types/FlsaStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/GenderEnum.java b/src/main/java/com/merge/api/hris/types/GenderEnum.java new file mode 100644 index 000000000..cbeffa778 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GenderEnum.java @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum GenderEnum { + MALE("MALE"), + + FEMALE("FEMALE"), + + NON_BINARY("NON-BINARY"), + + OTHER("OTHER"), + + PREFER_NOT_TO_DISCLOSE("PREFER_NOT_TO_DISCLOSE"); + + private final String value; + + GenderEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/hris/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..86200349b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/Group.java b/src/main/java/com/merge/api/hris/types/Group.java new file mode 100644 index 000000000..cbf46f61d --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/Group.java @@ -0,0 +1,394 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Group.Builder.class) +public final class Group { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional parentGroup; + + private final Optional name; + + private final Optional type; + + private final Optional isCommonlyUsedAsTeam; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Group( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional parentGroup, + Optional name, + Optional type, + Optional isCommonlyUsedAsTeam, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.parentGroup = parentGroup; + this.name = name; + this.type = type; + this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The parent group for this group. + */ + @JsonProperty("parent_group") + public Optional getParentGroup() { + return parentGroup; + } + + /** + * @return The group name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The Group type returned directly from the third-party. + *
    + *
  • TEAM - TEAM
  • + *
  • DEPARTMENT - DEPARTMENT
  • + *
  • COST_CENTER - COST_CENTER
  • + *
  • BUSINESS_UNIT - BUSINESS_UNIT
  • + *
  • GROUP - GROUP
  • + *
+ */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return Indicates whether the Group refers to a team in the third party platform. Note that this is an opinionated view based on how Merge observes most organizations representing teams in each third party platform. If your customer uses a platform different from most, there is a chance this will not be correct. + */ + @JsonProperty("is_commonly_used_as_team") + public Optional getIsCommonlyUsedAsTeam() { + return isCommonlyUsedAsTeam; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Group && equalTo((Group) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Group other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && parentGroup.equals(other.parentGroup) + && name.equals(other.name) + && type.equals(other.type) + && isCommonlyUsedAsTeam.equals(other.isCommonlyUsedAsTeam) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.parentGroup, + this.name, + this.type, + this.isCommonlyUsedAsTeam, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional parentGroup = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional isCommonlyUsedAsTeam = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Group other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + parentGroup(other.getParentGroup()); + name(other.getName()); + type(other.getType()); + isCommonlyUsedAsTeam(other.getIsCommonlyUsedAsTeam()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "parent_group", nulls = Nulls.SKIP) + public Builder parentGroup(Optional parentGroup) { + this.parentGroup = parentGroup; + return this; + } + + public Builder parentGroup(String parentGroup) { + this.parentGroup = Optional.ofNullable(parentGroup); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(GroupTypeEnum type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "is_commonly_used_as_team", nulls = Nulls.SKIP) + public Builder isCommonlyUsedAsTeam(Optional isCommonlyUsedAsTeam) { + this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; + return this; + } + + public Builder isCommonlyUsedAsTeam(Boolean isCommonlyUsedAsTeam) { + this.isCommonlyUsedAsTeam = Optional.ofNullable(isCommonlyUsedAsTeam); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Group build() { + return new Group( + id, + remoteId, + createdAt, + modifiedAt, + parentGroup, + name, + type, + isCommonlyUsedAsTeam, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/GroupTypeEnum.java b/src/main/java/com/merge/api/hris/types/GroupTypeEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/types/GroupTypeEnum.java rename to src/main/java/com/merge/api/hris/types/GroupTypeEnum.java index 70685500c..4ba0798d1 100644 --- a/src/main/java/com/merge/api/resources/hris/types/GroupTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/GroupTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/GroupsListRequest.java b/src/main/java/com/merge/api/hris/types/GroupsListRequest.java new file mode 100644 index 000000000..6478d6ab1 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsListRequest.java @@ -0,0 +1,510 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsListRequest.Builder.class) +public final class GroupsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonlyUsedAsTeam; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional names; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Optional types; + + private final Map additionalProperties; + + private GroupsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonlyUsedAsTeam, + Optional modifiedAfter, + Optional modifiedBefore, + Optional names, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Optional types, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.names = names; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.types = types; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, specifies whether to return only Group objects which refer to a team in the third party platform. Note that this is an opinionated view based on how a team may be represented in the third party platform. + */ + @JsonProperty("is_commonly_used_as_team") + public Optional getIsCommonlyUsedAsTeam() { + return isCommonlyUsedAsTeam; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return If provided, will only return groups with these names. Multiple values can be separated by commas. + */ + @JsonProperty("names") + public Optional getNames() { + return names; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + /** + * @return If provided, will only return groups of these types. Multiple values can be separated by commas. + */ + @JsonProperty("types") + public Optional getTypes() { + return types; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsListRequest && equalTo((GroupsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonlyUsedAsTeam.equals(other.isCommonlyUsedAsTeam) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && names.equals(other.names) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins) + && types.equals(other.types); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonlyUsedAsTeam, + this.modifiedAfter, + this.modifiedBefore, + this.names, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins, + this.types); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonlyUsedAsTeam = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional names = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional types = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonlyUsedAsTeam(other.getIsCommonlyUsedAsTeam()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + names(other.getNames()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + types(other.getTypes()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "is_commonly_used_as_team", nulls = Nulls.SKIP) + public Builder isCommonlyUsedAsTeam(Optional isCommonlyUsedAsTeam) { + this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; + return this; + } + + public Builder isCommonlyUsedAsTeam(String isCommonlyUsedAsTeam) { + this.isCommonlyUsedAsTeam = Optional.ofNullable(isCommonlyUsedAsTeam); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "names", nulls = Nulls.SKIP) + public Builder names(Optional names) { + this.names = names; + return this; + } + + public Builder names(String names) { + this.names = Optional.ofNullable(names); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + @JsonSetter(value = "types", nulls = Nulls.SKIP) + public Builder types(Optional types) { + this.types = types; + return this; + } + + public Builder types(String types) { + this.types = Optional.ofNullable(types); + return this; + } + + public GroupsListRequest build() { + return new GroupsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonlyUsedAsTeam, + modifiedAfter, + modifiedBefore, + names, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + types, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequest.java new file mode 100644 index 000000000..c5bca2763 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequest.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsRetrieveRequest.Builder.class) +public final class GroupsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private GroupsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsRetrieveRequest && equalTo((GroupsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public GroupsRetrieveRequest build() { + return new GroupsRetrieveRequest( + includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/IgnoreCommonModelRequest.java b/src/main/java/com/merge/api/hris/types/IgnoreCommonModelRequest.java new file mode 100644 index 000000000..66d5d67ed --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/IgnoreCommonModelRequest.java @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IgnoreCommonModelRequest.Builder.class) +public final class IgnoreCommonModelRequest { + private final ReasonEnum reason; + + private final Optional message; + + private final Map additionalProperties; + + private IgnoreCommonModelRequest( + ReasonEnum reason, Optional message, Map additionalProperties) { + this.reason = reason; + this.message = message; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("reason") + public ReasonEnum getReason() { + return reason; + } + + @JsonProperty("message") + public Optional getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IgnoreCommonModelRequest && equalTo((IgnoreCommonModelRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IgnoreCommonModelRequest other) { + return reason.equals(other.reason) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.reason, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ReasonStage builder() { + return new Builder(); + } + + public interface ReasonStage { + _FinalStage reason(@NotNull ReasonEnum reason); + + Builder from(IgnoreCommonModelRequest other); + } + + public interface _FinalStage { + IgnoreCommonModelRequest build(); + + _FinalStage message(Optional message); + + _FinalStage message(String message); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ReasonStage, _FinalStage { + private ReasonEnum reason; + + private Optional message = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IgnoreCommonModelRequest other) { + reason(other.getReason()); + message(other.getMessage()); + return this; + } + + @java.lang.Override + @JsonSetter("reason") + public _FinalStage reason(@NotNull ReasonEnum reason) { + this.reason = reason; + return this; + } + + @java.lang.Override + public _FinalStage message(String message) { + this.message = Optional.ofNullable(message); + return this; + } + + @java.lang.Override + @JsonSetter(value = "message", nulls = Nulls.SKIP) + public _FinalStage message(Optional message) { + this.message = message; + return this; + } + + @java.lang.Override + public IgnoreCommonModelRequest build() { + return new IgnoreCommonModelRequest(reason, message, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/hris/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..01324d7b1 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/hris/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..ee9dc5e97 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/Issue.java b/src/main/java/com/merge/api/hris/types/Issue.java new file mode 100644 index 000000000..a4a7ef0d6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/Issue.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage status(Optional status); + + _FinalStage status(IssueStatusEnum status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

+ *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/IssueStatusEnum.java b/src/main/java/com/merge/api/hris/types/IssueStatusEnum.java new file mode 100644 index 000000000..4519b8a58 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssueStatusEnum { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssueStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/IssuesListRequest.java b/src/main/java/com/merge/api/hris/types/IssuesListRequest.java new file mode 100644 index 000000000..b6de6bd8f --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/IssuesListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/hris/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..d75c34e79 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssuesListRequestStatus { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssuesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/LanguageEnum.java b/src/main/java/com/merge/api/hris/types/LanguageEnum.java new file mode 100644 index 000000000..7ff675b54 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LanguageEnum { + EN("en"), + + DE("de"); + + private final String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/LastSyncResultEnum.java b/src/main/java/com/merge/api/hris/types/LastSyncResultEnum.java new file mode 100644 index 000000000..6f34db619 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/LastSyncResultEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LastSyncResultEnum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + LastSyncResultEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/LinkToken.java b/src/main/java/com/merge/api/hris/types/LinkToken.java new file mode 100644 index 000000000..12c06398e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/LinkToken.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkToken.Builder.class) +public final class LinkToken { + private final String linkToken; + + private final Optional integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/hris/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..a50bab99b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/hris/types/LinkedAccountStatus.java new file mode 100644 index 000000000..44de9021c --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/LinkedAccountStatus.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) +public final class LinkedAccountStatus { + private final String linkedAccountStatus; + + private final boolean canMakeRequest; + + private final Map additionalProperties; + + private LinkedAccountStatus( + String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { + this.linkedAccountStatus = linkedAccountStatus; + this.canMakeRequest = canMakeRequest; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_status") + public String getLinkedAccountStatus() { + return linkedAccountStatus; + } + + @JsonProperty("can_make_request") + public boolean getCanMakeRequest() { + return canMakeRequest; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountStatus other) { + return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountStatusStage builder() { + return new Builder(); + } + + public interface LinkedAccountStatusStage { + CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); + + Builder from(LinkedAccountStatus other); + } + + public interface CanMakeRequestStage { + _FinalStage canMakeRequest(boolean canMakeRequest); + } + + public interface _FinalStage { + LinkedAccountStatus build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { + private String linkedAccountStatus; + + private boolean canMakeRequest; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @java.lang.Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @java.lang.Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..11ce60162 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java @@ -0,0 +1,457 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing + *
    + *
  • hris - hris
  • + *
  • ats - ats
  • + *
  • accounting - accounting
  • + *
  • ticketing - ticketing
  • + *
  • crm - crm
  • + *
  • mktg - mktg
  • + *
  • filestorage - filestorage
  • + *
+ */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..2574937ff --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LinkedAccountsListRequestCategory { + ACCOUNTING("accounting"), + + ATS("ats"), + + CRM("crm"), + + FILESTORAGE("filestorage"), + + HRIS("hris"), + + MKTG("mktg"), + + TICKETING("ticketing"); + + private final String value; + + LinkedAccountsListRequestCategory(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/Location.java b/src/main/java/com/merge/api/hris/types/Location.java similarity index 97% rename from src/main/java/com/merge/api/resources/hris/types/Location.java rename to src/main/java/com/merge/api/hris/types/Location.java index 8930c6557..f868d38b0 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Location.java +++ b/src/main/java/com/merge/api/hris/types/Location.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -45,9 +45,9 @@ public final class Location { private final Optional zipCode; - private final Optional country; + private final Optional country; - private final Optional locationType; + private final Optional locationType; private final Optional remoteWasDeleted; @@ -69,8 +69,8 @@ private Location( Optional city, Optional state, Optional zipCode, - Optional country, - Optional locationType, + Optional country, + Optional locationType, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -434,7 +434,7 @@ public Optional getZipCode() { * */ @JsonProperty("country") - public Optional getCountry() { + public Optional getCountry() { return country; } @@ -446,7 +446,7 @@ public Optional getCountry() { * */ @JsonProperty("location_type") - public Optional getLocationType() { + public Optional getLocationType() { return locationType; } @@ -552,9 +552,9 @@ public static final class Builder { private Optional zipCode = Optional.empty(); - private Optional country = Optional.empty(); + private Optional country = Optional.empty(); - private Optional locationType = Optional.empty(); + private Optional locationType = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -709,23 +709,23 @@ public Builder zipCode(String zipCode) { } @JsonSetter(value = "country", nulls = Nulls.SKIP) - public Builder country(Optional country) { + public Builder country(Optional country) { this.country = country; return this; } - public Builder country(LocationCountry country) { + public Builder country(CountryEnum country) { this.country = Optional.ofNullable(country); return this; } @JsonSetter(value = "location_type", nulls = Nulls.SKIP) - public Builder locationType(Optional locationType) { + public Builder locationType(Optional locationType) { this.locationType = locationType; return this; } - public Builder locationType(LocationLocationType locationType) { + public Builder locationType(LocationTypeEnum locationType) { this.locationType = Optional.ofNullable(locationType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/LocationTypeEnum.java b/src/main/java/com/merge/api/hris/types/LocationTypeEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/types/LocationTypeEnum.java rename to src/main/java/com/merge/api/hris/types/LocationTypeEnum.java index 0d175f070..e7ddb6d9b 100644 --- a/src/main/java/com/merge/api/resources/hris/types/LocationTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/LocationTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/locations/requests/LocationsListRequest.java b/src/main/java/com/merge/api/hris/types/LocationsListRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/locations/requests/LocationsListRequest.java rename to src/main/java/com/merge/api/hris/types/LocationsListRequest.java index e4387d592..32c655153 100644 --- a/src/main/java/com/merge/api/resources/hris/locations/requests/LocationsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/LocationsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.locations.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.locations.types.LocationsListRequestLocationType; -import com.merge.api.resources.hris.locations.types.LocationsListRequestRemoteFields; -import com.merge.api.resources.hris.locations.types.LocationsListRequestShowEnumOrigins; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestLocationType.java b/src/main/java/com/merge/api/hris/types/LocationsListRequestLocationType.java similarity index 89% rename from src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestLocationType.java rename to src/main/java/com/merge/api/hris/types/LocationsListRequestLocationType.java index c79a93147..cb3f14ce7 100644 --- a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestLocationType.java +++ b/src/main/java/com/merge/api/hris/types/LocationsListRequestLocationType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.locations.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/LocationsListRequestRemoteFields.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/LocationsListRequestRemoteFields.java index c1542467d..0c10b0c11 100644 --- a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/LocationsListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.locations.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/LocationsListRequestShowEnumOrigins.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/LocationsListRequestShowEnumOrigins.java index d2137bc96..157dad022 100644 --- a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/LocationsListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.locations.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/locations/requests/LocationsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/LocationsRetrieveRequest.java similarity index 80% rename from src/main/java/com/merge/api/resources/hris/locations/requests/LocationsRetrieveRequest.java rename to src/main/java/com/merge/api/hris/types/LocationsRetrieveRequest.java index 684e004c8..4b1304f83 100644 --- a/src/main/java/com/merge/api/resources/hris/locations/requests/LocationsRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/LocationsRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.locations.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.locations.types.LocationsRetrieveRequestRemoteFields; -import com.merge.api.resources.hris.locations.types.LocationsRetrieveRequestShowEnumOrigins; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -24,6 +22,8 @@ public final class LocationsRetrieveRequest { private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -32,10 +32,12 @@ public final class LocationsRetrieveRequest { private LocationsRetrieveRequest( Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -49,6 +51,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -78,13 +88,14 @@ public Map getAdditionalProperties() { private boolean equalTo(LocationsRetrieveRequest other) { return includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash(this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -100,6 +111,8 @@ public static Builder builder() { public static final class Builder { private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -111,6 +124,7 @@ private Builder() {} public Builder from(LocationsRetrieveRequest other) { includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; @@ -127,6 +141,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -150,7 +175,8 @@ public Builder showEnumOrigins(LocationsRetrieveRequestShowEnumOrigins showEnumO } public LocationsRetrieveRequest build() { - return new LocationsRetrieveRequest(includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + return new LocationsRetrieveRequest( + includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/LocationsRetrieveRequestRemoteFields.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/locations/types/LocationsRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/LocationsRetrieveRequestRemoteFields.java index ef4663b68..7035f2e18 100644 --- a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/LocationsRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.locations.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/LocationsRetrieveRequestShowEnumOrigins.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/locations/types/LocationsRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/LocationsRetrieveRequestShowEnumOrigins.java index b6e868531..113da86f3 100644 --- a/src/main/java/com/merge/api/resources/hris/locations/types/LocationsRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/LocationsRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.locations.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/MaritalStatusEnum.java b/src/main/java/com/merge/api/hris/types/MaritalStatusEnum.java similarity index 93% rename from src/main/java/com/merge/api/resources/hris/types/MaritalStatusEnum.java rename to src/main/java/com/merge/api/hris/types/MaritalStatusEnum.java index 2d5dba1dc..df776306b 100644 --- a/src/main/java/com/merge/api/resources/hris/types/MaritalStatusEnum.java +++ b/src/main/java/com/merge/api/hris/types/MaritalStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/MetaResponse.java b/src/main/java/com/merge/api/hris/types/MetaResponse.java new file mode 100644 index 000000000..009bfe283 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/MetaResponse.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MetaResponse.Builder.class) +public final class MetaResponse { + private final Map requestSchema; + + private final Optional> remoteFieldClasses; + + private final Optional status; + + private final boolean hasConditionalParams; + + private final boolean hasRequiredLinkedAccountParams; + + private final Map additionalProperties; + + private MetaResponse( + Map requestSchema, + Optional> remoteFieldClasses, + Optional status, + boolean hasConditionalParams, + boolean hasRequiredLinkedAccountParams, + Map additionalProperties) { + this.requestSchema = requestSchema; + this.remoteFieldClasses = remoteFieldClasses; + this.status = status; + this.hasConditionalParams = hasConditionalParams; + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("request_schema") + public Map getRequestSchema() { + return requestSchema; + } + + @JsonProperty("remote_field_classes") + public Optional> getRemoteFieldClasses() { + return remoteFieldClasses; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("has_conditional_params") + public boolean getHasConditionalParams() { + return hasConditionalParams; + } + + @JsonProperty("has_required_linked_account_params") + public boolean getHasRequiredLinkedAccountParams() { + return hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MetaResponse && equalTo((MetaResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MetaResponse other) { + return requestSchema.equals(other.requestSchema) + && remoteFieldClasses.equals(other.remoteFieldClasses) + && status.equals(other.status) + && hasConditionalParams == other.hasConditionalParams + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasConditionalParamsStage builder() { + return new Builder(); + } + + public interface HasConditionalParamsStage { + HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); + + Builder from(MetaResponse other); + } + + public interface HasRequiredLinkedAccountParamsStage { + _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); + } + + public interface _FinalStage { + MetaResponse build(); + + _FinalStage requestSchema(Map requestSchema); + + _FinalStage putAllRequestSchema(Map requestSchema); + + _FinalStage requestSchema(String key, JsonNode value); + + _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); + + _FinalStage remoteFieldClasses(Map remoteFieldClasses); + + _FinalStage status(Optional status); + + _FinalStage status(LinkedAccountStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { + private boolean hasConditionalParams; + + private boolean hasRequiredLinkedAccountParams; + + private Optional status = Optional.empty(); + + private Optional> remoteFieldClasses = Optional.empty(); + + private Map requestSchema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @java.lang.Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @java.lang.Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @java.lang.Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @java.lang.Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/MethodEnum.java b/src/main/java/com/merge/api/hris/types/MethodEnum.java new file mode 100644 index 000000000..7dd25e7f7 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MethodEnum { + GET("GET"), + + OPTIONS("OPTIONS"), + + HEAD("HEAD"), + + POST("POST"), + + PUT("PUT"), + + PATCH("PATCH"), + + DELETE("DELETE"); + + private final String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/ModelOperation.java b/src/main/java/com/merge/api/hris/types/ModelOperation.java new file mode 100644 index 000000000..33665b056 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ModelOperation.java @@ -0,0 +1,226 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/hris/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..d6cffea7e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/hris/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..1bfc3db57 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/hris/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..529443159 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/MultipartFormFieldRequest.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(EncodingEnum encoding); + + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

The name of the form field

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

The data for the form field.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

The MIME type of the file, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

The file name of the form field, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

The encoding of the value of data. Defaults to RAW if not defined.

+ *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(EncodingEnum encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/hris/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..b458679a2 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/hris/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..b3b514397 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedBankInfoList.java b/src/main/java/com/merge/api/hris/types/PaginatedBankInfoList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedBankInfoList.java rename to src/main/java/com/merge/api/hris/types/PaginatedBankInfoList.java index 2b610f3e4..70677c999 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedBankInfoList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedBankInfoList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedBenefitList.java b/src/main/java/com/merge/api/hris/types/PaginatedBenefitList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedBenefitList.java rename to src/main/java/com/merge/api/hris/types/PaginatedBenefitList.java index 0e104063b..01f857d3c 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedBenefitList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedBenefitList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedCompanyList.java b/src/main/java/com/merge/api/hris/types/PaginatedCompanyList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedCompanyList.java rename to src/main/java/com/merge/api/hris/types/PaginatedCompanyList.java index deab25315..499995684 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedCompanyList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedCompanyList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedDependentList.java b/src/main/java/com/merge/api/hris/types/PaginatedDependentList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedDependentList.java rename to src/main/java/com/merge/api/hris/types/PaginatedDependentList.java index 711fa58a4..1082ccaae 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedDependentList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedDependentList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedEmployeeList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmployeeList.java new file mode 100644 index 000000000..29d01d731 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmployeeList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedEmployeeList.Builder.class) +public final class PaginatedEmployeeList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedEmployeeList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedEmployeeList && equalTo((PaginatedEmployeeList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedEmployeeList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedEmployeeList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedEmployeeList build() { + return new PaginatedEmployeeList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmployeePayrollRunList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmployeePayrollRunList.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedEmployeePayrollRunList.java rename to src/main/java/com/merge/api/hris/types/PaginatedEmployeePayrollRunList.java index 6885d5fea..5542453a6 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmployeePayrollRunList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmployeePayrollRunList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmployerBenefitList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmployerBenefitList.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedEmployerBenefitList.java rename to src/main/java/com/merge/api/hris/types/PaginatedEmployerBenefitList.java index 94e9866b3..c1c850910 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmployerBenefitList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmployerBenefitList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmploymentList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmploymentList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedEmploymentList.java rename to src/main/java/com/merge/api/hris/types/PaginatedEmploymentList.java index 5432a0680..65c96a8de 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmploymentList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmploymentList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedGroupList.java b/src/main/java/com/merge/api/hris/types/PaginatedGroupList.java new file mode 100644 index 000000000..9937b88cb --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PaginatedGroupList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedGroupList.Builder.class) +public final class PaginatedGroupList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedGroupList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedGroupList && equalTo((PaginatedGroupList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedGroupList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedGroupList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedGroupList build() { + return new PaginatedGroupList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/PaginatedIssueList.java b/src/main/java/com/merge/api/hris/types/PaginatedIssueList.java new file mode 100644 index 000000000..a1b1a45cb --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedLocationList.java b/src/main/java/com/merge/api/hris/types/PaginatedLocationList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedLocationList.java rename to src/main/java/com/merge/api/hris/types/PaginatedLocationList.java index 31278cc02..2c780ba0d 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedLocationList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedLocationList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedPayGroupList.java b/src/main/java/com/merge/api/hris/types/PaginatedPayGroupList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedPayGroupList.java rename to src/main/java/com/merge/api/hris/types/PaginatedPayGroupList.java index 8a26bed9a..b673f965f 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedPayGroupList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedPayGroupList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedPayrollRunList.java b/src/main/java/com/merge/api/hris/types/PaginatedPayrollRunList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedPayrollRunList.java rename to src/main/java/com/merge/api/hris/types/PaginatedPayrollRunList.java index 7a95e6e7a..d75077247 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedPayrollRunList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedPayrollRunList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/hris/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..502e22c3e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/PaginatedTeamList.java b/src/main/java/com/merge/api/hris/types/PaginatedTeamList.java new file mode 100644 index 000000000..2258a0dd6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PaginatedTeamList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTeamList.Builder.class) +public final class PaginatedTeamList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTeamList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTeamList && equalTo((PaginatedTeamList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTeamList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedTeamList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedTeamList build() { + return new PaginatedTeamList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedTimeOffBalanceList.java b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffBalanceList.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedTimeOffBalanceList.java rename to src/main/java/com/merge/api/hris/types/PaginatedTimeOffBalanceList.java index 966606bef..4b348368f 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedTimeOffBalanceList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffBalanceList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedTimeOffList.java b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffList.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedTimeOffList.java rename to src/main/java/com/merge/api/hris/types/PaginatedTimeOffList.java index 0ff2b70ab..3c24bf7bc 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedTimeOffList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedTimesheetEntryList.java b/src/main/java/com/merge/api/hris/types/PaginatedTimesheetEntryList.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/PaginatedTimesheetEntryList.java rename to src/main/java/com/merge/api/hris/types/PaginatedTimesheetEntryList.java index 1f56015f5..52c8751e7 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedTimesheetEntryList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedTimesheetEntryList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/hris/types/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..0cc25de6c --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PatchedEditFieldMappingRequest.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) +public final class PatchedEditFieldMappingRequest { + private final Optional> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Map additionalProperties) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + return this; + } + + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/PayCurrencyEnum.java b/src/main/java/com/merge/api/hris/types/PayCurrencyEnum.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/PayCurrencyEnum.java rename to src/main/java/com/merge/api/hris/types/PayCurrencyEnum.java index 4e86a2658..8b73b81ce 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PayCurrencyEnum.java +++ b/src/main/java/com/merge/api/hris/types/PayCurrencyEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/PayFrequencyEnum.java b/src/main/java/com/merge/api/hris/types/PayFrequencyEnum.java similarity index 93% rename from src/main/java/com/merge/api/resources/hris/types/PayFrequencyEnum.java rename to src/main/java/com/merge/api/hris/types/PayFrequencyEnum.java index 5f064c5c7..cf63faaf4 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PayFrequencyEnum.java +++ b/src/main/java/com/merge/api/hris/types/PayFrequencyEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/PayGroup.java b/src/main/java/com/merge/api/hris/types/PayGroup.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/PayGroup.java rename to src/main/java/com/merge/api/hris/types/PayGroup.java index f7c529b2f..08eb686bd 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PayGroup.java +++ b/src/main/java/com/merge/api/hris/types/PayGroup.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/paygroups/requests/PayGroupsListRequest.java b/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/paygroups/requests/PayGroupsListRequest.java rename to src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java index 0040a0b1f..645f91aec 100644 --- a/src/main/java/com/merge/api/resources/hris/paygroups/requests/PayGroupsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.paygroups.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/PayGroupsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/PayGroupsRetrieveRequest.java new file mode 100644 index 000000000..77d895f20 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/PayGroupsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PayGroupsRetrieveRequest.Builder.class) +public final class PayGroupsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private PayGroupsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PayGroupsRetrieveRequest && equalTo((PayGroupsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PayGroupsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PayGroupsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public PayGroupsRetrieveRequest build() { + return new PayGroupsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/PayPeriodEnum.java b/src/main/java/com/merge/api/hris/types/PayPeriodEnum.java similarity index 93% rename from src/main/java/com/merge/api/resources/hris/types/PayPeriodEnum.java rename to src/main/java/com/merge/api/hris/types/PayPeriodEnum.java index 3c9d6c1fb..ac2eac120 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PayPeriodEnum.java +++ b/src/main/java/com/merge/api/hris/types/PayPeriodEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/PayrollRun.java b/src/main/java/com/merge/api/hris/types/PayrollRun.java similarity index 94% rename from src/main/java/com/merge/api/resources/hris/types/PayrollRun.java rename to src/main/java/com/merge/api/hris/types/PayrollRun.java index 323b2bb3b..8d9451942 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PayrollRun.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRun.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -31,9 +31,9 @@ public final class PayrollRun { private final Optional modifiedAt; - private final Optional runState; + private final Optional runState; - private final Optional runType; + private final Optional runType; private final Optional startDate; @@ -54,8 +54,8 @@ private PayrollRun( Optional remoteId, Optional createdAt, Optional modifiedAt, - Optional runState, - Optional runType, + Optional runState, + Optional runType, Optional startDate, Optional endDate, Optional checkDate, @@ -118,7 +118,7 @@ public Optional getModifiedAt() { * */ @JsonProperty("run_state") - public Optional getRunState() { + public Optional getRunState() { return runState; } @@ -133,7 +133,7 @@ public Optional getRunState() { * */ @JsonProperty("run_type") - public Optional getRunType() { + public Optional getRunType() { return runType; } @@ -241,9 +241,9 @@ public static final class Builder { private Optional modifiedAt = Optional.empty(); - private Optional runState = Optional.empty(); + private Optional runState = Optional.empty(); - private Optional runType = Optional.empty(); + private Optional runType = Optional.empty(); private Optional startDate = Optional.empty(); @@ -323,23 +323,23 @@ public Builder modifiedAt(OffsetDateTime modifiedAt) { } @JsonSetter(value = "run_state", nulls = Nulls.SKIP) - public Builder runState(Optional runState) { + public Builder runState(Optional runState) { this.runState = runState; return this; } - public Builder runState(PayrollRunRunState runState) { + public Builder runState(RunStateEnum runState) { this.runState = Optional.ofNullable(runState); return this; } @JsonSetter(value = "run_type", nulls = Nulls.SKIP) - public Builder runType(Optional runType) { + public Builder runType(Optional runType) { this.runType = runType; return this; } - public Builder runType(PayrollRunRunType runType) { + public Builder runType(RunTypeEnum runType) { this.runType = Optional.ofNullable(runType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/requests/PayrollRunsListRequest.java b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/payrollruns/requests/PayrollRunsListRequest.java rename to src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java index f5b0d0101..7e08c6675 100644 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/requests/PayrollRunsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.payrollruns.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.payrollruns.types.PayrollRunsListRequestRemoteFields; -import com.merge.api.resources.hris.payrollruns.types.PayrollRunsListRequestRunType; -import com.merge.api.resources.hris.payrollruns.types.PayrollRunsListRequestShowEnumOrigins; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequestRemoteFields.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/PayrollRunsListRequestRemoteFields.java index 60748aa9e..13183b3ea 100644 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.payrollruns.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestRunType.java b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequestRunType.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestRunType.java rename to src/main/java/com/merge/api/hris/types/PayrollRunsListRequestRunType.java index e41508a3b..eda4ef585 100644 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestRunType.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequestRunType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.payrollruns.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequestShowEnumOrigins.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/PayrollRunsListRequestShowEnumOrigins.java index 456826181..a0b013eed 100644 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.payrollruns.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/requests/PayrollRunsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequest.java similarity index 80% rename from src/main/java/com/merge/api/resources/hris/payrollruns/requests/PayrollRunsRetrieveRequest.java rename to src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequest.java index 49d673072..87928e61d 100644 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/requests/PayrollRunsRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.payrollruns.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.payrollruns.types.PayrollRunsRetrieveRequestRemoteFields; -import com.merge.api.resources.hris.payrollruns.types.PayrollRunsRetrieveRequestShowEnumOrigins; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -24,6 +22,8 @@ public final class PayrollRunsRetrieveRequest { private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -32,10 +32,12 @@ public final class PayrollRunsRetrieveRequest { private PayrollRunsRetrieveRequest( Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -49,6 +51,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -78,13 +88,14 @@ public Map getAdditionalProperties() { private boolean equalTo(PayrollRunsRetrieveRequest other) { return includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash(this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -100,6 +111,8 @@ public static Builder builder() { public static final class Builder { private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -111,6 +124,7 @@ private Builder() {} public Builder from(PayrollRunsRetrieveRequest other) { includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; @@ -127,6 +141,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -151,7 +176,7 @@ public Builder showEnumOrigins(PayrollRunsRetrieveRequestShowEnumOrigins showEnu public PayrollRunsRetrieveRequest build() { return new PayrollRunsRetrieveRequest( - includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequestRemoteFields.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequestRemoteFields.java index db94d7239..6c70bba90 100644 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.payrollruns.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequestShowEnumOrigins.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequestShowEnumOrigins.java index 470773c6f..6adb871a8 100644 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/types/PayrollRunsRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.payrollruns.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/PolicyTypeEnum.java b/src/main/java/com/merge/api/hris/types/PolicyTypeEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/types/PolicyTypeEnum.java rename to src/main/java/com/merge/api/hris/types/PolicyTypeEnum.java index c19488e95..ddfe3682e 100644 --- a/src/main/java/com/merge/api/resources/hris/types/PolicyTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/PolicyTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/ReasonEnum.java b/src/main/java/com/merge/api/hris/types/ReasonEnum.java new file mode 100644 index 000000000..35ec3ffda --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ReasonEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ReasonEnum { + GENERAL_CUSTOMER_REQUEST("GENERAL_CUSTOMER_REQUEST"), + + GDPR("GDPR"), + + OTHER("OTHER"); + + private final String value; + + ReasonEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/RelationshipEnum.java b/src/main/java/com/merge/api/hris/types/RelationshipEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/types/RelationshipEnum.java rename to src/main/java/com/merge/api/hris/types/RelationshipEnum.java index 9fd9862f0..dff24c12a 100644 --- a/src/main/java/com/merge/api/resources/hris/types/RelationshipEnum.java +++ b/src/main/java/com/merge/api/hris/types/RelationshipEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/RemoteData.java b/src/main/java/com/merge/api/hris/types/RemoteData.java new file mode 100644 index 000000000..7492bf596 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteData.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

The third-party API path that is being called.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/hris/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..3c1e0101a --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteEndpointInfo.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteFieldApi.java b/src/main/java/com/merge/api/hris/types/RemoteFieldApi.java new file mode 100644 index 000000000..1d8e99c0b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteFieldApi.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/hris/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..2bbcbda59 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/hris/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..7ed6506f3 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteFieldApiResponse.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> benefit; + + private final Optional> employerBenefit; + + private final Optional> company; + + private final Optional> employeePayrollRun; + + private final Optional> employee; + + private final Optional> employment; + + private final Optional> location; + + private final Optional> payrollRun; + + private final Optional> team; + + private final Optional> timeOff; + + private final Optional> timeOffBalance; + + private final Optional> bankInfo; + + private final Optional> payGroup; + + private final Optional> group; + + private final Optional> dependent; + + private final Optional> timesheetEntry; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> benefit, + Optional> employerBenefit, + Optional> company, + Optional> employeePayrollRun, + Optional> employee, + Optional> employment, + Optional> location, + Optional> payrollRun, + Optional> team, + Optional> timeOff, + Optional> timeOffBalance, + Optional> bankInfo, + Optional> payGroup, + Optional> group, + Optional> dependent, + Optional> timesheetEntry, + Map additionalProperties) { + this.benefit = benefit; + this.employerBenefit = employerBenefit; + this.company = company; + this.employeePayrollRun = employeePayrollRun; + this.employee = employee; + this.employment = employment; + this.location = location; + this.payrollRun = payrollRun; + this.team = team; + this.timeOff = timeOff; + this.timeOffBalance = timeOffBalance; + this.bankInfo = bankInfo; + this.payGroup = payGroup; + this.group = group; + this.dependent = dependent; + this.timesheetEntry = timesheetEntry; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Benefit") + public Optional> getBenefit() { + return benefit; + } + + @JsonProperty("EmployerBenefit") + public Optional> getEmployerBenefit() { + return employerBenefit; + } + + @JsonProperty("Company") + public Optional> getCompany() { + return company; + } + + @JsonProperty("EmployeePayrollRun") + public Optional> getEmployeePayrollRun() { + return employeePayrollRun; + } + + @JsonProperty("Employee") + public Optional> getEmployee() { + return employee; + } + + @JsonProperty("Employment") + public Optional> getEmployment() { + return employment; + } + + @JsonProperty("Location") + public Optional> getLocation() { + return location; + } + + @JsonProperty("PayrollRun") + public Optional> getPayrollRun() { + return payrollRun; + } + + @JsonProperty("Team") + public Optional> getTeam() { + return team; + } + + @JsonProperty("TimeOff") + public Optional> getTimeOff() { + return timeOff; + } + + @JsonProperty("TimeOffBalance") + public Optional> getTimeOffBalance() { + return timeOffBalance; + } + + @JsonProperty("BankInfo") + public Optional> getBankInfo() { + return bankInfo; + } + + @JsonProperty("PayGroup") + public Optional> getPayGroup() { + return payGroup; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("Dependent") + public Optional> getDependent() { + return dependent; + } + + @JsonProperty("TimesheetEntry") + public Optional> getTimesheetEntry() { + return timesheetEntry; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return benefit.equals(other.benefit) + && employerBenefit.equals(other.employerBenefit) + && company.equals(other.company) + && employeePayrollRun.equals(other.employeePayrollRun) + && employee.equals(other.employee) + && employment.equals(other.employment) + && location.equals(other.location) + && payrollRun.equals(other.payrollRun) + && team.equals(other.team) + && timeOff.equals(other.timeOff) + && timeOffBalance.equals(other.timeOffBalance) + && bankInfo.equals(other.bankInfo) + && payGroup.equals(other.payGroup) + && group.equals(other.group) + && dependent.equals(other.dependent) + && timesheetEntry.equals(other.timesheetEntry); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.benefit, + this.employerBenefit, + this.company, + this.employeePayrollRun, + this.employee, + this.employment, + this.location, + this.payrollRun, + this.team, + this.timeOff, + this.timeOffBalance, + this.bankInfo, + this.payGroup, + this.group, + this.dependent, + this.timesheetEntry); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> benefit = Optional.empty(); + + private Optional> employerBenefit = Optional.empty(); + + private Optional> company = Optional.empty(); + + private Optional> employeePayrollRun = Optional.empty(); + + private Optional> employee = Optional.empty(); + + private Optional> employment = Optional.empty(); + + private Optional> location = Optional.empty(); + + private Optional> payrollRun = Optional.empty(); + + private Optional> team = Optional.empty(); + + private Optional> timeOff = Optional.empty(); + + private Optional> timeOffBalance = Optional.empty(); + + private Optional> bankInfo = Optional.empty(); + + private Optional> payGroup = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> dependent = Optional.empty(); + + private Optional> timesheetEntry = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + benefit(other.getBenefit()); + employerBenefit(other.getEmployerBenefit()); + company(other.getCompany()); + employeePayrollRun(other.getEmployeePayrollRun()); + employee(other.getEmployee()); + employment(other.getEmployment()); + location(other.getLocation()); + payrollRun(other.getPayrollRun()); + team(other.getTeam()); + timeOff(other.getTimeOff()); + timeOffBalance(other.getTimeOffBalance()); + bankInfo(other.getBankInfo()); + payGroup(other.getPayGroup()); + group(other.getGroup()); + dependent(other.getDependent()); + timesheetEntry(other.getTimesheetEntry()); + return this; + } + + @JsonSetter(value = "Benefit", nulls = Nulls.SKIP) + public Builder benefit(Optional> benefit) { + this.benefit = benefit; + return this; + } + + public Builder benefit(List benefit) { + this.benefit = Optional.ofNullable(benefit); + return this; + } + + @JsonSetter(value = "EmployerBenefit", nulls = Nulls.SKIP) + public Builder employerBenefit(Optional> employerBenefit) { + this.employerBenefit = employerBenefit; + return this; + } + + public Builder employerBenefit(List employerBenefit) { + this.employerBenefit = Optional.ofNullable(employerBenefit); + return this; + } + + @JsonSetter(value = "Company", nulls = Nulls.SKIP) + public Builder company(Optional> company) { + this.company = company; + return this; + } + + public Builder company(List company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "EmployeePayrollRun", nulls = Nulls.SKIP) + public Builder employeePayrollRun(Optional> employeePayrollRun) { + this.employeePayrollRun = employeePayrollRun; + return this; + } + + public Builder employeePayrollRun(List employeePayrollRun) { + this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); + return this; + } + + @JsonSetter(value = "Employee", nulls = Nulls.SKIP) + public Builder employee(Optional> employee) { + this.employee = employee; + return this; + } + + public Builder employee(List employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "Employment", nulls = Nulls.SKIP) + public Builder employment(Optional> employment) { + this.employment = employment; + return this; + } + + public Builder employment(List employment) { + this.employment = Optional.ofNullable(employment); + return this; + } + + @JsonSetter(value = "Location", nulls = Nulls.SKIP) + public Builder location(Optional> location) { + this.location = location; + return this; + } + + public Builder location(List location) { + this.location = Optional.ofNullable(location); + return this; + } + + @JsonSetter(value = "PayrollRun", nulls = Nulls.SKIP) + public Builder payrollRun(Optional> payrollRun) { + this.payrollRun = payrollRun; + return this; + } + + public Builder payrollRun(List payrollRun) { + this.payrollRun = Optional.ofNullable(payrollRun); + return this; + } + + @JsonSetter(value = "Team", nulls = Nulls.SKIP) + public Builder team(Optional> team) { + this.team = team; + return this; + } + + public Builder team(List team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "TimeOff", nulls = Nulls.SKIP) + public Builder timeOff(Optional> timeOff) { + this.timeOff = timeOff; + return this; + } + + public Builder timeOff(List timeOff) { + this.timeOff = Optional.ofNullable(timeOff); + return this; + } + + @JsonSetter(value = "TimeOffBalance", nulls = Nulls.SKIP) + public Builder timeOffBalance(Optional> timeOffBalance) { + this.timeOffBalance = timeOffBalance; + return this; + } + + public Builder timeOffBalance(List timeOffBalance) { + this.timeOffBalance = Optional.ofNullable(timeOffBalance); + return this; + } + + @JsonSetter(value = "BankInfo", nulls = Nulls.SKIP) + public Builder bankInfo(Optional> bankInfo) { + this.bankInfo = bankInfo; + return this; + } + + public Builder bankInfo(List bankInfo) { + this.bankInfo = Optional.ofNullable(bankInfo); + return this; + } + + @JsonSetter(value = "PayGroup", nulls = Nulls.SKIP) + public Builder payGroup(Optional> payGroup) { + this.payGroup = payGroup; + return this; + } + + public Builder payGroup(List payGroup) { + this.payGroup = Optional.ofNullable(payGroup); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "Dependent", nulls = Nulls.SKIP) + public Builder dependent(Optional> dependent) { + this.dependent = dependent; + return this; + } + + public Builder dependent(List dependent) { + this.dependent = Optional.ofNullable(dependent); + return this; + } + + @JsonSetter(value = "TimesheetEntry", nulls = Nulls.SKIP) + public Builder timesheetEntry(Optional> timesheetEntry) { + this.timesheetEntry = timesheetEntry; + return this; + } + + public Builder timesheetEntry(List timesheetEntry) { + this.timesheetEntry = Optional.ofNullable(timesheetEntry); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse( + benefit, + employerBenefit, + company, + employeePayrollRun, + employee, + employment, + location, + payrollRun, + team, + timeOff, + timeOffBalance, + bankInfo, + payGroup, + group, + dependent, + timesheetEntry, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..0a51b3bef --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteKey.java b/src/main/java/com/merge/api/hris/types/RemoteKey.java new file mode 100644 index 000000000..7dd2c55df --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/hris/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..1d43f1c75 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteResponse.java b/src/main/java/com/merge/api/hris/types/RemoteResponse.java new file mode 100644 index 000000000..d77f466f3 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(ResponseTypeEnum responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RequestFormatEnum.java b/src/main/java/com/merge/api/hris/types/RequestFormatEnum.java new file mode 100644 index 000000000..47e6a40a2 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RequestFormatEnum { + JSON("JSON"), + + XML("XML"), + + MULTIPART("MULTIPART"); + + private final String value; + + RequestFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/RequestTypeEnum.java b/src/main/java/com/merge/api/hris/types/RequestTypeEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/types/RequestTypeEnum.java rename to src/main/java/com/merge/api/hris/types/RequestTypeEnum.java index f45defa48..264874b92 100644 --- a/src/main/java/com/merge/api/resources/hris/types/RequestTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/RequestTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/hris/types/ResponseTypeEnum.java new file mode 100644 index 000000000..47cd59d1f --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ResponseTypeEnum { + JSON("JSON"), + + BASE_64_GZIP("BASE64_GZIP"); + + private final String value; + + ResponseTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/RoleEnum.java b/src/main/java/com/merge/api/hris/types/RoleEnum.java new file mode 100644 index 000000000..b61166c3a --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RoleEnum { + ADMIN("ADMIN"), + + DEVELOPER("DEVELOPER"), + + MEMBER("MEMBER"), + + API("API"), + + SYSTEM("SYSTEM"), + + MERGE_TEAM("MERGE_TEAM"); + + private final String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/RunStateEnum.java b/src/main/java/com/merge/api/hris/types/RunStateEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/types/RunStateEnum.java rename to src/main/java/com/merge/api/hris/types/RunStateEnum.java index 475bf162f..b4a966b42 100644 --- a/src/main/java/com/merge/api/resources/hris/types/RunStateEnum.java +++ b/src/main/java/com/merge/api/hris/types/RunStateEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/RunTypeEnum.java b/src/main/java/com/merge/api/hris/types/RunTypeEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/types/RunTypeEnum.java rename to src/main/java/com/merge/api/hris/types/RunTypeEnum.java index 8d0996a6f..57d5494d6 100644 --- a/src/main/java/com/merge/api/resources/hris/types/RunTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/RunTypeEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/hris/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..95ed29c1b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SelectiveSyncConfigurationsUsageEnum { + IN_NEXT_SYNC("IN_NEXT_SYNC"), + + IN_LAST_SYNC("IN_LAST_SYNC"); + + private final String value; + + SelectiveSyncConfigurationsUsageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/StatusFd5Enum.java b/src/main/java/com/merge/api/hris/types/StatusFd5Enum.java new file mode 100644 index 000000000..8c25f0f6b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/StatusFd5Enum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum StatusFd5Enum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + StatusFd5Enum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/hris/types/SyncStatus.java b/src/main/java/com/merge/api/hris/types/SyncStatus.java new file mode 100644 index 000000000..72949bb96 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final StatusFd5Enum status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + StatusFd5Enum status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public StatusFd5Enum getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull StatusFd5Enum status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private StatusFd5Enum status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull StatusFd5Enum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/hris/types/SyncStatusListRequest.java new file mode 100644 index 000000000..ae09a11b5 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/SyncStatusListRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/Tax.java b/src/main/java/com/merge/api/hris/types/Tax.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/Tax.java rename to src/main/java/com/merge/api/hris/types/Tax.java index 395695e4d..386cb5f0a 100644 --- a/src/main/java/com/merge/api/resources/hris/types/Tax.java +++ b/src/main/java/com/merge/api/hris/types/Tax.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/Team.java b/src/main/java/com/merge/api/hris/types/Team.java new file mode 100644 index 000000000..f33e54a03 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/Team.java @@ -0,0 +1,329 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Team.Builder.class) +public final class Team { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional parentTeam; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Team( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional parentTeam, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.parentTeam = parentTeam; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The team's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The team's parent team. + */ + @JsonProperty("parent_team") + public Optional getParentTeam() { + return parentTeam; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Team && equalTo((Team) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Team other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && parentTeam.equals(other.parentTeam) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.parentTeam, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional parentTeam = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Team other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + parentTeam(other.getParentTeam()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "parent_team", nulls = Nulls.SKIP) + public Builder parentTeam(Optional parentTeam) { + this.parentTeam = parentTeam; + return this; + } + + public Builder parentTeam(TeamParentTeam parentTeam) { + this.parentTeam = Optional.ofNullable(parentTeam); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Team build() { + return new Team( + id, + remoteId, + createdAt, + modifiedAt, + name, + parentTeam, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/TeamParentTeam.java b/src/main/java/com/merge/api/hris/types/TeamParentTeam.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TeamParentTeam.java rename to src/main/java/com/merge/api/hris/types/TeamParentTeam.java index 01774d3b2..ca57f448b 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TeamParentTeam.java +++ b/src/main/java/com/merge/api/hris/types/TeamParentTeam.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TeamParentTeam deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TeamParentTeam deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/hris/types/TeamsListRequest.java b/src/main/java/com/merge/api/hris/types/TeamsListRequest.java new file mode 100644 index 000000000..b64d8bda8 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TeamsListRequest.java @@ -0,0 +1,430 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TeamsListRequest.Builder.class) +public final class TeamsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional parentTeamId; + + private final Optional remoteId; + + private final Map additionalProperties; + + private TeamsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional parentTeamId, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.parentTeamId = parentTeamId; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If provided, will only return teams with this parent team. + */ + @JsonProperty("parent_team_id") + public Optional getParentTeamId() { + return parentTeamId; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TeamsListRequest && equalTo((TeamsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TeamsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && parentTeamId.equals(other.parentTeamId) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.parentTeamId, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional parentTeamId = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TeamsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + parentTeamId(other.getParentTeamId()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "parent_team_id", nulls = Nulls.SKIP) + public Builder parentTeamId(Optional parentTeamId) { + this.parentTeamId = parentTeamId; + return this; + } + + public Builder parentTeamId(String parentTeamId) { + this.parentTeamId = Optional.ofNullable(parentTeamId); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public TeamsListRequest build() { + return new TeamsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + parentTeamId, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequest.java new file mode 100644 index 000000000..1140b068e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TeamsRetrieveRequest.Builder.class) +public final class TeamsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private TeamsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TeamsRetrieveRequest && equalTo((TeamsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TeamsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TeamsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public TeamsRetrieveRequest build() { + return new TeamsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOff.java b/src/main/java/com/merge/api/hris/types/TimeOff.java similarity index 93% rename from src/main/java/com/merge/api/resources/hris/types/TimeOff.java rename to src/main/java/com/merge/api/hris/types/TimeOff.java index 977c2d458..d73b39736 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOff.java +++ b/src/main/java/com/merge/api/hris/types/TimeOff.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,15 +35,15 @@ public final class TimeOff { private final Optional approver; - private final Optional status; + private final Optional status; private final Optional employeeNote; - private final Optional units; + private final Optional units; private final Optional amount; - private final Optional requestType; + private final Optional requestType; private final Optional startTime; @@ -64,11 +64,11 @@ private TimeOff( Optional modifiedAt, Optional employee, Optional approver, - Optional status, + Optional status, Optional employeeNote, - Optional units, + Optional units, Optional amount, - Optional requestType, + Optional requestType, Optional startTime, Optional endTime, Optional remoteWasDeleted, @@ -150,7 +150,7 @@ public Optional getApprover() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -170,7 +170,7 @@ public Optional getEmployeeNote() { * */ @JsonProperty("units") - public Optional getUnits() { + public Optional getUnits() { return units; } @@ -194,7 +194,7 @@ public Optional getAmount() { * */ @JsonProperty("request_type") - public Optional getRequestType() { + public Optional getRequestType() { return requestType; } @@ -306,15 +306,15 @@ public static final class Builder { private Optional approver = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional employeeNote = Optional.empty(); - private Optional units = Optional.empty(); + private Optional units = Optional.empty(); private Optional amount = Optional.empty(); - private Optional requestType = Optional.empty(); + private Optional requestType = Optional.empty(); private Optional startTime = Optional.empty(); @@ -418,12 +418,12 @@ public Builder approver(TimeOffApprover approver) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TimeOffStatus status) { + public Builder status(TimeOffStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -440,12 +440,12 @@ public Builder employeeNote(String employeeNote) { } @JsonSetter(value = "units", nulls = Nulls.SKIP) - public Builder units(Optional units) { + public Builder units(Optional units) { this.units = units; return this; } - public Builder units(TimeOffUnits units) { + public Builder units(UnitsEnum units) { this.units = Optional.ofNullable(units); return this; } @@ -462,12 +462,12 @@ public Builder amount(Double amount) { } @JsonSetter(value = "request_type", nulls = Nulls.SKIP) - public Builder requestType(Optional requestType) { + public Builder requestType(Optional requestType) { this.requestType = requestType; return this; } - public Builder requestType(TimeOffRequestType requestType) { + public Builder requestType(RequestTypeEnum requestType) { this.requestType = Optional.ofNullable(requestType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffApprover.java b/src/main/java/com/merge/api/hris/types/TimeOffApprover.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffApprover.java rename to src/main/java/com/merge/api/hris/types/TimeOffApprover.java index 04731ac86..a1e9a9854 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffApprover.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffApprover.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TimeOffApprover deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TimeOffApprover deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffBalance.java b/src/main/java/com/merge/api/hris/types/TimeOffBalance.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffBalance.java rename to src/main/java/com/merge/api/hris/types/TimeOffBalance.java index 7139c9572..219e151de 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffBalance.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalance.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -37,7 +37,7 @@ public final class TimeOffBalance { private final Optional used; - private final Optional policyType; + private final Optional policyType; private final Optional remoteWasDeleted; @@ -55,7 +55,7 @@ private TimeOffBalance( Optional employee, Optional balance, Optional used, - Optional policyType, + Optional policyType, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -139,7 +139,7 @@ public Optional getUsed() { * */ @JsonProperty("policy_type") - public Optional getPolicyType() { + public Optional getPolicyType() { return policyType; } @@ -227,7 +227,7 @@ public static final class Builder { private Optional used = Optional.empty(); - private Optional policyType = Optional.empty(); + private Optional policyType = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -333,12 +333,12 @@ public Builder used(Double used) { } @JsonSetter(value = "policy_type", nulls = Nulls.SKIP) - public Builder policyType(Optional policyType) { + public Builder policyType(Optional policyType) { this.policyType = policyType; return this; } - public Builder policyType(TimeOffBalancePolicyType policyType) { + public Builder policyType(PolicyTypeEnum policyType) { this.policyType = Optional.ofNullable(policyType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffBalanceEmployee.java b/src/main/java/com/merge/api/hris/types/TimeOffBalanceEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffBalanceEmployee.java rename to src/main/java/com/merge/api/hris/types/TimeOffBalanceEmployee.java index b423e0d03..82478718a 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffBalanceEmployee.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalanceEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TimeOffBalanceEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TimeOffBalanceEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/timeoffbalances/requests/TimeOffBalancesListRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/timeoffbalances/requests/TimeOffBalancesListRequest.java rename to src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequest.java index 2ca29297d..202e15d8e 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoffbalances/requests/TimeOffBalancesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoffbalances.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.timeoffbalances.types.TimeOffBalancesListRequestPolicyType; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimeOffBalancesListRequest.Builder.class) public final class TimeOffBalancesListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -30,8 +33,6 @@ public final class TimeOffBalancesListRequest { private final Optional employeeId; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -55,11 +56,11 @@ public final class TimeOffBalancesListRequest { private final Map additionalProperties; private TimeOffBalancesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional employeeId, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -71,11 +72,11 @@ private TimeOffBalancesListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.employeeId = employeeId; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -89,6 +90,14 @@ private TimeOffBalancesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -121,14 +130,6 @@ public Optional getEmployeeId() { return employeeId; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -229,11 +230,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(TimeOffBalancesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && employeeId.equals(other.employeeId) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -249,11 +250,11 @@ private boolean equalTo(TimeOffBalancesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.employeeId, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -277,6 +278,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -285,8 +288,6 @@ public static final class Builder { private Optional employeeId = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -313,11 +314,11 @@ public static final class Builder { private Builder() {} public Builder from(TimeOffBalancesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); employeeId(other.getEmployeeId()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -331,6 +332,22 @@ public Builder from(TimeOffBalancesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -375,17 +392,6 @@ public Builder employeeId(String employeeId) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -498,11 +504,11 @@ public Builder showEnumOrigins(String showEnumOrigins) { public TimeOffBalancesListRequest build() { return new TimeOffBalancesListRequest( + expand, createdAfter, createdBefore, cursor, employeeId, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/hris/timeoffbalances/types/TimeOffBalancesListRequestPolicyType.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestPolicyType.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/timeoffbalances/types/TimeOffBalancesListRequestPolicyType.java rename to src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestPolicyType.java index bd4b8d2e6..80e1c6e6a 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoffbalances/types/TimeOffBalancesListRequestPolicyType.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestPolicyType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoffbalances.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/timeoffbalances/requests/TimeOffBalancesRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequest.java similarity index 75% rename from src/main/java/com/merge/api/resources/hris/timeoffbalances/requests/TimeOffBalancesRetrieveRequest.java rename to src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequest.java index c683548d2..4904f5771 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoffbalances/requests/TimeOffBalancesRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoffbalances.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -20,10 +22,12 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimeOffBalancesRetrieveRequest.Builder.class) public final class TimeOffBalancesRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -31,13 +35,15 @@ public final class TimeOffBalancesRetrieveRequest { private final Map additionalProperties; private TimeOffBalancesRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -47,7 +53,7 @@ private TimeOffBalancesRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -59,6 +65,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -89,13 +103,15 @@ public Map getAdditionalProperties() { private boolean equalTo(TimeOffBalancesRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -109,10 +125,12 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -125,22 +143,28 @@ private Builder() {} public Builder from(TimeOffBalancesRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(String expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -152,6 +176,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -176,7 +211,7 @@ public Builder showEnumOrigins(String showEnumOrigins) { public TimeOffBalancesRetrieveRequest build() { return new TimeOffBalancesRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffEmployee.java b/src/main/java/com/merge/api/hris/types/TimeOffEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffEmployee.java rename to src/main/java/com/merge/api/hris/types/TimeOffEmployee.java index 61d1fc928..5b9753528 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffEmployee.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TimeOffEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TimeOffEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffEndpointRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffEndpointRequest.java similarity index 98% rename from src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffEndpointRequest.java rename to src/main/java/com/merge/api/hris/types/TimeOffEndpointRequest.java index aa5ae6d3a..43642fcd7 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffEndpointRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.types.TimeOffRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffListRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffListRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffListRequest.java rename to src/main/java/com/merge/api/hris/types/TimeOffListRequest.java index 6502ca746..6962d3839 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,13 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.timeoff.types.TimeOffListRequestExpand; -import com.merge.api.resources.hris.timeoff.types.TimeOffListRequestRemoteFields; -import com.merge.api.resources.hris.timeoff.types.TimeOffListRequestRequestType; -import com.merge.api.resources.hris.timeoff.types.TimeOffListRequestShowEnumOrigins; -import com.merge.api.resources.hris.timeoff.types.TimeOffListRequestStatus; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -26,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimeOffListRequest.Builder.class) public final class TimeOffListRequest { + private final Optional> expand; + private final Optional approverId; private final Optional createdAfter; @@ -40,8 +39,6 @@ public final class TimeOffListRequest { private final Optional endedBefore; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -71,6 +68,7 @@ public final class TimeOffListRequest { private final Map additionalProperties; private TimeOffListRequest( + Optional> expand, Optional approverId, Optional createdAfter, Optional createdBefore, @@ -78,7 +76,6 @@ private TimeOffListRequest( Optional employeeId, Optional endedAfter, Optional endedBefore, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -93,6 +90,7 @@ private TimeOffListRequest( Optional startedBefore, Optional status, Map additionalProperties) { + this.expand = expand; this.approverId = approverId; this.createdAfter = createdAfter; this.createdBefore = createdBefore; @@ -100,7 +98,6 @@ private TimeOffListRequest( this.employeeId = employeeId; this.endedAfter = endedAfter; this.endedBefore = endedBefore; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -117,6 +114,14 @@ private TimeOffListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return time off for this approver. */ @@ -173,14 +178,6 @@ public Optional getEndedBefore() { return endedBefore; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -312,14 +309,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(TimeOffListRequest other) { - return approverId.equals(other.approverId) + return expand.equals(other.expand) + && approverId.equals(other.approverId) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && employeeId.equals(other.employeeId) && endedAfter.equals(other.endedAfter) && endedBefore.equals(other.endedBefore) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -338,6 +335,7 @@ private boolean equalTo(TimeOffListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.approverId, this.createdAfter, this.createdBefore, @@ -345,7 +343,6 @@ public int hashCode() { this.employeeId, this.endedAfter, this.endedBefore, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -372,6 +369,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional approverId = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -386,8 +385,6 @@ public static final class Builder { private Optional endedBefore = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -420,6 +417,7 @@ public static final class Builder { private Builder() {} public Builder from(TimeOffListRequest other) { + expand(other.getExpand()); approverId(other.getApproverId()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); @@ -427,7 +425,6 @@ public Builder from(TimeOffListRequest other) { employeeId(other.getEmployeeId()); endedAfter(other.getEndedAfter()); endedBefore(other.getEndedBefore()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -444,6 +441,22 @@ public Builder from(TimeOffListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(TimeOffListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "approver_id", nulls = Nulls.SKIP) public Builder approverId(Optional approverId) { this.approverId = approverId; @@ -521,17 +534,6 @@ public Builder endedBefore(OffsetDateTime endedBefore) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(TimeOffListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -677,6 +679,7 @@ public Builder status(TimeOffListRequestStatus status) { public TimeOffListRequest build() { return new TimeOffListRequest( + expand, approverId, createdAfter, createdBefore, @@ -684,7 +687,6 @@ public TimeOffListRequest build() { employeeId, endedAfter, endedBefore, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/hris/types/TimeOffListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TimeOffListRequestExpandItem.java new file mode 100644 index 000000000..9bab635fd --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffListRequestExpandItem { + APPROVER("approver"), + + EMPLOYEE("employee"); + + private final String value; + + TimeOffListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/TimeOffListRequestRemoteFields.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/TimeOffListRequestRemoteFields.java index 0fa2e077e..b7c9afecb 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestRequestType.java b/src/main/java/com/merge/api/hris/types/TimeOffListRequestRequestType.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestRequestType.java rename to src/main/java/com/merge/api/hris/types/TimeOffListRequestRequestType.java index 6f096c096..4b4689812 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestRequestType.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffListRequestRequestType.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/TimeOffListRequestShowEnumOrigins.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/TimeOffListRequestShowEnumOrigins.java index c1ff2cfbf..61ebaafd8 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestStatus.java b/src/main/java/com/merge/api/hris/types/TimeOffListRequestStatus.java similarity index 90% rename from src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestStatus.java rename to src/main/java/com/merge/api/hris/types/TimeOffListRequestStatus.java index 57b711a90..bc59a9569 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestStatus.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffListRequestStatus.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffRequest.java similarity index 91% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffRequest.java rename to src/main/java/com/merge/api/hris/types/TimeOffRequest.java index 31c91d796..7286a450f 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -26,15 +26,15 @@ public final class TimeOffRequest { private final Optional approver; - private final Optional status; + private final Optional status; private final Optional employeeNote; - private final Optional units; + private final Optional units; private final Optional amount; - private final Optional requestType; + private final Optional requestType; private final Optional startTime; @@ -49,11 +49,11 @@ public final class TimeOffRequest { private TimeOffRequest( Optional employee, Optional approver, - Optional status, + Optional status, Optional employeeNote, - Optional units, + Optional units, Optional amount, - Optional requestType, + Optional requestType, Optional startTime, Optional endTime, Optional> integrationParams, @@ -100,7 +100,7 @@ public Optional getApprover() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -120,7 +120,7 @@ public Optional getEmployeeNote() { * */ @JsonProperty("units") - public Optional getUnits() { + public Optional getUnits() { return units; } @@ -144,7 +144,7 @@ public Optional getAmount() { * */ @JsonProperty("request_type") - public Optional getRequestType() { + public Optional getRequestType() { return requestType; } @@ -230,15 +230,15 @@ public static final class Builder { private Optional approver = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional employeeNote = Optional.empty(); - private Optional units = Optional.empty(); + private Optional units = Optional.empty(); private Optional amount = Optional.empty(); - private Optional requestType = Optional.empty(); + private Optional requestType = Optional.empty(); private Optional startTime = Optional.empty(); @@ -291,12 +291,12 @@ public Builder approver(TimeOffRequestApprover approver) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TimeOffRequestStatus status) { + public Builder status(TimeOffStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -313,12 +313,12 @@ public Builder employeeNote(String employeeNote) { } @JsonSetter(value = "units", nulls = Nulls.SKIP) - public Builder units(Optional units) { + public Builder units(Optional units) { this.units = units; return this; } - public Builder units(TimeOffRequestUnits units) { + public Builder units(UnitsEnum units) { this.units = Optional.ofNullable(units); return this; } @@ -335,12 +335,12 @@ public Builder amount(Double amount) { } @JsonSetter(value = "request_type", nulls = Nulls.SKIP) - public Builder requestType(Optional requestType) { + public Builder requestType(Optional requestType) { this.requestType = requestType; return this; } - public Builder requestType(TimeOffRequestRequestType requestType) { + public Builder requestType(RequestTypeEnum requestType) { this.requestType = Optional.ofNullable(requestType); return this; } diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestApprover.java b/src/main/java/com/merge/api/hris/types/TimeOffRequestApprover.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffRequestApprover.java rename to src/main/java/com/merge/api/hris/types/TimeOffRequestApprover.java index e134fb203..8a7eae8f9 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestApprover.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffRequestApprover.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TimeOffRequestApprover deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TimeOffRequestApprover deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestEmployee.java b/src/main/java/com/merge/api/hris/types/TimeOffRequestEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffRequestEmployee.java rename to src/main/java/com/merge/api/hris/types/TimeOffRequestEmployee.java index cccbb60ea..a897c8363 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestEmployee.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffRequestEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TimeOffRequestEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TimeOffRequestEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffResponse.java b/src/main/java/com/merge/api/hris/types/TimeOffResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffResponse.java rename to src/main/java/com/merge/api/hris/types/TimeOffResponse.java index 95779737e..0b395b890 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffResponse.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequest.java new file mode 100644 index 000000000..db9a04811 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequest.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TimeOffRetrieveRequest.Builder.class) +public final class TimeOffRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private TimeOffRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimeOffRetrieveRequest && equalTo((TimeOffRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimeOffRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TimeOffRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(TimeOffRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(TimeOffRetrieveRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(TimeOffRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public TimeOffRetrieveRequest build() { + return new TimeOffRetrieveRequest( + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestExpandItem.java new file mode 100644 index 000000000..4e339115e --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TimeOffRetrieveRequestExpandItem { + APPROVER("approver"), + + EMPLOYEE("employee"); + + private final String value; + + TimeOffRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestRemoteFields.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestRemoteFields.java index 4ccb77cda..b574b8839 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestShowEnumOrigins.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestShowEnumOrigins.java index 5545804ba..fd9dd02d7 100644 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timeoff.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffStatusEnum.java b/src/main/java/com/merge/api/hris/types/TimeOffStatusEnum.java similarity index 92% rename from src/main/java/com/merge/api/resources/hris/types/TimeOffStatusEnum.java rename to src/main/java/com/merge/api/hris/types/TimeOffStatusEnum.java index 8ef41d212..d37c6d167 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffStatusEnum.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffStatusEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntriesListRequest.java b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java similarity index 96% rename from src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntriesListRequest.java rename to src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java index add966ea4..699c94f77 100644 --- a/src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntriesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timesheetentries.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.timesheetentries.types.TimesheetEntriesListRequestOrderBy; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimesheetEntriesListRequest.Builder.class) public final class TimesheetEntriesListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; @@ -34,8 +37,6 @@ public final class TimesheetEntriesListRequest { private final Optional endedBefore; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -59,13 +60,13 @@ public final class TimesheetEntriesListRequest { private final Map additionalProperties; private TimesheetEntriesListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, Optional employeeId, Optional endedAfter, Optional endedBefore, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -77,13 +78,13 @@ private TimesheetEntriesListRequest( Optional startedAfter, Optional startedBefore, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; this.employeeId = employeeId; this.endedAfter = endedAfter; this.endedBefore = endedBefore; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -97,6 +98,14 @@ private TimesheetEntriesListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -145,14 +154,6 @@ public Optional getEndedBefore() { return endedBefore; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -245,13 +246,13 @@ public Map getAdditionalProperties() { } private boolean equalTo(TimesheetEntriesListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && employeeId.equals(other.employeeId) && endedAfter.equals(other.endedAfter) && endedBefore.equals(other.endedBefore) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -267,13 +268,13 @@ private boolean equalTo(TimesheetEntriesListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, this.employeeId, this.endedAfter, this.endedBefore, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -297,6 +298,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -309,8 +312,6 @@ public static final class Builder { private Optional endedBefore = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -337,13 +338,13 @@ public static final class Builder { private Builder() {} public Builder from(TimesheetEntriesListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); employeeId(other.getEmployeeId()); endedAfter(other.getEndedAfter()); endedBefore(other.getEndedBefore()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -357,6 +358,22 @@ public Builder from(TimesheetEntriesListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -423,17 +440,6 @@ public Builder endedBefore(OffsetDateTime endedBefore) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -546,13 +552,13 @@ public Builder startedBefore(OffsetDateTime startedBefore) { public TimesheetEntriesListRequest build() { return new TimesheetEntriesListRequest( + expand, createdAfter, createdBefore, cursor, employeeId, endedAfter, endedBefore, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/hris/timesheetentries/types/TimesheetEntriesListRequestOrderBy.java b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequestOrderBy.java similarity index 88% rename from src/main/java/com/merge/api/resources/hris/timesheetentries/types/TimesheetEntriesListRequestOrderBy.java rename to src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequestOrderBy.java index 9f8764893..a6d345cb3 100644 --- a/src/main/java/com/merge/api/resources/hris/timesheetentries/types/TimesheetEntriesListRequestOrderBy.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequestOrderBy.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timesheetentries.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequest.java new file mode 100644 index 000000000..8cfd564ca --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequest.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TimesheetEntriesRetrieveRequest.Builder.class) +public final class TimesheetEntriesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private TimesheetEntriesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TimesheetEntriesRetrieveRequest && equalTo((TimesheetEntriesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TimesheetEntriesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TimesheetEntriesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public TimesheetEntriesRetrieveRequest build() { + return new TimesheetEntriesRetrieveRequest( + expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntry.java b/src/main/java/com/merge/api/hris/types/TimesheetEntry.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/TimesheetEntry.java rename to src/main/java/com/merge/api/hris/types/TimesheetEntry.java index 60c198f77..777ed5ade 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntry.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntry.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntryEmployee.java b/src/main/java/com/merge/api/hris/types/TimesheetEntryEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TimesheetEntryEmployee.java rename to src/main/java/com/merge/api/hris/types/TimesheetEntryEmployee.java index 00eea930d..44be4338a 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntryEmployee.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntryEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TimesheetEntryEmployee deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TimesheetEntryEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntryEndpointRequest.java b/src/main/java/com/merge/api/hris/types/TimesheetEntryEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntryEndpointRequest.java rename to src/main/java/com/merge/api/hris/types/TimesheetEntryEndpointRequest.java index 9882348ec..6b070ec6e 100644 --- a/src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntryEndpointRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntryEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.timesheetentries.requests; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.types.TimesheetEntryRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntryRequest.java b/src/main/java/com/merge/api/hris/types/TimesheetEntryRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/hris/types/TimesheetEntryRequest.java rename to src/main/java/com/merge/api/hris/types/TimesheetEntryRequest.java index a42d27a7b..fceb90c2d 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntryRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntryRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntryRequestEmployee.java b/src/main/java/com/merge/api/hris/types/TimesheetEntryRequestEmployee.java similarity index 95% rename from src/main/java/com/merge/api/resources/hris/types/TimesheetEntryRequestEmployee.java rename to src/main/java/com/merge/api/hris/types/TimesheetEntryRequestEmployee.java index ceddef7a2..e139c525c 100644 --- a/src/main/java/com/merge/api/resources/hris/types/TimesheetEntryRequestEmployee.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntryRequestEmployee.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.hris.types; +package com.merge.api.hris.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/WarningValidationProblem.java b/src/main/java/com/merge/api/hris/types/WarningValidationProblem.java new file mode 100644 index 000000000..da3c8047d --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/WarningValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/WebhookReceiver.java b/src/main/java/com/merge/api/hris/types/WebhookReceiver.java new file mode 100644 index 000000000..a48938f76 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/hris/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..e31b32ec3 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/accounting/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/api/resources/accounting/accountdetails/AccountDetailsClient.java deleted file mode 100644 index f1de87003..000000000 --- a/src/main/java/com/merge/api/resources/accounting/accountdetails/AccountDetailsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.accountdetails; - -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.AccountDetails; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountDetailsClient { - protected final ClientOptions clientOptions; - - public AccountDetailsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve() { - return retrieve(null); - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/account-details") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountDetails.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/accountingperiods/AccountingPeriodsClient.java b/src/main/java/com/merge/api/resources/accounting/accountingperiods/AccountingPeriodsClient.java deleted file mode 100644 index ba77866fc..000000000 --- a/src/main/java/com/merge/api/resources/accounting/accountingperiods/AccountingPeriodsClient.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.accountingperiods; - -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.accountingperiods.requests.AccountingPeriodsListRequest; -import com.merge.api.resources.accounting.accountingperiods.requests.AccountingPeriodsRetrieveRequest; -import com.merge.api.resources.accounting.types.AccountingPeriod; -import com.merge.api.resources.accounting.types.PaginatedAccountingPeriodList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountingPeriodsClient { - protected final ClientOptions clientOptions; - - public AccountingPeriodsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of AccountingPeriod objects. - */ - public PaginatedAccountingPeriodList list() { - return list(AccountingPeriodsListRequest.builder().build()); - } - - /** - * Returns a list of AccountingPeriod objects. - */ - public PaginatedAccountingPeriodList list(AccountingPeriodsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of AccountingPeriod objects. - */ - public PaginatedAccountingPeriodList list(AccountingPeriodsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/accounting-periods"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountingPeriodList.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); - } - } - - /** - * Returns an AccountingPeriod object with the given id. - */ - public AccountingPeriod retrieve(String id) { - return retrieve(id, AccountingPeriodsRetrieveRequest.builder().build()); - } - - /** - * Returns an AccountingPeriod object with the given id. - */ - public AccountingPeriod retrieve(String id, AccountingPeriodsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an AccountingPeriod object with the given id. - */ - public AccountingPeriod retrieve( - String id, AccountingPeriodsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/accounting-periods") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), AccountingPeriod.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/accountingperiods/requests/AccountingPeriodsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/accountingperiods/requests/AccountingPeriodsRetrieveRequest.java deleted file mode 100644 index 1382412e0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/accountingperiods/requests/AccountingPeriodsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.accountingperiods.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountingPeriodsRetrieveRequest.Builder.class) -public final class AccountingPeriodsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private AccountingPeriodsRetrieveRequest( - Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountingPeriodsRetrieveRequest && equalTo((AccountingPeriodsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountingPeriodsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountingPeriodsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public AccountingPeriodsRetrieveRequest build() { - return new AccountingPeriodsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/AccountsClient.java b/src/main/java/com/merge/api/resources/accounting/accounts/AccountsClient.java deleted file mode 100644 index 6c8d588de..000000000 --- a/src/main/java/com/merge/api/resources/accounting/accounts/AccountsClient.java +++ /dev/null @@ -1,298 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.accounts; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.accounts.requests.AccountEndpointRequest; -import com.merge.api.resources.accounting.accounts.requests.AccountsListRequest; -import com.merge.api.resources.accounting.accounts.requests.AccountsRetrieveRequest; -import com.merge.api.resources.accounting.types.Account; -import com.merge.api.resources.accounting.types.AccountResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedAccountList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountsClient { - protected final ClientOptions clientOptions; - - public AccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list() { - return list(AccountsListRequest.builder().build()); - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list(AccountsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list(AccountsListRequest request, RequestOptions requestOptions) { - 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()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountList.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); - } - } - - /** - * Creates an Account object with the given values. - */ - public AccountResponse create(AccountEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Account object with the given values. - */ - public AccountResponse create(AccountEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/accounts"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), AccountResponse.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); - } - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id) { - return retrieve(id, AccountsRetrieveRequest.builder().build()); - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id, AccountsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/accounts") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Account.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); - } - } - - /** - * Returns metadata for Account POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Account POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/accounts/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountsListRequest.java b/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountsListRequest.java deleted file mode 100644 index 7baa57f85..000000000 --- a/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountsListRequest.java +++ /dev/null @@ -1,512 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.accounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.accounts.types.AccountsListRequestRemoteFields; -import com.merge.api.resources.accounting.accounts.types.AccountsListRequestShowEnumOrigins; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsListRequest.Builder.class) -public final class AccountsListRequest { - private final Optional accountType; - - private final Optional companyId; - - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteFields; - - private final Optional remoteId; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private AccountsListRequest( - Optional accountType, - Optional companyId, - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteFields, - Optional remoteId, - Optional showEnumOrigins, - Map additionalProperties) { - this.accountType = accountType; - this.companyId = companyId; - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteFields = remoteFields; - this.remoteId = remoteId; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only provide accounts with the passed in enum. - */ - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return If provided, will only return accounts for this company. - */ - @JsonProperty("company_id") - public Optional getCompanyId() { - return companyId; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsListRequest other) { - return accountType.equals(other.accountType) - && companyId.equals(other.companyId) - && createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteFields.equals(other.remoteFields) - && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountType, - this.companyId, - this.createdAfter, - this.createdBefore, - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteFields, - this.remoteId, - this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountType = Optional.empty(); - - private Optional companyId = Optional.empty(); - - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsListRequest other) { - accountType(other.getAccountType()); - companyId(other.getCompanyId()); - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteFields(other.getRemoteFields()); - remoteId(other.getRemoteId()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(String accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "company_id", nulls = Nulls.SKIP) - public Builder companyId(Optional companyId) { - this.companyId = companyId; - return this; - } - - public Builder companyId(String companyId) { - this.companyId = Optional.ofNullable(companyId); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(AccountsListRequestRemoteFields remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(AccountsListRequestShowEnumOrigins showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public AccountsListRequest build() { - return new AccountsListRequest( - accountType, - companyId, - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteFields, - remoteId, - showEnumOrigins, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountsRetrieveRequest.java deleted file mode 100644 index 1dc22b4cf..000000000 --- a/src/main/java/com/merge/api/resources/accounting/accounts/requests/AccountsRetrieveRequest.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.accounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.accounts.types.AccountsRetrieveRequestRemoteFields; -import com.merge.api.resources.accounting.accounts.types.AccountsRetrieveRequestShowEnumOrigins; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) -public final class AccountsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private AccountsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(AccountsRetrieveRequestRemoteFields remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(AccountsRetrieveRequestShowEnumOrigins showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public AccountsRetrieveRequest build() { - return new AccountsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/api/resources/accounting/accounttoken/AccountTokenClient.java deleted file mode 100644 index 5f3f236a0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/accounttoken/AccountTokenClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.accounttoken; - -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.AccountToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountTokenClient { - protected final ClientOptions clientOptions; - - public AccountTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken) { - return retrieve(publicToken, null); - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/account-token") - .addPathSegment(publicToken) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/addresses/AddressesClient.java b/src/main/java/com/merge/api/resources/accounting/addresses/AddressesClient.java deleted file mode 100644 index d4d8e1d94..000000000 --- a/src/main/java/com/merge/api/resources/accounting/addresses/AddressesClient.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.addresses; - -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.addresses.requests.AddressesRetrieveRequest; -import com.merge.api.resources.accounting.types.Address; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AddressesClient { - protected final ClientOptions clientOptions; - - public AddressesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns an Address object with the given id. - */ - public Address retrieve(String id) { - return retrieve(id, AddressesRetrieveRequest.builder().build()); - } - - /** - * Returns an Address object with the given id. - */ - public Address retrieve(String id, AddressesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Address object with the given id. - */ - public Address retrieve(String id, AddressesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/addresses") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Address.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/api/resources/accounting/asyncpassthrough/AsyncPassthroughClient.java deleted file mode 100644 index 9b4c6d9dc..000000000 --- a/src/main/java/com/merge/api/resources/accounting/asyncpassthrough/AsyncPassthroughClient.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.asyncpassthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; -import com.merge.api.resources.accounting.types.AsyncPassthroughReciept; -import com.merge.api.resources.accounting.types.DataPassthroughRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AsyncPassthroughClient { - protected final ClientOptions clientOptions; - - public AsyncPassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/async-passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), AsyncPassthroughReciept.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); - } - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/async-passthrough") - .addPathSegment(asyncPassthroughReceiptId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AsyncPassthroughRetrieveResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/resources/accounting/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java deleted file mode 100644 index bd9fbaa24..000000000 --- a/src/main/java/com/merge/api/resources/accounting/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.asyncpassthrough.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.RemoteResponse; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) -public final class AsyncPassthroughRetrieveResponse { - private final Object value; - - private final int type; - - private AsyncPassthroughRetrieveResponse(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RemoteResponse) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); - } - - private boolean equalTo(AsyncPassthroughRetrieveResponse other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { - return new AsyncPassthroughRetrieveResponse(value, 0); - } - - public static AsyncPassthroughRetrieveResponse of(String value) { - return new AsyncPassthroughRetrieveResponse(value, 1); - } - - public interface Visitor { - T visit(RemoteResponse value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AsyncPassthroughRetrieveResponse.class); - } - - @java.lang.Override - public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/asynctasks/AsyncTasksClient.java b/src/main/java/com/merge/api/resources/accounting/asynctasks/AsyncTasksClient.java deleted file mode 100644 index fa296fddd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/asynctasks/AsyncTasksClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * 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 AsyncPostTask object with the given id. - */ - public AsyncPostTask retrieve(String id) { - return retrieve(id, null); - } - - /** - * Returns an AsyncPostTask object with the given id. - */ - 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") - .addHeader("Accept", "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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/attachments/AttachmentsClient.java b/src/main/java/com/merge/api/resources/accounting/attachments/AttachmentsClient.java deleted file mode 100644 index 27cc065b7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/attachments/AttachmentsClient.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.attachments; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.attachments.requests.AccountingAttachmentEndpointRequest; -import com.merge.api.resources.accounting.attachments.requests.AttachmentsListRequest; -import com.merge.api.resources.accounting.attachments.requests.AttachmentsRetrieveRequest; -import com.merge.api.resources.accounting.types.AccountingAttachment; -import com.merge.api.resources.accounting.types.AccountingAttachmentResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedAccountingAttachmentList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AttachmentsClient { - protected final ClientOptions clientOptions; - - public AttachmentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of AccountingAttachment objects. - */ - public PaginatedAccountingAttachmentList list() { - return list(AttachmentsListRequest.builder().build()); - } - - /** - * Returns a list of AccountingAttachment objects. - */ - public PaginatedAccountingAttachmentList list(AttachmentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of AccountingAttachment objects. - */ - public PaginatedAccountingAttachmentList list(AttachmentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/attachments"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountingAttachmentList.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); - } - } - - /** - * Creates an AccountingAttachment object with the given values. - */ - public AccountingAttachmentResponse create(AccountingAttachmentEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an AccountingAttachment object with the given values. - */ - public AccountingAttachmentResponse create( - AccountingAttachmentEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/attachments"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), AccountingAttachmentResponse.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); - } - } - - /** - * Returns an AccountingAttachment object with the given id. - */ - public AccountingAttachment retrieve(String id) { - return retrieve(id, AttachmentsRetrieveRequest.builder().build()); - } - - /** - * Returns an AccountingAttachment object with the given id. - */ - public AccountingAttachment retrieve(String id, AttachmentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an AccountingAttachment object with the given id. - */ - public AccountingAttachment retrieve(String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/attachments") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), AccountingAttachment.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); - } - } - - /** - * Returns metadata for AccountingAttachment POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for AccountingAttachment POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/attachments/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/attachments/requests/AttachmentsListRequest.java b/src/main/java/com/merge/api/resources/accounting/attachments/requests/AttachmentsListRequest.java deleted file mode 100644 index 6910b9596..000000000 --- a/src/main/java/com/merge/api/resources/accounting/attachments/requests/AttachmentsListRequest.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.attachments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentsListRequest.Builder.class) -public final class AttachmentsListRequest { - private final Optional companyId; - - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private AttachmentsListRequest( - Optional companyId, - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.companyId = companyId; - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return accounting attachments for this company. - */ - @JsonProperty("company_id") - public Optional getCompanyId() { - return companyId; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentsListRequest && equalTo((AttachmentsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentsListRequest other) { - return companyId.equals(other.companyId) - && createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.companyId, - this.createdAfter, - this.createdBefore, - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional companyId = Optional.empty(); - - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentsListRequest other) { - companyId(other.getCompanyId()); - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "company_id", nulls = Nulls.SKIP) - public Builder companyId(Optional companyId) { - this.companyId = companyId; - return this; - } - - public Builder companyId(String companyId) { - this.companyId = Optional.ofNullable(companyId); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public AttachmentsListRequest build() { - return new AttachmentsListRequest( - companyId, - createdAfter, - createdBefore, - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/attachments/requests/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/attachments/requests/AttachmentsRetrieveRequest.java deleted file mode 100644 index 7107c630e..000000000 --- a/src/main/java/com/merge/api/resources/accounting/attachments/requests/AttachmentsRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.attachments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) -public final class AttachmentsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private AttachmentsRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentsRetrieveRequest && equalTo((AttachmentsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public AttachmentsRetrieveRequest build() { - return new AttachmentsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/audittrail/AuditTrailClient.java b/src/main/java/com/merge/api/resources/accounting/audittrail/AuditTrailClient.java deleted file mode 100644 index b065f15dd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/audittrail/AuditTrailClient.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.audittrail; - -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.audittrail.requests.AuditTrailListRequest; -import com.merge.api.resources.accounting.types.PaginatedAuditLogEventList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AuditTrailClient { - protected final ClientOptions clientOptions; - - public AuditTrailClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list() { - return list(AuditTrailListRequest.builder().build()); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request) { - return list(request, null); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/audit-trail"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEventType().isPresent()) { - httpUrl.addQueryParameter("event_type", request.getEventType().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getUserEmail().isPresent()) { - httpUrl.addQueryParameter("user_email", request.getUserEmail().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAuditLogEventList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/api/resources/accounting/audittrail/requests/AuditTrailListRequest.java deleted file mode 100644 index 6ffa702d6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/audittrail/requests/AuditTrailListRequest.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.audittrail.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) -public final class AuditTrailListRequest { - private final Optional cursor; - - private final Optional endDate; - - private final Optional eventType; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional userEmail; - - private final Map additionalProperties; - - private AuditTrailListRequest( - Optional cursor, - Optional endDate, - Optional eventType, - Optional pageSize, - Optional startDate, - Optional userEmail, - Map additionalProperties) { - this.cursor = cursor; - this.endDate = endDate; - this.eventType = eventType; - this.pageSize = pageSize; - this.startDate = startDate; - this.userEmail = userEmail; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include audit trail events that occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - /** - * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED - */ - @JsonProperty("event_type") - public Optional getEventType() { - return eventType; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include audit trail events that occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditTrailListRequest other) { - return cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && eventType.equals(other.eventType) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && userEmail.equals(other.userEmail); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional eventType = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AuditTrailListRequest other) { - cursor(other.getCursor()); - endDate(other.getEndDate()); - eventType(other.getEventType()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - userEmail(other.getUserEmail()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "event_type", nulls = Nulls.SKIP) - public Builder eventType(Optional eventType) { - this.eventType = eventType; - return this; - } - - public Builder eventType(String eventType) { - this.eventType = Optional.ofNullable(eventType); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public Builder userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - public Builder userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - public AuditTrailListRequest build() { - return new AuditTrailListRequest( - cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/api/resources/accounting/availableactions/AvailableActionsClient.java deleted file mode 100644 index 4ee1175d0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/availableactions/AvailableActionsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.availableactions; - -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.AvailableActions; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AvailableActionsClient { - protected final ClientOptions clientOptions; - - public AvailableActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve() { - return retrieve(null); - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/available-actions") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AvailableActions.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/balancesheets/BalanceSheetsClient.java b/src/main/java/com/merge/api/resources/accounting/balancesheets/BalanceSheetsClient.java deleted file mode 100644 index 24fd7121b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/balancesheets/BalanceSheetsClient.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.balancesheets; - -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.balancesheets.requests.BalanceSheetsListRequest; -import com.merge.api.resources.accounting.balancesheets.requests.BalanceSheetsRetrieveRequest; -import com.merge.api.resources.accounting.types.BalanceSheet; -import com.merge.api.resources.accounting.types.PaginatedBalanceSheetList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class BalanceSheetsClient { - protected final ClientOptions clientOptions; - - public BalanceSheetsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of BalanceSheet objects. - */ - public PaginatedBalanceSheetList list() { - return list(BalanceSheetsListRequest.builder().build()); - } - - /** - * Returns a list of BalanceSheet objects. - */ - public PaginatedBalanceSheetList list(BalanceSheetsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of BalanceSheet objects. - */ - public PaginatedBalanceSheetList list(BalanceSheetsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/balance-sheets"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedBalanceSheetList.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); - } - } - - /** - * Returns a BalanceSheet object with the given id. - */ - public BalanceSheet retrieve(String id) { - return retrieve(id, BalanceSheetsRetrieveRequest.builder().build()); - } - - /** - * Returns a BalanceSheet object with the given id. - */ - public BalanceSheet retrieve(String id, BalanceSheetsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a BalanceSheet object with the given id. - */ - public BalanceSheet retrieve(String id, BalanceSheetsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/balance-sheets") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), BalanceSheet.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/balancesheets/requests/BalanceSheetsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/balancesheets/requests/BalanceSheetsRetrieveRequest.java deleted file mode 100644 index a647d103b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/balancesheets/requests/BalanceSheetsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.balancesheets.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = BalanceSheetsRetrieveRequest.Builder.class) -public final class BalanceSheetsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private BalanceSheetsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BalanceSheetsRetrieveRequest && equalTo((BalanceSheetsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(BalanceSheetsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(BalanceSheetsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public BalanceSheetsRetrieveRequest build() { - return new BalanceSheetsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/BankFeedAccountsClient.java b/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/BankFeedAccountsClient.java deleted file mode 100644 index e7b5beacb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/BankFeedAccountsClient.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.bankfeedaccounts; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.bankfeedaccounts.requests.BankFeedAccountEndpointRequest; -import com.merge.api.resources.accounting.bankfeedaccounts.requests.BankFeedAccountsListRequest; -import com.merge.api.resources.accounting.bankfeedaccounts.requests.BankFeedAccountsRetrieveRequest; -import com.merge.api.resources.accounting.types.BankFeedAccount; -import com.merge.api.resources.accounting.types.BankFeedAccountResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedBankFeedAccountList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class BankFeedAccountsClient { - protected final ClientOptions clientOptions; - - public BankFeedAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of BankFeedAccount objects. - */ - public PaginatedBankFeedAccountList list() { - return list(BankFeedAccountsListRequest.builder().build()); - } - - /** - * Returns a list of BankFeedAccount objects. - */ - public PaginatedBankFeedAccountList list(BankFeedAccountsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of BankFeedAccount objects. - */ - public PaginatedBankFeedAccountList list(BankFeedAccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-accounts"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedBankFeedAccountList.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); - } - } - - /** - * Creates a BankFeedAccount object with the given values. - */ - public BankFeedAccountResponse create(BankFeedAccountEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a BankFeedAccount object with the given values. - */ - public BankFeedAccountResponse create(BankFeedAccountEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-accounts"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), BankFeedAccountResponse.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); - } - } - - /** - * Returns a BankFeedAccount object with the given id. - */ - public BankFeedAccount retrieve(String id) { - return retrieve(id, BankFeedAccountsRetrieveRequest.builder().build()); - } - - /** - * Returns a BankFeedAccount object with the given id. - */ - public BankFeedAccount retrieve(String id, BankFeedAccountsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a BankFeedAccount object with the given id. - */ - public BankFeedAccount retrieve(String id, BankFeedAccountsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-accounts") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), BankFeedAccount.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); - } - } - - /** - * Returns metadata for BankFeedAccount POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for BankFeedAccount POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-accounts/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsRetrieveRequest.java deleted file mode 100644 index bd7adc139..000000000 --- a/src/main/java/com/merge/api/resources/accounting/bankfeedaccounts/requests/BankFeedAccountsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.bankfeedaccounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = BankFeedAccountsRetrieveRequest.Builder.class) -public final class BankFeedAccountsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private BankFeedAccountsRetrieveRequest( - Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedAccountsRetrieveRequest && equalTo((BankFeedAccountsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(BankFeedAccountsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(BankFeedAccountsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public BankFeedAccountsRetrieveRequest build() { - return new BankFeedAccountsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/bankfeedtransactions/BankFeedTransactionsClient.java b/src/main/java/com/merge/api/resources/accounting/bankfeedtransactions/BankFeedTransactionsClient.java deleted file mode 100644 index 90555e092..000000000 --- a/src/main/java/com/merge/api/resources/accounting/bankfeedtransactions/BankFeedTransactionsClient.java +++ /dev/null @@ -1,284 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.bankfeedtransactions; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.bankfeedtransactions.requests.BankFeedTransactionEndpointRequest; -import com.merge.api.resources.accounting.bankfeedtransactions.requests.BankFeedTransactionsListRequest; -import com.merge.api.resources.accounting.bankfeedtransactions.requests.BankFeedTransactionsRetrieveRequest; -import com.merge.api.resources.accounting.types.BankFeedTransaction; -import com.merge.api.resources.accounting.types.BankFeedTransactionResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedBankFeedTransactionList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class BankFeedTransactionsClient { - protected final ClientOptions clientOptions; - - public BankFeedTransactionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of BankFeedTransaction objects. - */ - public PaginatedBankFeedTransactionList list() { - return list(BankFeedTransactionsListRequest.builder().build()); - } - - /** - * Returns a list of BankFeedTransaction objects. - */ - public PaginatedBankFeedTransactionList list(BankFeedTransactionsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of BankFeedTransaction objects. - */ - public PaginatedBankFeedTransactionList list( - BankFeedTransactionsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-transactions"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsProcessed().isPresent()) { - httpUrl.addQueryParameter( - "is_processed", request.getIsProcessed().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedBankFeedTransactionList.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); - } - } - - /** - * Creates a BankFeedTransaction object with the given values. - */ - public BankFeedTransactionResponse create(BankFeedTransactionEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a BankFeedTransaction object with the given values. - */ - public BankFeedTransactionResponse create( - BankFeedTransactionEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-transactions"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), BankFeedTransactionResponse.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); - } - } - - /** - * Returns a BankFeedTransaction object with the given id. - */ - public BankFeedTransaction retrieve(String id) { - return retrieve(id, BankFeedTransactionsRetrieveRequest.builder().build()); - } - - /** - * Returns a BankFeedTransaction object with the given id. - */ - public BankFeedTransaction retrieve(String id, BankFeedTransactionsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a BankFeedTransaction object with the given id. - */ - public BankFeedTransaction retrieve( - String id, BankFeedTransactionsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-transactions") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), BankFeedTransaction.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); - } - } - - /** - * Returns metadata for BankFeedTransaction POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for BankFeedTransaction POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/bank-feed-transactions/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsRetrieveRequest.java deleted file mode 100644 index d1a9a94c7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/bankfeedtransactions/requests/BankFeedTransactionsRetrieveRequest.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.bankfeedtransactions.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = BankFeedTransactionsRetrieveRequest.Builder.class) -public final class BankFeedTransactionsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private BankFeedTransactionsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedTransactionsRetrieveRequest - && equalTo((BankFeedTransactionsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(BankFeedTransactionsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(BankFeedTransactionsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public BankFeedTransactionsRetrieveRequest build() { - return new BankFeedTransactionsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/cashflowstatements/CashFlowStatementsClient.java b/src/main/java/com/merge/api/resources/accounting/cashflowstatements/CashFlowStatementsClient.java deleted file mode 100644 index 0c1a3fcf3..000000000 --- a/src/main/java/com/merge/api/resources/accounting/cashflowstatements/CashFlowStatementsClient.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.cashflowstatements; - -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.cashflowstatements.requests.CashFlowStatementsListRequest; -import com.merge.api.resources.accounting.cashflowstatements.requests.CashFlowStatementsRetrieveRequest; -import com.merge.api.resources.accounting.types.CashFlowStatement; -import com.merge.api.resources.accounting.types.PaginatedCashFlowStatementList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CashFlowStatementsClient { - protected final ClientOptions clientOptions; - - public CashFlowStatementsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of CashFlowStatement objects. - */ - public PaginatedCashFlowStatementList list() { - return list(CashFlowStatementsListRequest.builder().build()); - } - - /** - * Returns a list of CashFlowStatement objects. - */ - public PaginatedCashFlowStatementList list(CashFlowStatementsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of CashFlowStatement objects. - */ - public PaginatedCashFlowStatementList list(CashFlowStatementsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/cash-flow-statements"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCashFlowStatementList.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); - } - } - - /** - * Returns a CashFlowStatement object with the given id. - */ - public CashFlowStatement retrieve(String id) { - return retrieve(id, CashFlowStatementsRetrieveRequest.builder().build()); - } - - /** - * Returns a CashFlowStatement object with the given id. - */ - public CashFlowStatement retrieve(String id, CashFlowStatementsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a CashFlowStatement object with the given id. - */ - public CashFlowStatement retrieve( - String id, CashFlowStatementsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/cash-flow-statements") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CashFlowStatement.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsRetrieveRequest.java deleted file mode 100644 index 29db7c7f2..000000000 --- a/src/main/java/com/merge/api/resources/accounting/cashflowstatements/requests/CashFlowStatementsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.cashflowstatements.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CashFlowStatementsRetrieveRequest.Builder.class) -public final class CashFlowStatementsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private CashFlowStatementsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CashFlowStatementsRetrieveRequest && equalTo((CashFlowStatementsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CashFlowStatementsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CashFlowStatementsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public CashFlowStatementsRetrieveRequest build() { - return new CashFlowStatementsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/companyinfo/CompanyInfoClient.java b/src/main/java/com/merge/api/resources/accounting/companyinfo/CompanyInfoClient.java deleted file mode 100644 index 8ce45c26b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/companyinfo/CompanyInfoClient.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.companyinfo; - -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.companyinfo.requests.CompanyInfoListRequest; -import com.merge.api.resources.accounting.companyinfo.requests.CompanyInfoRetrieveRequest; -import com.merge.api.resources.accounting.types.CompanyInfo; -import com.merge.api.resources.accounting.types.PaginatedCompanyInfoList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CompanyInfoClient { - protected final ClientOptions clientOptions; - - public CompanyInfoClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of CompanyInfo objects. - */ - public PaginatedCompanyInfoList list() { - return list(CompanyInfoListRequest.builder().build()); - } - - /** - * Returns a list of CompanyInfo objects. - */ - public PaginatedCompanyInfoList list(CompanyInfoListRequest request) { - return list(request, null); - } - - /** - * Returns a list of CompanyInfo objects. - */ - public PaginatedCompanyInfoList list(CompanyInfoListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/company-info"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCompanyInfoList.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); - } - } - - /** - * Returns a CompanyInfo object with the given id. - */ - public CompanyInfo retrieve(String id) { - return retrieve(id, CompanyInfoRetrieveRequest.builder().build()); - } - - /** - * Returns a CompanyInfo object with the given id. - */ - public CompanyInfo retrieve(String id, CompanyInfoRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a CompanyInfo object with the given id. - */ - public CompanyInfo retrieve(String id, CompanyInfoRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/company-info") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CompanyInfo.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/companyinfo/requests/CompanyInfoRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/companyinfo/requests/CompanyInfoRetrieveRequest.java deleted file mode 100644 index a43205b56..000000000 --- a/src/main/java/com/merge/api/resources/accounting/companyinfo/requests/CompanyInfoRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.companyinfo.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.companyinfo.types.CompanyInfoRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CompanyInfoRetrieveRequest.Builder.class) -public final class CompanyInfoRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private CompanyInfoRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CompanyInfoRetrieveRequest && equalTo((CompanyInfoRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CompanyInfoRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CompanyInfoRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CompanyInfoRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public CompanyInfoRetrieveRequest build() { - return new CompanyInfoRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/companyinfo/types/CompanyInfoListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/companyinfo/types/CompanyInfoListRequestExpand.java deleted file mode 100644 index 60b7bcd04..000000000 --- a/src/main/java/com/merge/api/resources/accounting/companyinfo/types/CompanyInfoListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.companyinfo.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CompanyInfoListRequestExpand { - ADDRESSES("addresses"), - - ADDRESSES_PHONE_NUMBERS("addresses,phone_numbers"), - - PHONE_NUMBERS("phone_numbers"); - - private final String value; - - CompanyInfoListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/companyinfo/types/CompanyInfoRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/companyinfo/types/CompanyInfoRetrieveRequestExpand.java deleted file mode 100644 index 333976601..000000000 --- a/src/main/java/com/merge/api/resources/accounting/companyinfo/types/CompanyInfoRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.companyinfo.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CompanyInfoRetrieveRequestExpand { - ADDRESSES("addresses"), - - ADDRESSES_PHONE_NUMBERS("addresses,phone_numbers"), - - PHONE_NUMBERS("phone_numbers"); - - private final String value; - - CompanyInfoRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/contacts/ContactsClient.java b/src/main/java/com/merge/api/resources/accounting/contacts/ContactsClient.java deleted file mode 100644 index cc01207b5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/contacts/ContactsClient.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.contacts; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.contacts.requests.ContactEndpointRequest; -import com.merge.api.resources.accounting.contacts.requests.ContactsListRequest; -import com.merge.api.resources.accounting.contacts.requests.ContactsRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.contacts.requests.ContactsRetrieveRequest; -import com.merge.api.resources.accounting.types.Contact; -import com.merge.api.resources.accounting.types.ContactResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedContactList; -import com.merge.api.resources.accounting.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ContactsClient { - protected final ClientOptions clientOptions; - - public ContactsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list() { - return list(ContactsListRequest.builder().build()); - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list(ContactsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list(ContactsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/contacts"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmailAddress().isPresent()) { - httpUrl.addQueryParameter("email_address", request.getEmailAddress().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCustomer().isPresent()) { - httpUrl.addQueryParameter("is_customer", request.getIsCustomer().get()); - } - if (request.getIsSupplier().isPresent()) { - httpUrl.addQueryParameter("is_supplier", request.getIsSupplier().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getName().isPresent()) { - httpUrl.addQueryParameter("name", request.getName().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedContactList.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); - } - } - - /** - * Creates a Contact object with the given values. - */ - public ContactResponse create(ContactEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Contact object with the given values. - */ - public ContactResponse create(ContactEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/contacts"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), ContactResponse.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); - } - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id) { - return retrieve(id, ContactsRetrieveRequest.builder().build()); - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id, ContactsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/contacts") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Contact.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); - } - } - - /** - * Returns metadata for Contact POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Contact POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/contacts/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - ContactsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(ContactsRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/contacts/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsListRequest.java b/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsListRequest.java deleted file mode 100644 index 67b527bf6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsListRequest.java +++ /dev/null @@ -1,627 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.contacts.types.ContactsListRequestExpand; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsListRequest.Builder.class) -public final class ContactsListRequest { - private final Optional companyId; - - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional emailAddress; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Optional includeShellData; - - private final Optional isCustomer; - - private final Optional isSupplier; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional name; - - private final Optional pageSize; - - private final Optional remoteFields; - - private final Optional remoteId; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private ContactsListRequest( - Optional companyId, - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional emailAddress, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeRemoteFields, - Optional includeShellData, - Optional isCustomer, - Optional isSupplier, - Optional modifiedAfter, - Optional modifiedBefore, - Optional name, - Optional pageSize, - Optional remoteFields, - Optional remoteId, - Optional showEnumOrigins, - Map additionalProperties) { - this.companyId = companyId; - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.emailAddress = emailAddress; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.includeShellData = includeShellData; - this.isCustomer = isCustomer; - this.isSupplier = isSupplier; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.name = name; - this.pageSize = pageSize; - this.remoteFields = remoteFields; - this.remoteId = remoteId; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return contacts for this company. - */ - @JsonProperty("company_id") - public Optional getCompanyId() { - return companyId; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return Contacts that match this email. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, will only return Contacts that are denoted as customers. - */ - @JsonProperty("is_customer") - public Optional getIsCustomer() { - return isCustomer; - } - - /** - * @return If provided, will only return Contacts that are denoted as suppliers. - */ - @JsonProperty("is_supplier") - public Optional getIsSupplier() { - return isSupplier; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return If provided, will only return Contacts that match this name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsListRequest && equalTo((ContactsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsListRequest other) { - return companyId.equals(other.companyId) - && createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && emailAddress.equals(other.emailAddress) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields) - && includeShellData.equals(other.includeShellData) - && isCustomer.equals(other.isCustomer) - && isSupplier.equals(other.isSupplier) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && name.equals(other.name) - && pageSize.equals(other.pageSize) - && remoteFields.equals(other.remoteFields) - && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.companyId, - this.createdAfter, - this.createdBefore, - this.cursor, - this.emailAddress, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeRemoteFields, - this.includeShellData, - this.isCustomer, - this.isSupplier, - this.modifiedAfter, - this.modifiedBefore, - this.name, - this.pageSize, - this.remoteFields, - this.remoteId, - this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional companyId = Optional.empty(); - - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional isCustomer = Optional.empty(); - - private Optional isSupplier = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsListRequest other) { - companyId(other.getCompanyId()); - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - emailAddress(other.getEmailAddress()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - includeShellData(other.getIncludeShellData()); - isCustomer(other.getIsCustomer()); - isSupplier(other.getIsSupplier()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - name(other.getName()); - pageSize(other.getPageSize()); - remoteFields(other.getRemoteFields()); - remoteId(other.getRemoteId()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "company_id", nulls = Nulls.SKIP) - public Builder companyId(Optional companyId) { - this.companyId = companyId; - return this; - } - - public Builder companyId(String companyId) { - this.companyId = Optional.ofNullable(companyId); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ContactsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "is_customer", nulls = Nulls.SKIP) - public Builder isCustomer(Optional isCustomer) { - this.isCustomer = isCustomer; - return this; - } - - public Builder isCustomer(String isCustomer) { - this.isCustomer = Optional.ofNullable(isCustomer); - return this; - } - - @JsonSetter(value = "is_supplier", nulls = Nulls.SKIP) - public Builder isSupplier(Optional isSupplier) { - this.isSupplier = isSupplier; - return this; - } - - public Builder isSupplier(String isSupplier) { - this.isSupplier = Optional.ofNullable(isSupplier); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public ContactsListRequest build() { - return new ContactsListRequest( - companyId, - createdAfter, - createdBefore, - cursor, - emailAddress, - expand, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - isCustomer, - isSupplier, - modifiedAfter, - modifiedBefore, - name, - pageSize, - remoteFields, - remoteId, - showEnumOrigins, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsRemoteFieldClassesListRequest.java deleted file mode 100644 index cd73b8493..000000000 --- a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsRemoteFieldClassesListRequest.java +++ /dev/null @@ -1,249 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsRemoteFieldClassesListRequest.Builder.class) -public final class ContactsRemoteFieldClassesListRequest { - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional isCommonModelField; - - private final Optional pageSize; - - private final Map additionalProperties; - - private ContactsRemoteFieldClassesListRequest( - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional isCommonModelField, - Optional pageSize, - Map additionalProperties) { - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.isCommonModelField = isCommonModelField; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, will only return remote field classes with this is_common_model_field value - */ - @JsonProperty("is_common_model_field") - public Optional getIsCommonModelField() { - return isCommonModelField; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsRemoteFieldClassesListRequest - && equalTo((ContactsRemoteFieldClassesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsRemoteFieldClassesListRequest other) { - return cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && isCommonModelField.equals(other.isCommonModelField) - && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.isCommonModelField, - this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional isCommonModelField = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsRemoteFieldClassesListRequest other) { - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - isCommonModelField(other.getIsCommonModelField()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) - public Builder isCommonModelField(Optional isCommonModelField) { - this.isCommonModelField = isCommonModelField; - return this; - } - - public Builder isCommonModelField(Boolean isCommonModelField) { - this.isCommonModelField = Optional.ofNullable(isCommonModelField); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public ContactsRemoteFieldClassesListRequest build() { - return new ContactsRemoteFieldClassesListRequest( - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - isCommonModelField, - pageSize, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsRetrieveRequest.java deleted file mode 100644 index b687bffe6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/contacts/requests/ContactsRetrieveRequest.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.contacts.types.ContactsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsRetrieveRequest.Builder.class) -public final class ContactsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private ContactsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsRetrieveRequest && equalTo((ContactsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ContactsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public ContactsRetrieveRequest build() { - return new ContactsRetrieveRequest( - expand, - includeRemoteData, - includeRemoteFields, - remoteFields, - showEnumOrigins, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/contacts/types/ContactsListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/contacts/types/ContactsListRequestExpand.java deleted file mode 100644 index bfff8131f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/contacts/types/ContactsListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.contacts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ContactsListRequestExpand { - ADDRESSES("addresses"), - - ADDRESSES_COMPANY("addresses,company"), - - ADDRESSES_PHONE_NUMBERS("addresses,phone_numbers"), - - ADDRESSES_PHONE_NUMBERS_COMPANY("addresses,phone_numbers,company"), - - COMPANY("company"), - - PHONE_NUMBERS("phone_numbers"), - - PHONE_NUMBERS_COMPANY("phone_numbers,company"); - - private final String value; - - ContactsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/contacts/types/ContactsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/contacts/types/ContactsRetrieveRequestExpand.java deleted file mode 100644 index f681e48b8..000000000 --- a/src/main/java/com/merge/api/resources/accounting/contacts/types/ContactsRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.contacts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ContactsRetrieveRequestExpand { - ADDRESSES("addresses"), - - ADDRESSES_COMPANY("addresses,company"), - - ADDRESSES_PHONE_NUMBERS("addresses,phone_numbers"), - - ADDRESSES_PHONE_NUMBERS_COMPANY("addresses,phone_numbers,company"), - - COMPANY("company"), - - PHONE_NUMBERS("phone_numbers"), - - PHONE_NUMBERS_COMPANY("phone_numbers,company"); - - private final String value; - - ContactsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/CreditNotesClient.java b/src/main/java/com/merge/api/resources/accounting/creditnotes/CreditNotesClient.java deleted file mode 100644 index 07f5bdcc3..000000000 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/CreditNotesClient.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.creditnotes; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.creditnotes.requests.CreditNoteEndpointRequest; -import com.merge.api.resources.accounting.creditnotes.requests.CreditNotesListRequest; -import com.merge.api.resources.accounting.creditnotes.requests.CreditNotesRetrieveRequest; -import com.merge.api.resources.accounting.types.CreditNote; -import com.merge.api.resources.accounting.types.CreditNoteResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedCreditNoteList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CreditNotesClient { - protected final ClientOptions clientOptions; - - public CreditNotesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of CreditNote objects. - */ - public PaginatedCreditNoteList list() { - return list(CreditNotesListRequest.builder().build()); - } - - /** - * Returns a list of CreditNote objects. - */ - public PaginatedCreditNoteList list(CreditNotesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of CreditNote objects. - */ - public PaginatedCreditNoteList list(CreditNotesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/credit-notes"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - if (request.getTransactionDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_after", - request.getTransactionDateAfter().get().toString()); - } - if (request.getTransactionDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_before", - request.getTransactionDateBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCreditNoteList.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); - } - } - - /** - * Creates a CreditNote object with the given values. - */ - public CreditNoteResponse create(CreditNoteEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a CreditNote object with the given values. - */ - public CreditNoteResponse create(CreditNoteEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/credit-notes"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CreditNoteResponse.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); - } - } - - /** - * Returns a CreditNote object with the given id. - */ - public CreditNote retrieve(String id) { - return retrieve(id, CreditNotesRetrieveRequest.builder().build()); - } - - /** - * Returns a CreditNote object with the given id. - */ - public CreditNote retrieve(String id, CreditNotesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a CreditNote object with the given id. - */ - public CreditNote retrieve(String id, CreditNotesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/credit-notes") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CreditNote.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); - } - } - - /** - * Returns metadata for CreditNote POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for CreditNote POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/credit-notes/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/requests/CreditNotesRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/creditnotes/requests/CreditNotesRetrieveRequest.java deleted file mode 100644 index 75909edbb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/requests/CreditNotesRetrieveRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.creditnotes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.creditnotes.types.CreditNotesRetrieveRequestExpand; -import com.merge.api.resources.accounting.creditnotes.types.CreditNotesRetrieveRequestRemoteFields; -import com.merge.api.resources.accounting.creditnotes.types.CreditNotesRetrieveRequestShowEnumOrigins; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreditNotesRetrieveRequest.Builder.class) -public final class CreditNotesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private CreditNotesRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreditNotesRetrieveRequest && equalTo((CreditNotesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreditNotesRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CreditNotesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CreditNotesRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(CreditNotesRetrieveRequestRemoteFields remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(CreditNotesRetrieveRequestShowEnumOrigins showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public CreditNotesRetrieveRequest build() { - return new CreditNotesRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestExpand.java deleted file mode 100644 index a12c58ee5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesListRequestExpand.java +++ /dev/null @@ -1,308 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.creditnotes.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CreditNotesListRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_PAYMENTS("applied_payments"), - - APPLIED_PAYMENTS_ACCOUNTING_PERIOD("applied_payments,accounting_period"), - - APPLIED_PAYMENTS_COMPANY("applied_payments,company"), - - APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("applied_payments,company,accounting_period"), - - APPLIED_PAYMENTS_CONTACT("applied_payments,contact"), - - APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("applied_payments,contact,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_COMPANY("applied_payments,contact,company"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_payments,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS("applied_payments,line_items"), - - APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("applied_payments,line_items,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("applied_payments,line_items,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("applied_payments,line_items,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("applied_payments,line_items,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("applied_payments,line_items,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("applied_payments,line_items,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("applied_payments,line_items,tracking_categories"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("applied_payments,line_items,tracking_categories,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("applied_payments,line_items,tracking_categories,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES("applied_payments,tracking_categories"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("applied_payments,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("applied_payments,tracking_categories,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("applied_payments,tracking_categories,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("applied_payments,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,company,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_COMPANY("line_items,company"), - - LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("line_items,company,accounting_period"), - - LINE_ITEMS_CONTACT("line_items,contact"), - - LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("line_items,contact,accounting_period"), - - LINE_ITEMS_CONTACT_COMPANY("line_items,contact,company"), - - LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("line_items,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("line_items,tracking_categories,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("line_items,tracking_categories,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("line_items,tracking_categories,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS("payments"), - - PAYMENTS_ACCOUNTING_PERIOD("payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS("payments,applied_payments"), - - PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("payments,applied_payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY("payments,applied_payments,company"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,applied_payments,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT("payments,applied_payments,contact"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,applied_payments,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY("payments,applied_payments,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS("payments,applied_payments,line_items"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,applied_payments,line_items,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("payments,applied_payments,line_items,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("payments,applied_payments,line_items,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,applied_payments,line_items,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES( - "payments,applied_payments,line_items,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("payments,applied_payments,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,applied_payments,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,applied_payments,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_COMPANY("payments,company"), - - PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,company,accounting_period"), - - PAYMENTS_CONTACT("payments,contact"), - - PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,contact,accounting_period"), - - PAYMENTS_CONTACT_COMPANY("payments,contact,company"), - - PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS("payments,line_items"), - - PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,line_items,accounting_period"), - - PAYMENTS_LINE_ITEMS_COMPANY("payments,line_items,company"), - - PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("payments,line_items,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT("payments,line_items,contact"), - - PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("payments,line_items,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,line_items,contact,company"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,line_items,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("payments,line_items,tracking_categories"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("payments,line_items,tracking_categories,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("payments,line_items,tracking_categories,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES("payments,tracking_categories"), - - PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("payments,tracking_categories,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,tracking_categories,company"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("payments,tracking_categories,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,tracking_categories,contact"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,tracking_categories,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"); - - private final String value; - - CreditNotesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestExpand.java deleted file mode 100644 index d71033627..000000000 --- a/src/main/java/com/merge/api/resources/accounting/creditnotes/types/CreditNotesRetrieveRequestExpand.java +++ /dev/null @@ -1,308 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.creditnotes.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CreditNotesRetrieveRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_PAYMENTS("applied_payments"), - - APPLIED_PAYMENTS_ACCOUNTING_PERIOD("applied_payments,accounting_period"), - - APPLIED_PAYMENTS_COMPANY("applied_payments,company"), - - APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("applied_payments,company,accounting_period"), - - APPLIED_PAYMENTS_CONTACT("applied_payments,contact"), - - APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("applied_payments,contact,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_COMPANY("applied_payments,contact,company"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_payments,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS("applied_payments,line_items"), - - APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("applied_payments,line_items,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("applied_payments,line_items,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("applied_payments,line_items,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("applied_payments,line_items,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("applied_payments,line_items,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("applied_payments,line_items,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("applied_payments,line_items,tracking_categories"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("applied_payments,line_items,tracking_categories,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("applied_payments,line_items,tracking_categories,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES("applied_payments,tracking_categories"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("applied_payments,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("applied_payments,tracking_categories,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("applied_payments,tracking_categories,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("applied_payments,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,company,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_COMPANY("line_items,company"), - - LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("line_items,company,accounting_period"), - - LINE_ITEMS_CONTACT("line_items,contact"), - - LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("line_items,contact,accounting_period"), - - LINE_ITEMS_CONTACT_COMPANY("line_items,contact,company"), - - LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("line_items,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("line_items,tracking_categories,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("line_items,tracking_categories,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("line_items,tracking_categories,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS("payments"), - - PAYMENTS_ACCOUNTING_PERIOD("payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS("payments,applied_payments"), - - PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("payments,applied_payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY("payments,applied_payments,company"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,applied_payments,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT("payments,applied_payments,contact"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,applied_payments,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY("payments,applied_payments,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS("payments,applied_payments,line_items"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,applied_payments,line_items,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("payments,applied_payments,line_items,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("payments,applied_payments,line_items,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,applied_payments,line_items,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES( - "payments,applied_payments,line_items,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("payments,applied_payments,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,applied_payments,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,applied_payments,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_COMPANY("payments,company"), - - PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,company,accounting_period"), - - PAYMENTS_CONTACT("payments,contact"), - - PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,contact,accounting_period"), - - PAYMENTS_CONTACT_COMPANY("payments,contact,company"), - - PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS("payments,line_items"), - - PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,line_items,accounting_period"), - - PAYMENTS_LINE_ITEMS_COMPANY("payments,line_items,company"), - - PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("payments,line_items,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT("payments,line_items,contact"), - - PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("payments,line_items,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,line_items,contact,company"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,line_items,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("payments,line_items,tracking_categories"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("payments,line_items,tracking_categories,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("payments,line_items,tracking_categories,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES("payments,tracking_categories"), - - PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("payments,tracking_categories,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,tracking_categories,company"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("payments,tracking_categories,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,tracking_categories,contact"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,tracking_categories,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"); - - private final String value; - - CreditNotesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/api/resources/accounting/deleteaccount/DeleteAccountClient.java deleted file mode 100644 index 80a69903b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/deleteaccount/DeleteAccountClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.deleteaccount; - -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 java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DeleteAccountClient { - protected final ClientOptions clientOptions; - - public DeleteAccountClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Delete a linked account. - */ - public void delete() { - delete(null); - } - - /** - * Delete a linked account. - */ - public void delete(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/delete-account") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .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; - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/employees/EmployeesClient.java b/src/main/java/com/merge/api/resources/accounting/employees/EmployeesClient.java deleted file mode 100644 index 98bb266b9..000000000 --- a/src/main/java/com/merge/api/resources/accounting/employees/EmployeesClient.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.employees; - -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.employees.requests.EmployeesListRequest; -import com.merge.api.resources.accounting.employees.requests.EmployeesRetrieveRequest; -import com.merge.api.resources.accounting.types.Employee; -import com.merge.api.resources.accounting.types.PaginatedEmployeeList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EmployeesClient { - protected final ClientOptions clientOptions; - - public EmployeesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Employee objects. - */ - public PaginatedEmployeeList list() { - return list(EmployeesListRequest.builder().build()); - } - - /** - * Returns a list of Employee objects. - */ - public PaginatedEmployeeList list(EmployeesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Employee objects. - */ - public PaginatedEmployeeList list(EmployeesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/employees"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEmployeeList.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); - } - } - - /** - * Returns an Employee object with the given id. - */ - public Employee retrieve(String id) { - return retrieve(id, EmployeesRetrieveRequest.builder().build()); - } - - /** - * Returns an Employee object with the given id. - */ - public Employee retrieve(String id, EmployeesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Employee object with the given id. - */ - public Employee retrieve(String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/employees") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Employee.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/employees/requests/EmployeesListRequest.java b/src/main/java/com/merge/api/resources/accounting/employees/requests/EmployeesListRequest.java deleted file mode 100644 index 452e24f0a..000000000 --- a/src/main/java/com/merge/api/resources/accounting/employees/requests/EmployeesListRequest.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.employees.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmployeesListRequest.Builder.class) -public final class EmployeesListRequest { - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional pageSize; - - private final Map additionalProperties; - - private EmployeesListRequest( - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional pageSize, - Map additionalProperties) { - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeesListRequest && equalTo((EmployeesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmployeesListRequest other) { - return cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmployeesListRequest other) { - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public EmployeesListRequest build() { - return new EmployeesListRequest( - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - pageSize, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/employees/requests/EmployeesRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/employees/requests/EmployeesRetrieveRequest.java deleted file mode 100644 index 83a6c593a..000000000 --- a/src/main/java/com/merge/api/resources/accounting/employees/requests/EmployeesRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.employees.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmployeesRetrieveRequest.Builder.class) -public final class EmployeesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private EmployeesRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeesRetrieveRequest && equalTo((EmployeesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmployeesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmployeesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public EmployeesRetrieveRequest build() { - return new EmployeesRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/expenses/ExpensesClient.java b/src/main/java/com/merge/api/resources/accounting/expenses/ExpensesClient.java deleted file mode 100644 index 2c05b5358..000000000 --- a/src/main/java/com/merge/api/resources/accounting/expenses/ExpensesClient.java +++ /dev/null @@ -1,449 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.expenses; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.expenses.requests.ExpenseEndpointRequest; -import com.merge.api.resources.accounting.expenses.requests.ExpensesLinesRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.expenses.requests.ExpensesListRequest; -import com.merge.api.resources.accounting.expenses.requests.ExpensesRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.expenses.requests.ExpensesRetrieveRequest; -import com.merge.api.resources.accounting.types.Expense; -import com.merge.api.resources.accounting.types.ExpenseResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedExpenseList; -import com.merge.api.resources.accounting.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ExpensesClient { - protected final ClientOptions clientOptions; - - public ExpensesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Expense objects. - */ - public PaginatedExpenseList list() { - return list(ExpensesListRequest.builder().build()); - } - - /** - * Returns a list of Expense objects. - */ - public PaginatedExpenseList list(ExpensesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Expense objects. - */ - public PaginatedExpenseList list(ExpensesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/expenses"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTransactionDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_after", - request.getTransactionDateAfter().get().toString()); - } - if (request.getTransactionDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_before", - request.getTransactionDateBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedExpenseList.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); - } - } - - /** - * Creates an Expense object with the given values. - */ - public ExpenseResponse create(ExpenseEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Expense object with the given values. - */ - public ExpenseResponse create(ExpenseEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/expenses"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), ExpenseResponse.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); - } - } - - /** - * Returns an Expense object with the given id. - */ - public Expense retrieve(String id) { - return retrieve(id, ExpensesRetrieveRequest.builder().build()); - } - - /** - * Returns an Expense object with the given id. - */ - public Expense retrieve(String id, ExpensesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Expense object with the given id. - */ - public Expense retrieve(String id, ExpensesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/expenses") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Expense.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList linesRemoteFieldClassesList() { - return linesRemoteFieldClassesList( - ExpensesLinesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList linesRemoteFieldClassesList( - ExpensesLinesRemoteFieldClassesListRequest request) { - return linesRemoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList linesRemoteFieldClassesList( - ExpensesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/expenses/lines/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } - - /** - * Returns metadata for Expense POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Expense POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/expenses/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - ExpensesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(ExpensesRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - ExpensesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/expenses/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpensesRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpensesRetrieveRequest.java deleted file mode 100644 index 0b94c8644..000000000 --- a/src/main/java/com/merge/api/resources/accounting/expenses/requests/ExpensesRetrieveRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.expenses.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.expenses.types.ExpensesRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExpensesRetrieveRequest.Builder.class) -public final class ExpensesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private ExpensesRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExpensesRetrieveRequest && equalTo((ExpensesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExpensesRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExpensesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ExpensesRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public ExpensesRetrieveRequest build() { - return new ExpensesRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/expenses/types/ExpensesListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/expenses/types/ExpensesListRequestExpand.java deleted file mode 100644 index 6ad80e938..000000000 --- a/src/main/java/com/merge/api/resources/accounting/expenses/types/ExpensesListRequestExpand.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.expenses.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ExpensesListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ACCOUNTING_PERIOD("account,accounting_period"), - - ACCOUNT_COMPANY("account,company"), - - ACCOUNT_COMPANY_ACCOUNTING_PERIOD("account,company,accounting_period"), - - ACCOUNT_COMPANY_EMPLOYEE("account,company,employee"), - - ACCOUNT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("account,company,employee,accounting_period"), - - ACCOUNT_CONTACT("account,contact"), - - ACCOUNT_CONTACT_ACCOUNTING_PERIOD("account,contact,accounting_period"), - - ACCOUNT_CONTACT_COMPANY("account,contact,company"), - - ACCOUNT_CONTACT_COMPANY_ACCOUNTING_PERIOD("account,contact,company,accounting_period"), - - ACCOUNT_CONTACT_COMPANY_EMPLOYEE("account,contact,company,employee"), - - ACCOUNT_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("account,contact,company,employee,accounting_period"), - - ACCOUNT_CONTACT_EMPLOYEE("account,contact,employee"), - - ACCOUNT_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("account,contact,employee,accounting_period"), - - ACCOUNT_EMPLOYEE("account,employee"), - - ACCOUNT_EMPLOYEE_ACCOUNTING_PERIOD("account,employee,accounting_period"), - - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - COMPANY_EMPLOYEE("company,employee"), - - COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("company,employee,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - CONTACT_COMPANY_EMPLOYEE("contact,company,employee"), - - CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("contact,company,employee,accounting_period"), - - CONTACT_EMPLOYEE("contact,employee"), - - CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("contact,employee,accounting_period"), - - EMPLOYEE("employee"), - - EMPLOYEE_ACCOUNTING_PERIOD("employee,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNT("tracking_categories,account"), - - TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,account,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY("tracking_categories,account,company"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,account,company,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_EMPLOYEE("tracking_categories,account,company,employee"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,account,company,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT("tracking_categories,account,contact"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_ACCOUNTING_PERIOD("tracking_categories,account,contact,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY("tracking_categories,account,contact,company"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,account,contact,company,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY_EMPLOYEE("tracking_categories,account,contact,company,employee"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,account,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_EMPLOYEE("tracking_categories,account,contact,employee"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,account,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_EMPLOYEE("tracking_categories,account,employee"), - - TRACKING_CATEGORIES_ACCOUNT_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,account,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE("tracking_categories,company,employee"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("tracking_categories,contact,company,employee"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE("tracking_categories,contact,employee"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_EMPLOYEE("tracking_categories,employee"), - - TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,employee,accounting_period"); - - private final String value; - - ExpensesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/expenses/types/ExpensesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/expenses/types/ExpensesRetrieveRequestExpand.java deleted file mode 100644 index 2549a8711..000000000 --- a/src/main/java/com/merge/api/resources/accounting/expenses/types/ExpensesRetrieveRequestExpand.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.expenses.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ExpensesRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ACCOUNTING_PERIOD("account,accounting_period"), - - ACCOUNT_COMPANY("account,company"), - - ACCOUNT_COMPANY_ACCOUNTING_PERIOD("account,company,accounting_period"), - - ACCOUNT_COMPANY_EMPLOYEE("account,company,employee"), - - ACCOUNT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("account,company,employee,accounting_period"), - - ACCOUNT_CONTACT("account,contact"), - - ACCOUNT_CONTACT_ACCOUNTING_PERIOD("account,contact,accounting_period"), - - ACCOUNT_CONTACT_COMPANY("account,contact,company"), - - ACCOUNT_CONTACT_COMPANY_ACCOUNTING_PERIOD("account,contact,company,accounting_period"), - - ACCOUNT_CONTACT_COMPANY_EMPLOYEE("account,contact,company,employee"), - - ACCOUNT_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("account,contact,company,employee,accounting_period"), - - ACCOUNT_CONTACT_EMPLOYEE("account,contact,employee"), - - ACCOUNT_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("account,contact,employee,accounting_period"), - - ACCOUNT_EMPLOYEE("account,employee"), - - ACCOUNT_EMPLOYEE_ACCOUNTING_PERIOD("account,employee,accounting_period"), - - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - COMPANY_EMPLOYEE("company,employee"), - - COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("company,employee,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - CONTACT_COMPANY_EMPLOYEE("contact,company,employee"), - - CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("contact,company,employee,accounting_period"), - - CONTACT_EMPLOYEE("contact,employee"), - - CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("contact,employee,accounting_period"), - - EMPLOYEE("employee"), - - EMPLOYEE_ACCOUNTING_PERIOD("employee,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNT("tracking_categories,account"), - - TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,account,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY("tracking_categories,account,company"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,account,company,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_EMPLOYEE("tracking_categories,account,company,employee"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,account,company,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT("tracking_categories,account,contact"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_ACCOUNTING_PERIOD("tracking_categories,account,contact,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY("tracking_categories,account,contact,company"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,account,contact,company,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY_EMPLOYEE("tracking_categories,account,contact,company,employee"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,account,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_EMPLOYEE("tracking_categories,account,contact,employee"), - - TRACKING_CATEGORIES_ACCOUNT_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,account,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_EMPLOYEE("tracking_categories,account,employee"), - - TRACKING_CATEGORIES_ACCOUNT_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,account,employee,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE("tracking_categories,company,employee"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("tracking_categories,contact,company,employee"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE("tracking_categories,contact,employee"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_EMPLOYEE("tracking_categories,employee"), - - TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,employee,accounting_period"); - - private final String value; - - ExpensesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/api/resources/accounting/fieldmapping/FieldMappingClient.java deleted file mode 100644 index 5cab701ad..000000000 --- a/src/main/java/com/merge/api/resources/accounting/fieldmapping/FieldMappingClient.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.fieldmapping; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.fieldmapping.requests.CreateFieldMappingRequest; -import com.merge.api.resources.accounting.fieldmapping.requests.FieldMappingsRetrieveRequest; -import com.merge.api.resources.accounting.fieldmapping.requests.PatchedEditFieldMappingRequest; -import com.merge.api.resources.accounting.fieldmapping.requests.RemoteFieldsRetrieveRequest; -import com.merge.api.resources.accounting.types.ExternalTargetFieldApiResponse; -import com.merge.api.resources.accounting.types.FieldMappingApiInstanceResponse; -import com.merge.api.resources.accounting.types.FieldMappingInstanceResponse; -import com.merge.api.resources.accounting.types.RemoteFieldApiResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FieldMappingClient { - protected final ClientOptions clientOptions; - - public FieldMappingClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { - return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { - return fieldMappingsRetrieve(request, null); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve( - FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingApiInstanceResponse.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); - } - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { - return fieldMappingsCreate(request, null); - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate( - CreateFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { - return fieldMappingsPartialUpdate( - fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request) { - return fieldMappingsPartialUpdate(fieldMappingId, request, null); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve() { - return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { - return remoteFieldsRetrieve(request, null); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve( - RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/remote-fields"); - if (request.getCommonModels().isPresent()) { - httpUrl.addQueryParameter("common_models", request.getCommonModels().get()); - } - if (request.getIncludeExampleValues().isPresent()) { - httpUrl.addQueryParameter( - "include_example_values", request.getIncludeExampleValues().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RemoteFieldApiResponse.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); - } - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve() { - return targetFieldsRetrieve(null); - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/target-fields") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), ExternalTargetFieldApiResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/CreateFieldMappingRequest.java deleted file mode 100644 index 4def5bffb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/CreateFieldMappingRequest.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) -public final class CreateFieldMappingRequest { - private final Optional excludeRemoteFieldMetadata; - - private final String targetFieldName; - - private final String targetFieldDescription; - - private final List remoteFieldTraversalPath; - - private final String remoteMethod; - - private final String remoteUrlPath; - - private final String commonModelName; - - private final Map additionalProperties; - - private CreateFieldMappingRequest( - Optional excludeRemoteFieldMetadata, - String targetFieldName, - String targetFieldDescription, - List remoteFieldTraversalPath, - String remoteMethod, - String remoteUrlPath, - String commonModelName, - Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.targetFieldName = targetFieldName; - this.targetFieldDescription = targetFieldDescription; - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.commonModelName = commonModelName; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - /** - * @return The name of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_name") - public String getTargetFieldName() { - return targetFieldName; - } - - /** - * @return The description of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_description") - public String getTargetFieldDescription() { - return targetFieldDescription; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public List getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public String getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public String getRemoteUrlPath() { - return remoteUrlPath; - } - - /** - * @return The name of the Common Model that the remote field corresponds to in a given category. - */ - @JsonProperty("common_model_name") - public String getCommonModelName() { - return commonModelName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateFieldMappingRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) - && targetFieldName.equals(other.targetFieldName) - && targetFieldDescription.equals(other.targetFieldDescription) - && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.excludeRemoteFieldMetadata, - this.targetFieldName, - this.targetFieldDescription, - this.remoteFieldTraversalPath, - this.remoteMethod, - this.remoteUrlPath, - this.commonModelName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TargetFieldNameStage builder() { - return new Builder(); - } - - public interface TargetFieldNameStage { - TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); - - Builder from(CreateFieldMappingRequest other); - } - - public interface TargetFieldDescriptionStage { - RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); - } - - public interface RemoteMethodStage { - RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); - } - - public interface RemoteUrlPathStage { - CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); - } - - public interface CommonModelNameStage { - _FinalStage commonModelName(@NotNull String commonModelName); - } - - public interface _FinalStage { - CreateFieldMappingRequest build(); - - _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); - - _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); - - _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); - - _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); - - _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements TargetFieldNameStage, - TargetFieldDescriptionStage, - RemoteMethodStage, - RemoteUrlPathStage, - CommonModelNameStage, - _FinalStage { - private String targetFieldName; - - private String targetFieldDescription; - - private String remoteMethod; - - private String remoteUrlPath; - - private String commonModelName; - - private List remoteFieldTraversalPath = new ArrayList<>(); - - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateFieldMappingRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - targetFieldName(other.getTargetFieldName()); - targetFieldDescription(other.getTargetFieldDescription()); - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - commonModelName(other.getCommonModelName()); - return this; - } - - /** - *

The name of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_name") - public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { - this.targetFieldName = targetFieldName; - return this; - } - - /** - *

The description of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_description") - public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { - this.targetFieldDescription = targetFieldDescription; - return this; - } - - /** - *

The method of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_method") - public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - /** - *

The path of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_url_path") - public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - /** - *

The name of the Common Model that the remote field corresponds to in a given category.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("common_model_name") - public _FinalStage commonModelName(@NotNull String commonModelName) { - this.commonModelName = commonModelName; - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.clear(); - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - @java.lang.Override - public CreateFieldMappingRequest build() { - return new CreateFieldMappingRequest( - excludeRemoteFieldMetadata, - targetFieldName, - targetFieldDescription, - remoteFieldTraversalPath, - remoteMethod, - remoteUrlPath, - commonModelName, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/FieldMappingsRetrieveRequest.java deleted file mode 100644 index 6fbb1534d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/FieldMappingsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) -public final class FieldMappingsRetrieveRequest { - private final Optional excludeRemoteFieldMetadata; - - private final Map additionalProperties; - - private FieldMappingsRetrieveRequest( - Optional excludeRemoteFieldMetadata, Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingsRetrieveRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingsRetrieveRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - return this; - } - - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - public FieldMappingsRetrieveRequest build() { - return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/PatchedEditFieldMappingRequest.java deleted file mode 100644 index d998d02f7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/PatchedEditFieldMappingRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) -public final class PatchedEditFieldMappingRequest { - private final Optional> remoteFieldTraversalPath; - - private final Optional remoteMethod; - - private final Optional remoteUrlPath; - - private final Map additionalProperties; - - private PatchedEditFieldMappingRequest( - Optional> remoteFieldTraversalPath, - Optional remoteMethod, - Optional remoteUrlPath, - Map additionalProperties) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.additionalProperties = additionalProperties; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public Optional> getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public Optional getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public Optional getRemoteUrlPath() { - return remoteUrlPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> remoteFieldTraversalPath = Optional.empty(); - - private Optional remoteMethod = Optional.empty(); - - private Optional remoteUrlPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PatchedEditFieldMappingRequest other) { - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - return this; - } - - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - return this; - } - - public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); - return this; - } - - @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) - public Builder remoteMethod(Optional remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - public Builder remoteMethod(String remoteMethod) { - this.remoteMethod = Optional.ofNullable(remoteMethod); - return this; - } - - @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) - public Builder remoteUrlPath(Optional remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - public Builder remoteUrlPath(String remoteUrlPath) { - this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); - return this; - } - - public PatchedEditFieldMappingRequest build() { - return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/RemoteFieldsRetrieveRequest.java deleted file mode 100644 index e4dc53b9f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/fieldmapping/requests/RemoteFieldsRetrieveRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) -public final class RemoteFieldsRetrieveRequest { - private final Optional commonModels; - - private final Optional includeExampleValues; - - private final Map additionalProperties; - - private RemoteFieldsRetrieveRequest( - Optional commonModels, - Optional includeExampleValues, - Map additionalProperties) { - this.commonModels = commonModels; - this.includeExampleValues = includeExampleValues; - this.additionalProperties = additionalProperties; - } - - /** - * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. - */ - @JsonProperty("common_models") - public Optional getCommonModels() { - return commonModels; - } - - /** - * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. - */ - @JsonProperty("include_example_values") - public Optional getIncludeExampleValues() { - return includeExampleValues; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldsRetrieveRequest other) { - return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels, this.includeExampleValues); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional commonModels = Optional.empty(); - - private Optional includeExampleValues = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldsRetrieveRequest other) { - commonModels(other.getCommonModels()); - includeExampleValues(other.getIncludeExampleValues()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(Optional commonModels) { - this.commonModels = commonModels; - return this; - } - - public Builder commonModels(String commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) - public Builder includeExampleValues(Optional includeExampleValues) { - this.includeExampleValues = includeExampleValues; - return this; - } - - public Builder includeExampleValues(String includeExampleValues) { - this.includeExampleValues = Optional.ofNullable(includeExampleValues); - return this; - } - - public RemoteFieldsRetrieveRequest build() { - return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/forceresync/ForceResyncClient.java b/src/main/java/com/merge/api/resources/accounting/forceresync/ForceResyncClient.java deleted file mode 100644 index 303837539..000000000 --- a/src/main/java/com/merge/api/resources/accounting/forceresync/ForceResyncClient.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.forceresync; - -import com.fasterxml.jackson.core.type.TypeReference; -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.SyncStatus; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ForceResyncClient { - protected final ClientOptions clientOptions; - - public ForceResyncClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate() { - return syncStatusResyncCreate(null); - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/sync-status/resync") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/GeneralLedgerTransactionsClient.java b/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/GeneralLedgerTransactionsClient.java deleted file mode 100644 index 7a0d6560c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/GeneralLedgerTransactionsClient.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.generalledgertransactions; - -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.generalledgertransactions.requests.GeneralLedgerTransactionsListRequest; -import com.merge.api.resources.accounting.generalledgertransactions.requests.GeneralLedgerTransactionsRetrieveRequest; -import com.merge.api.resources.accounting.types.GeneralLedgerTransaction; -import com.merge.api.resources.accounting.types.PaginatedGeneralLedgerTransactionList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GeneralLedgerTransactionsClient { - protected final ClientOptions clientOptions; - - public GeneralLedgerTransactionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of GeneralLedgerTransaction objects. - */ - public PaginatedGeneralLedgerTransactionList list() { - return list(GeneralLedgerTransactionsListRequest.builder().build()); - } - - /** - * Returns a list of GeneralLedgerTransaction objects. - */ - public PaginatedGeneralLedgerTransactionList list(GeneralLedgerTransactionsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of GeneralLedgerTransaction objects. - */ - public PaginatedGeneralLedgerTransactionList list( - GeneralLedgerTransactionsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/general-ledger-transactions"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getPostedDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "posted_date_after", request.getPostedDateAfter().get().toString()); - } - if (request.getPostedDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "posted_date_before", request.getPostedDateBefore().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedGeneralLedgerTransactionList.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); - } - } - - /** - * Returns a GeneralLedgerTransaction object with the given id. - */ - public GeneralLedgerTransaction retrieve(String id) { - return retrieve(id, GeneralLedgerTransactionsRetrieveRequest.builder().build()); - } - - /** - * Returns a GeneralLedgerTransaction object with the given id. - */ - public GeneralLedgerTransaction retrieve(String id, GeneralLedgerTransactionsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a GeneralLedgerTransaction object with the given id. - */ - public GeneralLedgerTransaction retrieve( - String id, GeneralLedgerTransactionsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/general-ledger-transactions") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), GeneralLedgerTransaction.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsRetrieveRequest.java deleted file mode 100644 index f8f37c80c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/requests/GeneralLedgerTransactionsRetrieveRequest.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.generalledgertransactions.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.generalledgertransactions.types.GeneralLedgerTransactionsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GeneralLedgerTransactionsRetrieveRequest.Builder.class) -public final class GeneralLedgerTransactionsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private GeneralLedgerTransactionsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GeneralLedgerTransactionsRetrieveRequest - && equalTo((GeneralLedgerTransactionsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GeneralLedgerTransactionsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GeneralLedgerTransactionsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(GeneralLedgerTransactionsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public GeneralLedgerTransactionsRetrieveRequest build() { - return new GeneralLedgerTransactionsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsListRequestExpand.java deleted file mode 100644 index 593ca6407..000000000 --- a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsListRequestExpand.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.generalledgertransactions.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum GeneralLedgerTransactionsListRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - GENERAL_LEDGER_TRANSACTION_LINES("general_ledger_transaction_lines"), - - GENERAL_LEDGER_TRANSACTION_LINES_ACCOUNTING_PERIOD("general_ledger_transaction_lines,accounting_period"), - - GENERAL_LEDGER_TRANSACTION_LINES_COMPANY("general_ledger_transaction_lines,company"), - - GENERAL_LEDGER_TRANSACTION_LINES_COMPANY_ACCOUNTING_PERIOD( - "general_ledger_transaction_lines,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES("tracking_categories,general_ledger_transaction_lines"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES_ACCOUNTING_PERIOD( - "tracking_categories,general_ledger_transaction_lines,accounting_period"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES_COMPANY( - "tracking_categories,general_ledger_transaction_lines,company"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,general_ledger_transaction_lines,company,accounting_period"); - - private final String value; - - GeneralLedgerTransactionsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsRetrieveRequestExpand.java deleted file mode 100644 index 098e4392d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/generalledgertransactions/types/GeneralLedgerTransactionsRetrieveRequestExpand.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.generalledgertransactions.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum GeneralLedgerTransactionsRetrieveRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - GENERAL_LEDGER_TRANSACTION_LINES("general_ledger_transaction_lines"), - - GENERAL_LEDGER_TRANSACTION_LINES_ACCOUNTING_PERIOD("general_ledger_transaction_lines,accounting_period"), - - GENERAL_LEDGER_TRANSACTION_LINES_COMPANY("general_ledger_transaction_lines,company"), - - GENERAL_LEDGER_TRANSACTION_LINES_COMPANY_ACCOUNTING_PERIOD( - "general_ledger_transaction_lines,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES("tracking_categories,general_ledger_transaction_lines"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES_ACCOUNTING_PERIOD( - "tracking_categories,general_ledger_transaction_lines,accounting_period"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES_COMPANY( - "tracking_categories,general_ledger_transaction_lines,company"), - - TRACKING_CATEGORIES_GENERAL_LEDGER_TRANSACTION_LINES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,general_ledger_transaction_lines,company,accounting_period"); - - private final String value; - - GeneralLedgerTransactionsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/api/resources/accounting/generatekey/GenerateKeyClient.java deleted file mode 100644 index 22171e8a3..000000000 --- a/src/main/java/com/merge/api/resources/accounting/generatekey/GenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.generatekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.generatekey.requests.GenerateRemoteKeyRequest; -import com.merge.api.resources.accounting.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GenerateKeyClient { - protected final ClientOptions clientOptions; - - public GenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request) { - return create(request, null); - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/generate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/resources/accounting/generatekey/requests/GenerateRemoteKeyRequest.java deleted file mode 100644 index 7f7460bb1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/generatekey/requests/GenerateRemoteKeyRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.generatekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) -public final class GenerateRemoteKeyRequest { - private final String name; - - private final Map additionalProperties; - - private GenerateRemoteKeyRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GenerateRemoteKeyRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(GenerateRemoteKeyRequest other); - } - - public interface _FinalStage { - GenerateRemoteKeyRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GenerateRemoteKeyRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public GenerateRemoteKeyRequest build() { - return new GenerateRemoteKeyRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/incomestatements/IncomeStatementsClient.java b/src/main/java/com/merge/api/resources/accounting/incomestatements/IncomeStatementsClient.java deleted file mode 100644 index bb1c9005f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/incomestatements/IncomeStatementsClient.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.incomestatements; - -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.incomestatements.requests.IncomeStatementsListRequest; -import com.merge.api.resources.accounting.incomestatements.requests.IncomeStatementsRetrieveRequest; -import com.merge.api.resources.accounting.types.IncomeStatement; -import com.merge.api.resources.accounting.types.PaginatedIncomeStatementList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IncomeStatementsClient { - protected final ClientOptions clientOptions; - - public IncomeStatementsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of IncomeStatement objects. - */ - public PaginatedIncomeStatementList list() { - return list(IncomeStatementsListRequest.builder().build()); - } - - /** - * Returns a list of IncomeStatement objects. - */ - public PaginatedIncomeStatementList list(IncomeStatementsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of IncomeStatement objects. - */ - public PaginatedIncomeStatementList list(IncomeStatementsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/income-statements"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedIncomeStatementList.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); - } - } - - /** - * Returns an IncomeStatement object with the given id. - */ - public IncomeStatement retrieve(String id) { - return retrieve(id, IncomeStatementsRetrieveRequest.builder().build()); - } - - /** - * Returns an IncomeStatement object with the given id. - */ - public IncomeStatement retrieve(String id, IncomeStatementsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an IncomeStatement object with the given id. - */ - public IncomeStatement retrieve(String id, IncomeStatementsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/income-statements") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), IncomeStatement.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/incomestatements/requests/IncomeStatementsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/incomestatements/requests/IncomeStatementsRetrieveRequest.java deleted file mode 100644 index 89e5e0c10..000000000 --- a/src/main/java/com/merge/api/resources/accounting/incomestatements/requests/IncomeStatementsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.incomestatements.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IncomeStatementsRetrieveRequest.Builder.class) -public final class IncomeStatementsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private IncomeStatementsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IncomeStatementsRetrieveRequest && equalTo((IncomeStatementsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IncomeStatementsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(IncomeStatementsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public IncomeStatementsRetrieveRequest build() { - return new IncomeStatementsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/InvoicesClient.java b/src/main/java/com/merge/api/resources/accounting/invoices/InvoicesClient.java deleted file mode 100644 index 4149149b1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/invoices/InvoicesClient.java +++ /dev/null @@ -1,576 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.invoices; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.invoices.requests.InvoiceEndpointRequest; -import com.merge.api.resources.accounting.invoices.requests.InvoicesLineItemsRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.invoices.requests.InvoicesListRequest; -import com.merge.api.resources.accounting.invoices.requests.InvoicesRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.invoices.requests.InvoicesRetrieveRequest; -import com.merge.api.resources.accounting.invoices.requests.PatchedInvoiceEndpointRequest; -import com.merge.api.resources.accounting.types.Invoice; -import com.merge.api.resources.accounting.types.InvoiceResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedInvoiceList; -import com.merge.api.resources.accounting.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class InvoicesClient { - protected final ClientOptions clientOptions; - - public InvoicesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Invoice objects. - */ - public PaginatedInvoiceList list() { - return list(InvoicesListRequest.builder().build()); - } - - /** - * Returns a list of Invoice objects. - */ - public PaginatedInvoiceList list(InvoicesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Invoice objects. - */ - public PaginatedInvoiceList list(InvoicesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getContactId().isPresent()) { - httpUrl.addQueryParameter("contact_id", request.getContactId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIssueDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "issue_date_after", request.getIssueDateAfter().get().toString()); - } - if (request.getIssueDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "issue_date_before", request.getIssueDateBefore().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getNumber().isPresent()) { - httpUrl.addQueryParameter("number", request.getNumber().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - if (request.getType().isPresent()) { - httpUrl.addQueryParameter("type", request.getType().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedInvoiceList.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); - } - } - - /** - * Creates an Invoice object with the given values. - * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). - */ - public InvoiceResponse create(InvoiceEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Invoice object with the given values. - * Including a PurchaseOrder id in the purchase_orders property will generate an Accounts Payable Invoice from the specified Purchase Order(s). - */ - public InvoiceResponse create(InvoiceEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), InvoiceResponse.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); - } - } - - /** - * Returns an Invoice object with the given id. - */ - public Invoice retrieve(String id) { - return retrieve(id, InvoicesRetrieveRequest.builder().build()); - } - - /** - * Returns an Invoice object with the given id. - */ - public Invoice retrieve(String id, InvoicesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Invoice object with the given id. - */ - public Invoice retrieve(String id, InvoicesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Invoice.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); - } - } - - /** - * Updates an Invoice object with the given id. - */ - public InvoiceResponse partialUpdate(String id, PatchedInvoiceEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates an Invoice object with the given id. - */ - public InvoiceResponse partialUpdate( - String id, PatchedInvoiceEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), InvoiceResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList() { - return lineItemsRemoteFieldClassesList( - InvoicesLineItemsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList( - InvoicesLineItemsRemoteFieldClassesListRequest request) { - return lineItemsRemoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList( - InvoicesLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices/line-items/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } - - /** - * Returns metadata for Invoice PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for Invoice PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for Invoice POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Invoice POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - InvoicesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(InvoicesRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - InvoicesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/invoices/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestExpand.java deleted file mode 100644 index 45eb70f22..000000000 --- a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesListRequestExpand.java +++ /dev/null @@ -1,5778 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.invoices.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InvoicesListRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_CREDIT_NOTES("applied_credit_notes"), - - APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("applied_credit_notes,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS("applied_credit_notes,applied_vendor_credits"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY("applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT("applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE("applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_COMPANY("applied_credit_notes,company"), - - APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD("applied_credit_notes,company,accounting_period"), - - APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("applied_credit_notes,company,employee"), - - APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("applied_credit_notes,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT("applied_credit_notes,contact"), - - APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD("applied_credit_notes,contact,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY("applied_credit_notes,contact,company"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_credit_notes,contact,company,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE("applied_credit_notes,contact,company,employee"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("applied_credit_notes,contact,employee"), - - APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_EMPLOYEE("applied_credit_notes,employee"), - - APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD("applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS("applied_payments"), - - APPLIED_PAYMENTS_ACCOUNTING_PERIOD("applied_payments,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES("applied_payments,applied_credit_notes"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("applied_payments,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY("applied_payments,applied_credit_notes,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("applied_payments,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT("applied_payments,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("applied_payments,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("applied_payments,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE("applied_payments,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS("applied_payments,applied_vendor_credits"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY("applied_payments,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT("applied_payments,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("applied_payments,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE("applied_payments,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_COMPANY("applied_payments,company"), - - APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("applied_payments,company,accounting_period"), - - APPLIED_PAYMENTS_COMPANY_EMPLOYEE("applied_payments,company,employee"), - - APPLIED_PAYMENTS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,company,employee,accounting_period"), - - APPLIED_PAYMENTS_CONTACT("applied_payments,contact"), - - APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("applied_payments,contact,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_COMPANY("applied_payments,contact,company"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_payments,contact,company,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE("applied_payments,contact,company,employee"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_EMPLOYEE("applied_payments,contact,employee"), - - APPLIED_PAYMENTS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_EMPLOYEE("applied_payments,employee"), - - APPLIED_PAYMENTS_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS("applied_payments,line_items"), - - APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("applied_payments,line_items,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES("applied_payments,line_items,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS("applied_payments,line_items,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("applied_payments,line_items,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("applied_payments,line_items,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE("applied_payments,line_items,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("applied_payments,line_items,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("applied_payments,line_items,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("applied_payments,line_items,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE("applied_payments,line_items,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE("applied_payments,line_items,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE("applied_payments,line_items,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,line_items,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS("applied_payments,line_items,purchase_orders"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "applied_payments,line_items,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY("applied_payments,line_items,purchase_orders,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT("applied_payments,line_items,purchase_orders,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE("applied_payments,line_items,purchase_orders,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("applied_payments,line_items,tracking_categories"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "applied_payments,line_items,tracking_categories,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("applied_payments,line_items,tracking_categories,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("applied_payments,line_items,tracking_categories,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE( - "applied_payments,line_items,tracking_categories,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS( - "applied_payments,line_items,tracking_categories,purchase_orders"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS("applied_payments,purchase_orders"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("applied_payments,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("applied_payments,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("applied_payments,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY("applied_payments,purchase_orders,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("applied_payments,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT("applied_payments,purchase_orders,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY("applied_payments,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("applied_payments,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE("applied_payments,purchase_orders,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES("applied_payments,tracking_categories"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("applied_payments,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "applied_payments,tracking_categories,applied_credit_notes"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,tracking_categories,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("applied_payments,tracking_categories,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE("applied_payments,tracking_categories,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("applied_payments,tracking_categories,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("applied_payments,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE("applied_payments,tracking_categories,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE("applied_payments,tracking_categories,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS("applied_payments,tracking_categories,purchase_orders"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "applied_payments,tracking_categories,purchase_orders,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "applied_payments,tracking_categories,purchase_orders,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS("applied_vendor_credits"), - - APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD("applied_vendor_credits,accounting_period"), - - APPLIED_VENDOR_CREDITS_COMPANY("applied_vendor_credits,company"), - - APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD("applied_vendor_credits,company,accounting_period"), - - APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("applied_vendor_credits,company,employee"), - - APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT("applied_vendor_credits,contact"), - - APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD("applied_vendor_credits,contact,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("applied_vendor_credits,contact,company"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE("applied_vendor_credits,contact,company,employee"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("applied_vendor_credits,contact,employee"), - - APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS_EMPLOYEE("applied_vendor_credits,employee"), - - APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD("applied_vendor_credits,employee,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - COMPANY_EMPLOYEE("company,employee"), - - COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("company,employee,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - CONTACT_COMPANY_EMPLOYEE("contact,company,employee"), - - CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("contact,company,employee,accounting_period"), - - CONTACT_EMPLOYEE("contact,employee"), - - CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("contact,employee,accounting_period"), - - EMPLOYEE("employee"), - - EMPLOYEE_ACCOUNTING_PERIOD("employee,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES("line_items,applied_credit_notes"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("line_items,applied_credit_notes,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS("line_items,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY("line_items,applied_credit_notes,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("line_items,applied_credit_notes,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT("line_items,applied_credit_notes,contact"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("line_items,applied_credit_notes,contact,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("line_items,applied_credit_notes,contact,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE("line_items,applied_credit_notes,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS("line_items,applied_vendor_credits"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD("line_items,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY("line_items,applied_vendor_credits,company"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("line_items,applied_vendor_credits,company,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT("line_items,applied_vendor_credits,contact"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("line_items,applied_vendor_credits,contact,company"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("line_items,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE("line_items,applied_vendor_credits,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_COMPANY("line_items,company"), - - LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("line_items,company,accounting_period"), - - LINE_ITEMS_COMPANY_EMPLOYEE("line_items,company,employee"), - - LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("line_items,company,employee,accounting_period"), - - LINE_ITEMS_CONTACT("line_items,contact"), - - LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("line_items,contact,accounting_period"), - - LINE_ITEMS_CONTACT_COMPANY("line_items,contact,company"), - - LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("line_items,contact,company,accounting_period"), - - LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE("line_items,contact,company,employee"), - - LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("line_items,contact,company,employee,accounting_period"), - - LINE_ITEMS_CONTACT_EMPLOYEE("line_items,contact,employee"), - - LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("line_items,contact,employee,accounting_period"), - - LINE_ITEMS_EMPLOYEE("line_items,employee"), - - LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD("line_items,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS("line_items,purchase_orders"), - - LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("line_items,purchase_orders,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("line_items,purchase_orders,applied_credit_notes"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY("line_items,purchase_orders,applied_credit_notes,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT("line_items,purchase_orders,applied_credit_notes,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "line_items,purchase_orders,applied_credit_notes,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("line_items,purchase_orders,applied_vendor_credits"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,purchase_orders,applied_vendor_credits,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,purchase_orders,applied_vendor_credits,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,purchase_orders,applied_vendor_credits,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY("line_items,purchase_orders,company"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD("line_items,purchase_orders,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("line_items,purchase_orders,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT("line_items,purchase_orders,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD("line_items,purchase_orders,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY("line_items,purchase_orders,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE("line_items,purchase_orders,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("line_items,purchase_orders,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE("line_items,purchase_orders,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD("line_items,purchase_orders,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES("line_items,tracking_categories,applied_credit_notes"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "line_items,tracking_categories,applied_credit_notes,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "line_items,tracking_categories,applied_credit_notes,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "line_items,tracking_categories,applied_credit_notes,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS("line_items,tracking_categories,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("line_items,tracking_categories,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE("line_items,tracking_categories,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("line_items,tracking_categories,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("line_items,tracking_categories,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("line_items,tracking_categories,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE("line_items,tracking_categories,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE("line_items,tracking_categories,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS("line_items,tracking_categories,purchase_orders"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY("line_items,tracking_categories,purchase_orders,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT("line_items,tracking_categories,purchase_orders,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE("line_items,tracking_categories,purchase_orders,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS("payments"), - - PAYMENTS_ACCOUNTING_PERIOD("payments,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES("payments,applied_credit_notes"), - - PAYMENTS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("payments,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS("payments,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY("payments,applied_credit_notes,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD("payments,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("payments,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT("payments,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD("payments,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("payments,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE("payments,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("payments,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS("payments,applied_payments"), - - PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("payments,applied_payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES("payments,applied_payments,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY("payments,applied_payments,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT("payments,applied_payments,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,applied_payments,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS("payments,applied_payments,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY("payments,applied_payments,company"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,applied_payments,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_EMPLOYEE("payments,applied_payments,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT("payments,applied_payments,contact"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,applied_payments,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY("payments,applied_payments,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE("payments,applied_payments,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_EMPLOYEE("payments,applied_payments,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_EMPLOYEE("payments,applied_payments,employee"), - - PAYMENTS_APPLIED_PAYMENTS_EMPLOYEE_ACCOUNTING_PERIOD("payments,applied_payments,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS("payments,applied_payments,line_items"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,applied_payments,line_items,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("payments,applied_payments,line_items,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE("payments,applied_payments,line_items,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("payments,applied_payments,line_items,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,applied_payments,line_items,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE("payments,applied_payments,line_items,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE("payments,applied_payments,line_items,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS("payments,applied_payments,line_items,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY( - "payments,applied_payments,line_items,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT( - "payments,applied_payments,line_items,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES( - "payments,applied_payments,line_items,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS( - "payments,applied_payments,line_items,tracking_categories,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS("payments,applied_payments,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY("payments,applied_payments,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT("payments,applied_payments,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE("payments,applied_payments,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("payments,applied_payments,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "payments,applied_payments,tracking_categories,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,applied_payments,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,applied_payments,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE("payments,applied_payments,tracking_categories,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS( - "payments,applied_payments,tracking_categories,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS("payments,applied_vendor_credits"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD("payments,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY("payments,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("payments,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT("payments,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("payments,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("payments,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE("payments,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_COMPANY("payments,company"), - - PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,company,accounting_period"), - - PAYMENTS_COMPANY_EMPLOYEE("payments,company,employee"), - - PAYMENTS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("payments,company,employee,accounting_period"), - - PAYMENTS_CONTACT("payments,contact"), - - PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,contact,accounting_period"), - - PAYMENTS_CONTACT_COMPANY("payments,contact,company"), - - PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,contact,company,accounting_period"), - - PAYMENTS_CONTACT_COMPANY_EMPLOYEE("payments,contact,company,employee"), - - PAYMENTS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("payments,contact,company,employee,accounting_period"), - - PAYMENTS_CONTACT_EMPLOYEE("payments,contact,employee"), - - PAYMENTS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("payments,contact,employee,accounting_period"), - - PAYMENTS_EMPLOYEE("payments,employee"), - - PAYMENTS_EMPLOYEE_ACCOUNTING_PERIOD("payments,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS("payments,line_items"), - - PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,line_items,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES("payments,line_items,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY("payments,line_items,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT("payments,line_items,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,line_items,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS("payments,line_items,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY("payments,line_items,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT("payments,line_items,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE("payments,line_items,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_COMPANY("payments,line_items,company"), - - PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("payments,line_items,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE("payments,line_items,company,employee"), - - PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("payments,line_items,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT("payments,line_items,contact"), - - PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("payments,line_items,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,line_items,contact,company"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,line_items,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE("payments,line_items,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE("payments,line_items,contact,employee"), - - PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("payments,line_items,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_EMPLOYEE("payments,line_items,employee"), - - PAYMENTS_LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD("payments,line_items,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS("payments,line_items,purchase_orders"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("payments,line_items,purchase_orders,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,line_items,purchase_orders,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,line_items,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,line_items,purchase_orders,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY("payments,line_items,purchase_orders,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("payments,line_items,purchase_orders,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT("payments,line_items,purchase_orders,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY("payments,line_items,purchase_orders,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("payments,line_items,purchase_orders,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE("payments,line_items,purchase_orders,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("payments,line_items,tracking_categories"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "payments,line_items,tracking_categories,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,line_items,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("payments,line_items,tracking_categories,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("payments,line_items,tracking_categories,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE("payments,line_items,tracking_categories,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS("payments,line_items,tracking_categories,purchase_orders"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS("payments,purchase_orders"), - - PAYMENTS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("payments,purchase_orders,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("payments,purchase_orders,applied_credit_notes"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY("payments,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT("payments,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("payments,purchase_orders,applied_vendor_credits"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY("payments,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT("payments,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY("payments,purchase_orders,company"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD("payments,purchase_orders,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("payments,purchase_orders,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT("payments,purchase_orders,contact"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD("payments,purchase_orders,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY("payments,purchase_orders,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE("payments,purchase_orders,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("payments,purchase_orders,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_EMPLOYEE("payments,purchase_orders,employee"), - - PAYMENTS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD("payments,purchase_orders,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES("payments,tracking_categories"), - - PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("payments,tracking_categories,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES("payments,tracking_categories,applied_credit_notes"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS("payments,tracking_categories,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,tracking_categories,company"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("payments,tracking_categories,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE("payments,tracking_categories,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,tracking_categories,contact"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,tracking_categories,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("payments,tracking_categories,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE("payments,tracking_categories,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE("payments,tracking_categories,employee"), - - PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD("payments,tracking_categories,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS("payments,tracking_categories,purchase_orders"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY("payments,tracking_categories,purchase_orders,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT("payments,tracking_categories,purchase_orders,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE("payments,tracking_categories,purchase_orders,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,employee,accounting_period"), - - PURCHASE_ORDERS("purchase_orders"), - - PURCHASE_ORDERS_ACCOUNTING_PERIOD("purchase_orders,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("purchase_orders,applied_credit_notes"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("purchase_orders,applied_credit_notes,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY("purchase_orders,applied_credit_notes,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("purchase_orders,applied_credit_notes,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT("purchase_orders,applied_credit_notes,contact"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("purchase_orders,applied_credit_notes,contact,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "purchase_orders,applied_credit_notes,contact,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("purchase_orders,applied_credit_notes,contact,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE("purchase_orders,applied_credit_notes,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("purchase_orders,applied_vendor_credits"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY("purchase_orders,applied_vendor_credits,company"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("purchase_orders,applied_vendor_credits,company,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT("purchase_orders,applied_vendor_credits,contact"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("purchase_orders,applied_vendor_credits,contact,company"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "purchase_orders,applied_vendor_credits,contact,company,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("purchase_orders,applied_vendor_credits,contact,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE("purchase_orders,applied_vendor_credits,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PURCHASE_ORDERS_COMPANY("purchase_orders,company"), - - PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD("purchase_orders,company,accounting_period"), - - PURCHASE_ORDERS_COMPANY_EMPLOYEE("purchase_orders,company,employee"), - - PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("purchase_orders,company,employee,accounting_period"), - - PURCHASE_ORDERS_CONTACT("purchase_orders,contact"), - - PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD("purchase_orders,contact,accounting_period"), - - PURCHASE_ORDERS_CONTACT_COMPANY("purchase_orders,contact,company"), - - PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD("purchase_orders,contact,company,accounting_period"), - - PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE("purchase_orders,contact,company,employee"), - - PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_CONTACT_EMPLOYEE("purchase_orders,contact,employee"), - - PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("purchase_orders,contact,employee,accounting_period"), - - PURCHASE_ORDERS_EMPLOYEE("purchase_orders,employee"), - - PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD("purchase_orders,employee,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES("tracking_categories,applied_credit_notes"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "tracking_categories,applied_credit_notes,applied_vendor_credits"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY("tracking_categories,applied_credit_notes,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT("tracking_categories,applied_credit_notes,contact"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "tracking_categories,applied_credit_notes,contact,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,contact,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "tracking_categories,applied_credit_notes,contact,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE("tracking_categories,applied_credit_notes,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS("tracking_categories,applied_vendor_credits"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY("tracking_categories,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT("tracking_categories,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE("tracking_categories,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE("tracking_categories,company,employee"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("tracking_categories,contact,company,employee"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE("tracking_categories,contact,employee"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_EMPLOYEE("tracking_categories,employee"), - - TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS("tracking_categories,purchase_orders"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD("tracking_categories,purchase_orders,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "tracking_categories,purchase_orders,applied_credit_notes"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "tracking_categories,purchase_orders,applied_credit_notes,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "tracking_categories,purchase_orders,applied_vendor_credits"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "tracking_categories,purchase_orders,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY("tracking_categories,purchase_orders,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE("tracking_categories,purchase_orders,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT("tracking_categories,purchase_orders,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY("tracking_categories,purchase_orders,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE("tracking_categories,purchase_orders,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE("tracking_categories,purchase_orders,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,employee,accounting_period"); - - private final String value; - - InvoicesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesRetrieveRequestExpand.java deleted file mode 100644 index 58f4bde4c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/invoices/types/InvoicesRetrieveRequestExpand.java +++ /dev/null @@ -1,5778 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.invoices.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InvoicesRetrieveRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_CREDIT_NOTES("applied_credit_notes"), - - APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("applied_credit_notes,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS("applied_credit_notes,applied_vendor_credits"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY("applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT("applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE("applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_COMPANY("applied_credit_notes,company"), - - APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD("applied_credit_notes,company,accounting_period"), - - APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("applied_credit_notes,company,employee"), - - APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("applied_credit_notes,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT("applied_credit_notes,contact"), - - APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD("applied_credit_notes,contact,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY("applied_credit_notes,contact,company"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_credit_notes,contact,company,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE("applied_credit_notes,contact,company,employee"), - - APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("applied_credit_notes,contact,employee"), - - APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_CREDIT_NOTES_EMPLOYEE("applied_credit_notes,employee"), - - APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD("applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS("applied_payments"), - - APPLIED_PAYMENTS_ACCOUNTING_PERIOD("applied_payments,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES("applied_payments,applied_credit_notes"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("applied_payments,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY("applied_payments,applied_credit_notes,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("applied_payments,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT("applied_payments,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("applied_payments,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("applied_payments,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE("applied_payments,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS("applied_payments,applied_vendor_credits"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY("applied_payments,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT("applied_payments,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("applied_payments,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE("applied_payments,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_COMPANY("applied_payments,company"), - - APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("applied_payments,company,accounting_period"), - - APPLIED_PAYMENTS_COMPANY_EMPLOYEE("applied_payments,company,employee"), - - APPLIED_PAYMENTS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,company,employee,accounting_period"), - - APPLIED_PAYMENTS_CONTACT("applied_payments,contact"), - - APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("applied_payments,contact,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_COMPANY("applied_payments,contact,company"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_payments,contact,company,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE("applied_payments,contact,company,employee"), - - APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_CONTACT_EMPLOYEE("applied_payments,contact,employee"), - - APPLIED_PAYMENTS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_EMPLOYEE("applied_payments,employee"), - - APPLIED_PAYMENTS_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS("applied_payments,line_items"), - - APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("applied_payments,line_items,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES("applied_payments,line_items,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS("applied_payments,line_items,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("applied_payments,line_items,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("applied_payments,line_items,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE("applied_payments,line_items,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("applied_payments,line_items,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("applied_payments,line_items,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("applied_payments,line_items,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE("applied_payments,line_items,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE("applied_payments,line_items,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE("applied_payments,line_items,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD("applied_payments,line_items,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS("applied_payments,line_items,purchase_orders"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "applied_payments,line_items,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY("applied_payments,line_items,purchase_orders,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT("applied_payments,line_items,purchase_orders,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY( - "applied_payments,line_items,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "applied_payments,line_items,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE("applied_payments,line_items,purchase_orders,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,purchase_orders,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("applied_payments,line_items,tracking_categories"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "applied_payments,line_items,tracking_categories,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("applied_payments,line_items,tracking_categories,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("applied_payments,line_items,tracking_categories,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE( - "applied_payments,line_items,tracking_categories,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS( - "applied_payments,line_items,tracking_categories,purchase_orders"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "applied_payments,line_items,tracking_categories,purchase_orders,contact"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "applied_payments,line_items,tracking_categories,purchase_orders,employee"), - - APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS("applied_payments,purchase_orders"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("applied_payments,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("applied_payments,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("applied_payments,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY("applied_payments,purchase_orders,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("applied_payments,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT("applied_payments,purchase_orders,contact"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY("applied_payments,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("applied_payments,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE("applied_payments,purchase_orders,employee"), - - APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,purchase_orders,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES("applied_payments,tracking_categories"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("applied_payments,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "applied_payments,tracking_categories,applied_credit_notes"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,tracking_categories,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,tracking_categories,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,tracking_categories,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("applied_payments,tracking_categories,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE("applied_payments,tracking_categories,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("applied_payments,tracking_categories,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("applied_payments,tracking_categories,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE("applied_payments,tracking_categories,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE("applied_payments,tracking_categories,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS("applied_payments,tracking_categories,purchase_orders"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "applied_payments,tracking_categories,purchase_orders,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "applied_payments,tracking_categories,purchase_orders,contact"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "applied_payments,tracking_categories,purchase_orders,contact,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,contact,company,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,contact,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "applied_payments,tracking_categories,purchase_orders,employee"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,purchase_orders,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS("applied_vendor_credits"), - - APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD("applied_vendor_credits,accounting_period"), - - APPLIED_VENDOR_CREDITS_COMPANY("applied_vendor_credits,company"), - - APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD("applied_vendor_credits,company,accounting_period"), - - APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("applied_vendor_credits,company,employee"), - - APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_vendor_credits,company,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT("applied_vendor_credits,contact"), - - APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD("applied_vendor_credits,contact,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("applied_vendor_credits,contact,company"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "applied_vendor_credits,contact,company,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE("applied_vendor_credits,contact,company,employee"), - - APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_vendor_credits,contact,company,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("applied_vendor_credits,contact,employee"), - - APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "applied_vendor_credits,contact,employee,accounting_period"), - - APPLIED_VENDOR_CREDITS_EMPLOYEE("applied_vendor_credits,employee"), - - APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD("applied_vendor_credits,employee,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - COMPANY_EMPLOYEE("company,employee"), - - COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("company,employee,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - CONTACT_COMPANY_EMPLOYEE("contact,company,employee"), - - CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("contact,company,employee,accounting_period"), - - CONTACT_EMPLOYEE("contact,employee"), - - CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("contact,employee,accounting_period"), - - EMPLOYEE("employee"), - - EMPLOYEE_ACCOUNTING_PERIOD("employee,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES("line_items,applied_credit_notes"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("line_items,applied_credit_notes,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS("line_items,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY("line_items,applied_credit_notes,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("line_items,applied_credit_notes,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT("line_items,applied_credit_notes,contact"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("line_items,applied_credit_notes,contact,company"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("line_items,applied_credit_notes,contact,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE("line_items,applied_credit_notes,employee"), - - LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS("line_items,applied_vendor_credits"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD("line_items,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY("line_items,applied_vendor_credits,company"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("line_items,applied_vendor_credits,company,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT("line_items,applied_vendor_credits,contact"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("line_items,applied_vendor_credits,contact,company"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("line_items,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE("line_items,applied_vendor_credits,employee"), - - LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_COMPANY("line_items,company"), - - LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("line_items,company,accounting_period"), - - LINE_ITEMS_COMPANY_EMPLOYEE("line_items,company,employee"), - - LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("line_items,company,employee,accounting_period"), - - LINE_ITEMS_CONTACT("line_items,contact"), - - LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("line_items,contact,accounting_period"), - - LINE_ITEMS_CONTACT_COMPANY("line_items,contact,company"), - - LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("line_items,contact,company,accounting_period"), - - LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE("line_items,contact,company,employee"), - - LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("line_items,contact,company,employee,accounting_period"), - - LINE_ITEMS_CONTACT_EMPLOYEE("line_items,contact,employee"), - - LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("line_items,contact,employee,accounting_period"), - - LINE_ITEMS_EMPLOYEE("line_items,employee"), - - LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD("line_items,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS("line_items,purchase_orders"), - - LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("line_items,purchase_orders,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("line_items,purchase_orders,applied_credit_notes"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY("line_items,purchase_orders,applied_credit_notes,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT("line_items,purchase_orders,applied_credit_notes,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "line_items,purchase_orders,applied_credit_notes,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "line_items,purchase_orders,applied_credit_notes,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("line_items,purchase_orders,applied_vendor_credits"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,purchase_orders,applied_vendor_credits,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,purchase_orders,applied_vendor_credits,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,purchase_orders,applied_vendor_credits,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,purchase_orders,applied_vendor_credits,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY("line_items,purchase_orders,company"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD("line_items,purchase_orders,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("line_items,purchase_orders,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT("line_items,purchase_orders,contact"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD("line_items,purchase_orders,contact,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY("line_items,purchase_orders,contact,company"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,purchase_orders,contact,company,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE("line_items,purchase_orders,contact,company,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,contact,company,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("line_items,purchase_orders,contact,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,purchase_orders,contact,employee,accounting_period"), - - LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE("line_items,purchase_orders,employee"), - - LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD("line_items,purchase_orders,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES("line_items,tracking_categories,applied_credit_notes"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "line_items,tracking_categories,applied_credit_notes,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "line_items,tracking_categories,applied_credit_notes,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "line_items,tracking_categories,applied_credit_notes,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "line_items,tracking_categories,applied_credit_notes,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS("line_items,tracking_categories,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("line_items,tracking_categories,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE("line_items,tracking_categories,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("line_items,tracking_categories,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("line_items,tracking_categories,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("line_items,tracking_categories,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE("line_items,tracking_categories,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE("line_items,tracking_categories,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS("line_items,tracking_categories,purchase_orders"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY("line_items,tracking_categories,purchase_orders,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT("line_items,tracking_categories,purchase_orders,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "line_items,tracking_categories,purchase_orders,contact,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,contact,company,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "line_items,tracking_categories,purchase_orders,contact,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE("line_items,tracking_categories,purchase_orders,employee"), - - LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS("payments"), - - PAYMENTS_ACCOUNTING_PERIOD("payments,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES("payments,applied_credit_notes"), - - PAYMENTS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("payments,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS("payments,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY("payments,applied_credit_notes,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD("payments,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("payments,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT("payments,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD("payments,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("payments,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE("payments,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("payments,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS("payments,applied_payments"), - - PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("payments,applied_payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES("payments,applied_payments,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY("payments,applied_payments,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT("payments,applied_payments,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,applied_payments,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS("payments,applied_payments,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY("payments,applied_payments,company"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,applied_payments,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_EMPLOYEE("payments,applied_payments,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT("payments,applied_payments,contact"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,applied_payments,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY("payments,applied_payments,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE("payments,applied_payments,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_EMPLOYEE("payments,applied_payments,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_EMPLOYEE("payments,applied_payments,employee"), - - PAYMENTS_APPLIED_PAYMENTS_EMPLOYEE_ACCOUNTING_PERIOD("payments,applied_payments,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS("payments,applied_payments,line_items"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,applied_payments,line_items,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY("payments,applied_payments,line_items,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE("payments,applied_payments,line_items,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT("payments,applied_payments,line_items,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,applied_payments,line_items,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE("payments,applied_payments,line_items,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE("payments,applied_payments,line_items,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS("payments,applied_payments,line_items,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY( - "payments,applied_payments,line_items,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT( - "payments,applied_payments,line_items,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,line_items,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE( - "payments,applied_payments,line_items,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES( - "payments,applied_payments,line_items,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS( - "payments,applied_payments,line_items,tracking_categories,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS("payments,applied_payments,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY("payments,applied_payments,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT("payments,applied_payments,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE("payments,applied_payments,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("payments,applied_payments,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "payments,applied_payments,tracking_categories,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,applied_payments,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,applied_payments,tracking_categories,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE("payments,applied_payments,tracking_categories,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS( - "payments,applied_payments,tracking_categories,purchase_orders"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "payments,applied_payments,tracking_categories,purchase_orders,contact"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "payments,applied_payments,tracking_categories,purchase_orders,employee"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS("payments,applied_vendor_credits"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD("payments,applied_vendor_credits,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY("payments,applied_vendor_credits,company"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("payments,applied_vendor_credits,company,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT("payments,applied_vendor_credits,contact"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("payments,applied_vendor_credits,contact,company"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("payments,applied_vendor_credits,contact,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE("payments,applied_vendor_credits,employee"), - - PAYMENTS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_COMPANY("payments,company"), - - PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,company,accounting_period"), - - PAYMENTS_COMPANY_EMPLOYEE("payments,company,employee"), - - PAYMENTS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("payments,company,employee,accounting_period"), - - PAYMENTS_CONTACT("payments,contact"), - - PAYMENTS_CONTACT_ACCOUNTING_PERIOD("payments,contact,accounting_period"), - - PAYMENTS_CONTACT_COMPANY("payments,contact,company"), - - PAYMENTS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,contact,company,accounting_period"), - - PAYMENTS_CONTACT_COMPANY_EMPLOYEE("payments,contact,company,employee"), - - PAYMENTS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("payments,contact,company,employee,accounting_period"), - - PAYMENTS_CONTACT_EMPLOYEE("payments,contact,employee"), - - PAYMENTS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("payments,contact,employee,accounting_period"), - - PAYMENTS_EMPLOYEE("payments,employee"), - - PAYMENTS_EMPLOYEE_ACCOUNTING_PERIOD("payments,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS("payments,line_items"), - - PAYMENTS_LINE_ITEMS_ACCOUNTING_PERIOD("payments,line_items,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES("payments,line_items,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY("payments,line_items,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT("payments,line_items,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,line_items,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS("payments,line_items,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY("payments,line_items,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT("payments,line_items,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE("payments,line_items,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_COMPANY("payments,line_items,company"), - - PAYMENTS_LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("payments,line_items,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE("payments,line_items,company,employee"), - - PAYMENTS_LINE_ITEMS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("payments,line_items,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT("payments,line_items,contact"), - - PAYMENTS_LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("payments,line_items,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY("payments,line_items,contact,company"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_ACCOUNTING_PERIOD("payments,line_items,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE("payments,line_items,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE("payments,line_items,contact,employee"), - - PAYMENTS_LINE_ITEMS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("payments,line_items,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_EMPLOYEE("payments,line_items,employee"), - - PAYMENTS_LINE_ITEMS_EMPLOYEE_ACCOUNTING_PERIOD("payments,line_items,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS("payments,line_items,purchase_orders"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("payments,line_items,purchase_orders,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,line_items,purchase_orders,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,line_items,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,line_items,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,line_items,purchase_orders,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY("payments,line_items,purchase_orders,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("payments,line_items,purchase_orders,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT("payments,line_items,purchase_orders,contact"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY("payments,line_items,purchase_orders,contact,company"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,purchase_orders,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("payments,line_items,purchase_orders,contact,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE("payments,line_items,purchase_orders,employee"), - - PAYMENTS_LINE_ITEMS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,purchase_orders,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES("payments,line_items,tracking_categories"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES( - "payments,line_items,tracking_categories,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,line_items,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,line_items,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("payments,line_items,tracking_categories,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("payments,line_items,tracking_categories,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,line_items,tracking_categories,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE("payments,line_items,tracking_categories,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS("payments,line_items,tracking_categories,purchase_orders"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT( - "payments,line_items,tracking_categories,purchase_orders,contact"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,line_items,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE( - "payments,line_items,tracking_categories,purchase_orders,employee"), - - PAYMENTS_LINE_ITEMS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,line_items,tracking_categories,purchase_orders,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS("payments,purchase_orders"), - - PAYMENTS_PURCHASE_ORDERS_ACCOUNTING_PERIOD("payments,purchase_orders,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("payments,purchase_orders,applied_credit_notes"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY("payments,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT("payments,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE("payments,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("payments,purchase_orders,applied_vendor_credits"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY("payments,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT("payments,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY("payments,purchase_orders,company"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD("payments,purchase_orders,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE("payments,purchase_orders,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT("payments,purchase_orders,contact"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD("payments,purchase_orders,contact,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY("payments,purchase_orders,contact,company"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE("payments,purchase_orders,contact,company,employee"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE("payments,purchase_orders,contact,employee"), - - PAYMENTS_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_PURCHASE_ORDERS_EMPLOYEE("payments,purchase_orders,employee"), - - PAYMENTS_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD("payments,purchase_orders,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES("payments,tracking_categories"), - - PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("payments,tracking_categories,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES("payments,tracking_categories,applied_credit_notes"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY( - "payments,tracking_categories,applied_credit_notes,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT( - "payments,tracking_categories,applied_credit_notes,contact"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,tracking_categories,applied_credit_notes,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,tracking_categories,applied_credit_notes,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS("payments,tracking_categories,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,tracking_categories,company"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("payments,tracking_categories,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE("payments,tracking_categories,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT("payments,tracking_categories,contact"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("payments,tracking_categories,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY("payments,tracking_categories,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("payments,tracking_categories,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE("payments,tracking_categories,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE("payments,tracking_categories,employee"), - - PAYMENTS_TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD("payments,tracking_categories,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS("payments,tracking_categories,purchase_orders"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "payments,tracking_categories,purchase_orders,applied_credit_notes"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_credit_notes,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "payments,tracking_categories,purchase_orders,applied_vendor_credits"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY("payments,tracking_categories,purchase_orders,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT("payments,tracking_categories,purchase_orders,contact"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY( - "payments,tracking_categories,purchase_orders,contact,company"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "payments,tracking_categories,purchase_orders,contact,company,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE( - "payments,tracking_categories,purchase_orders,contact,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,contact,employee,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE("payments,tracking_categories,purchase_orders,employee"), - - PAYMENTS_TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "payments,tracking_categories,purchase_orders,employee,accounting_period"), - - PURCHASE_ORDERS("purchase_orders"), - - PURCHASE_ORDERS_ACCOUNTING_PERIOD("purchase_orders,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES("purchase_orders,applied_credit_notes"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD("purchase_orders,applied_credit_notes,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "purchase_orders,applied_credit_notes,applied_vendor_credits"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY("purchase_orders,applied_credit_notes,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE("purchase_orders,applied_credit_notes,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT("purchase_orders,applied_credit_notes,contact"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY("purchase_orders,applied_credit_notes,contact,company"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "purchase_orders,applied_credit_notes,contact,company,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE("purchase_orders,applied_credit_notes,contact,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE("purchase_orders,applied_credit_notes,employee"), - - PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_credit_notes,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS("purchase_orders,applied_vendor_credits"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY("purchase_orders,applied_vendor_credits,company"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE("purchase_orders,applied_vendor_credits,company,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT("purchase_orders,applied_vendor_credits,contact"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY("purchase_orders,applied_vendor_credits,contact,company"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "purchase_orders,applied_vendor_credits,contact,company,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE("purchase_orders,applied_vendor_credits,contact,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE("purchase_orders,applied_vendor_credits,employee"), - - PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,applied_vendor_credits,employee,accounting_period"), - - PURCHASE_ORDERS_COMPANY("purchase_orders,company"), - - PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD("purchase_orders,company,accounting_period"), - - PURCHASE_ORDERS_COMPANY_EMPLOYEE("purchase_orders,company,employee"), - - PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("purchase_orders,company,employee,accounting_period"), - - PURCHASE_ORDERS_CONTACT("purchase_orders,contact"), - - PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD("purchase_orders,contact,accounting_period"), - - PURCHASE_ORDERS_CONTACT_COMPANY("purchase_orders,contact,company"), - - PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD("purchase_orders,contact,company,accounting_period"), - - PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE("purchase_orders,contact,company,employee"), - - PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "purchase_orders,contact,company,employee,accounting_period"), - - PURCHASE_ORDERS_CONTACT_EMPLOYEE("purchase_orders,contact,employee"), - - PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("purchase_orders,contact,employee,accounting_period"), - - PURCHASE_ORDERS_EMPLOYEE("purchase_orders,employee"), - - PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD("purchase_orders,employee,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES("tracking_categories,applied_credit_notes"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "tracking_categories,applied_credit_notes,applied_vendor_credits"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "tracking_categories,applied_credit_notes,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY("tracking_categories,applied_credit_notes,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT("tracking_categories,applied_credit_notes,contact"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "tracking_categories,applied_credit_notes,contact,company"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,applied_credit_notes,contact,company,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "tracking_categories,applied_credit_notes,contact,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE("tracking_categories,applied_credit_notes,employee"), - - TRACKING_CATEGORIES_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_credit_notes,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS("tracking_categories,applied_vendor_credits"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY("tracking_categories,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT("tracking_categories,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE("tracking_categories,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE("tracking_categories,company,employee"), - - TRACKING_CATEGORIES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE("tracking_categories,contact,company,employee"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE("tracking_categories,contact,employee"), - - TRACKING_CATEGORIES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_EMPLOYEE("tracking_categories,employee"), - - TRACKING_CATEGORIES_EMPLOYEE_ACCOUNTING_PERIOD("tracking_categories,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS("tracking_categories,purchase_orders"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_ACCOUNTING_PERIOD("tracking_categories,purchase_orders,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES( - "tracking_categories,purchase_orders,applied_credit_notes"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT( - "tracking_categories,purchase_orders,applied_credit_notes,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE( - "tracking_categories,purchase_orders,applied_credit_notes,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_CREDIT_NOTES_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_credit_notes,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS( - "tracking_categories,purchase_orders,applied_vendor_credits"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY( - "tracking_categories,purchase_orders,applied_vendor_credits,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT( - "tracking_categories,purchase_orders,applied_vendor_credits,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE( - "tracking_categories,purchase_orders,applied_vendor_credits,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_APPLIED_VENDOR_CREDITS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,applied_vendor_credits,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY("tracking_categories,purchase_orders,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE("tracking_categories,purchase_orders,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT("tracking_categories,purchase_orders,contact"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY("tracking_categories,purchase_orders,contact,company"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,company,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE( - "tracking_categories,purchase_orders,contact,company,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_COMPANY_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,company,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE("tracking_categories,purchase_orders,contact,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_CONTACT_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,contact,employee,accounting_period"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE("tracking_categories,purchase_orders,employee"), - - TRACKING_CATEGORIES_PURCHASE_ORDERS_EMPLOYEE_ACCOUNTING_PERIOD( - "tracking_categories,purchase_orders,employee,accounting_period"); - - private final String value; - - InvoicesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/issues/IssuesClient.java b/src/main/java/com/merge/api/resources/accounting/issues/IssuesClient.java deleted file mode 100644 index 43f031b0f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/issues/IssuesClient.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.issues; - -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.issues.requests.IssuesListRequest; -import com.merge.api.resources.accounting.types.Issue; -import com.merge.api.resources.accounting.types.PaginatedIssueList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuesClient { - protected final ClientOptions clientOptions; - - public IssuesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list() { - return list(IssuesListRequest.builder().build()); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request) { - return list(request, null); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/issues"); - if (request.getAccountToken().isPresent()) { - httpUrl.addQueryParameter("account_token", request.getAccountToken().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getFirstIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_after", - request.getFirstIncidentTimeAfter().get().toString()); - } - if (request.getFirstIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_before", - request.getFirstIncidentTimeBefore().get().toString()); - } - if (request.getIncludeMuted().isPresent()) { - httpUrl.addQueryParameter("include_muted", request.getIncludeMuted().get()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getLastIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_after", - request.getLastIncidentTimeAfter().get().toString()); - } - if (request.getLastIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_before", - request.getLastIncidentTimeBefore().get().toString()); - } - if (request.getLinkedAccountId().isPresent()) { - httpUrl.addQueryParameter( - "linked_account_id", request.getLinkedAccountId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedIssueList.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); - } - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id) { - return retrieve(id, null); - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/issues") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), Issue.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/api/resources/accounting/issues/requests/IssuesListRequest.java deleted file mode 100644 index 1d8863b78..000000000 --- a/src/main/java/com/merge/api/resources/accounting/issues/requests/IssuesListRequest.java +++ /dev/null @@ -1,477 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.issues.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.issues.types.IssuesListRequestStatus; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IssuesListRequest.Builder.class) -public final class IssuesListRequest { - private final Optional accountToken; - - private final Optional cursor; - - private final Optional endDate; - - private final Optional endUserOrganizationName; - - private final Optional firstIncidentTimeAfter; - - private final Optional firstIncidentTimeBefore; - - private final Optional includeMuted; - - private final Optional integrationName; - - private final Optional lastIncidentTimeAfter; - - private final Optional lastIncidentTimeBefore; - - private final Optional linkedAccountId; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional status; - - private final Map additionalProperties; - - private IssuesListRequest( - Optional accountToken, - Optional cursor, - Optional endDate, - Optional endUserOrganizationName, - Optional firstIncidentTimeAfter, - Optional firstIncidentTimeBefore, - Optional includeMuted, - Optional integrationName, - Optional lastIncidentTimeAfter, - Optional lastIncidentTimeBefore, - Optional linkedAccountId, - Optional pageSize, - Optional startDate, - Optional status, - Map additionalProperties) { - this.accountToken = accountToken; - this.cursor = cursor; - this.endDate = endDate; - this.endUserOrganizationName = endUserOrganizationName; - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - this.includeMuted = includeMuted; - this.integrationName = integrationName; - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - this.linkedAccountId = linkedAccountId; - this.pageSize = pageSize; - this.startDate = startDate; - this.status = status; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public Optional getAccountToken() { - return accountToken; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include issues whose most recent action occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return issues whose first incident time was after this datetime. - */ - @JsonProperty("first_incident_time_after") - public Optional getFirstIncidentTimeAfter() { - return firstIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose first incident time was before this datetime. - */ - @JsonProperty("first_incident_time_before") - public Optional getFirstIncidentTimeBefore() { - return firstIncidentTimeBefore; - } - - /** - * @return If true, will include muted issues - */ - @JsonProperty("include_muted") - public Optional getIncludeMuted() { - return includeMuted; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If provided, will only return issues whose last incident time was after this datetime. - */ - @JsonProperty("last_incident_time_after") - public Optional getLastIncidentTimeAfter() { - return lastIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose last incident time was before this datetime. - */ - @JsonProperty("last_incident_time_before") - public Optional getLastIncidentTimeBefore() { - return lastIncidentTimeBefore; - } - - /** - * @return If provided, will only include issues pertaining to the linked account passed in. - */ - @JsonProperty("linked_account_id") - public Optional getLinkedAccountId() { - return linkedAccountId; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include issues whose most recent action occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IssuesListRequest other) { - return accountToken.equals(other.accountToken) - && cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) - && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) - && includeMuted.equals(other.includeMuted) - && integrationName.equals(other.integrationName) - && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) - && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) - && linkedAccountId.equals(other.linkedAccountId) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountToken, - this.cursor, - this.endDate, - this.endUserOrganizationName, - this.firstIncidentTimeAfter, - this.firstIncidentTimeBefore, - this.includeMuted, - this.integrationName, - this.lastIncidentTimeAfter, - this.lastIncidentTimeBefore, - this.linkedAccountId, - this.pageSize, - this.startDate, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountToken = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional firstIncidentTimeAfter = Optional.empty(); - - private Optional firstIncidentTimeBefore = Optional.empty(); - - private Optional includeMuted = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional lastIncidentTimeAfter = Optional.empty(); - - private Optional lastIncidentTimeBefore = Optional.empty(); - - private Optional linkedAccountId = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(IssuesListRequest other) { - accountToken(other.getAccountToken()); - cursor(other.getCursor()); - endDate(other.getEndDate()); - endUserOrganizationName(other.getEndUserOrganizationName()); - firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); - firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); - includeMuted(other.getIncludeMuted()); - integrationName(other.getIntegrationName()); - lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); - lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); - linkedAccountId(other.getLinkedAccountId()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "account_token", nulls = Nulls.SKIP) - public Builder accountToken(Optional accountToken) { - this.accountToken = accountToken; - return this; - } - - public Builder accountToken(String accountToken) { - this.accountToken = Optional.ofNullable(accountToken); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) - public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - return this; - } - - public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) - public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - return this; - } - - public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) - public Builder includeMuted(Optional includeMuted) { - this.includeMuted = includeMuted; - return this; - } - - public Builder includeMuted(String includeMuted) { - this.includeMuted = Optional.ofNullable(includeMuted); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) - public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - return this; - } - - public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) - public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - return this; - } - - public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) - public Builder linkedAccountId(Optional linkedAccountId) { - this.linkedAccountId = linkedAccountId; - return this; - } - - public Builder linkedAccountId(String linkedAccountId) { - this.linkedAccountId = Optional.ofNullable(linkedAccountId); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(IssuesListRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - public IssuesListRequest build() { - return new IssuesListRequest( - accountToken, - cursor, - endDate, - endUserOrganizationName, - firstIncidentTimeAfter, - firstIncidentTimeBefore, - includeMuted, - integrationName, - lastIncidentTimeAfter, - lastIncidentTimeBefore, - linkedAccountId, - pageSize, - startDate, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/resources/accounting/issues/types/IssuesListRequestStatus.java deleted file mode 100644 index 096236205..000000000 --- a/src/main/java/com/merge/api/resources/accounting/issues/types/IssuesListRequestStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.issues.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssuesListRequestStatus { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssuesListRequestStatus(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/items/ItemsClient.java b/src/main/java/com/merge/api/resources/accounting/items/ItemsClient.java deleted file mode 100644 index f5d04329c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/items/ItemsClient.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.items; - -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.items.requests.ItemsListRequest; -import com.merge.api.resources.accounting.items.requests.ItemsRetrieveRequest; -import com.merge.api.resources.accounting.types.Item; -import com.merge.api.resources.accounting.types.PaginatedItemList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ItemsClient { - protected final ClientOptions clientOptions; - - public ItemsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Item objects. - */ - public PaginatedItemList list() { - return list(ItemsListRequest.builder().build()); - } - - /** - * Returns a list of Item objects. - */ - public PaginatedItemList list(ItemsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Item objects. - */ - public PaginatedItemList list(ItemsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/items"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedItemList.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); - } - } - - /** - * Returns an Item object with the given id. - */ - public Item retrieve(String id) { - return retrieve(id, ItemsRetrieveRequest.builder().build()); - } - - /** - * Returns an Item object with the given id. - */ - public Item retrieve(String id, ItemsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Item object with the given id. - */ - public Item retrieve(String id, ItemsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/items") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Item.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/items/requests/ItemsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/items/requests/ItemsRetrieveRequest.java deleted file mode 100644 index f360d2a78..000000000 --- a/src/main/java/com/merge/api/resources/accounting/items/requests/ItemsRetrieveRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.items.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.items.types.ItemsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ItemsRetrieveRequest.Builder.class) -public final class ItemsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private ItemsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ItemsRetrieveRequest && equalTo((ItemsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ItemsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ItemsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ItemsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public ItemsRetrieveRequest build() { - return new ItemsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/items/types/ItemsListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/items/types/ItemsListRequestExpand.java deleted file mode 100644 index f9daf6286..000000000 --- a/src/main/java/com/merge/api/resources/accounting/items/types/ItemsListRequestExpand.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.items.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemsListRequestExpand { - COMPANY("company"), - - COMPANY_PURCHASE_TAX_RATE("company,purchase_tax_rate"), - - COMPANY_SALES_TAX_RATE("company,sales_tax_rate"), - - COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE("company,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT("purchase_account"), - - PURCHASE_ACCOUNT_COMPANY("purchase_account,company"), - - PURCHASE_ACCOUNT_COMPANY_PURCHASE_TAX_RATE("purchase_account,company,purchase_tax_rate"), - - PURCHASE_ACCOUNT_COMPANY_SALES_TAX_RATE("purchase_account,company,sales_tax_rate"), - - PURCHASE_ACCOUNT_COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE( - "purchase_account,company,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT_PURCHASE_TAX_RATE("purchase_account,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT("purchase_account,sales_account"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY("purchase_account,sales_account,company"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY_PURCHASE_TAX_RATE( - "purchase_account,sales_account,company,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY_SALES_TAX_RATE("purchase_account,sales_account,company,sales_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE( - "purchase_account,sales_account,company,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_PURCHASE_TAX_RATE("purchase_account,sales_account,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_SALES_TAX_RATE("purchase_account,sales_account,sales_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_SALES_TAX_RATE_PURCHASE_TAX_RATE( - "purchase_account,sales_account,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_TAX_RATE("purchase_account,sales_tax_rate"), - - PURCHASE_ACCOUNT_SALES_TAX_RATE_PURCHASE_TAX_RATE("purchase_account,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_TAX_RATE("purchase_tax_rate"), - - SALES_ACCOUNT("sales_account"), - - SALES_ACCOUNT_COMPANY("sales_account,company"), - - SALES_ACCOUNT_COMPANY_PURCHASE_TAX_RATE("sales_account,company,purchase_tax_rate"), - - SALES_ACCOUNT_COMPANY_SALES_TAX_RATE("sales_account,company,sales_tax_rate"), - - SALES_ACCOUNT_COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE("sales_account,company,sales_tax_rate,purchase_tax_rate"), - - SALES_ACCOUNT_PURCHASE_TAX_RATE("sales_account,purchase_tax_rate"), - - SALES_ACCOUNT_SALES_TAX_RATE("sales_account,sales_tax_rate"), - - SALES_ACCOUNT_SALES_TAX_RATE_PURCHASE_TAX_RATE("sales_account,sales_tax_rate,purchase_tax_rate"), - - SALES_TAX_RATE("sales_tax_rate"), - - SALES_TAX_RATE_PURCHASE_TAX_RATE("sales_tax_rate,purchase_tax_rate"); - - private final String value; - - ItemsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/items/types/ItemsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/items/types/ItemsRetrieveRequestExpand.java deleted file mode 100644 index 938e6ba62..000000000 --- a/src/main/java/com/merge/api/resources/accounting/items/types/ItemsRetrieveRequestExpand.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.items.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemsRetrieveRequestExpand { - COMPANY("company"), - - COMPANY_PURCHASE_TAX_RATE("company,purchase_tax_rate"), - - COMPANY_SALES_TAX_RATE("company,sales_tax_rate"), - - COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE("company,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT("purchase_account"), - - PURCHASE_ACCOUNT_COMPANY("purchase_account,company"), - - PURCHASE_ACCOUNT_COMPANY_PURCHASE_TAX_RATE("purchase_account,company,purchase_tax_rate"), - - PURCHASE_ACCOUNT_COMPANY_SALES_TAX_RATE("purchase_account,company,sales_tax_rate"), - - PURCHASE_ACCOUNT_COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE( - "purchase_account,company,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT_PURCHASE_TAX_RATE("purchase_account,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT("purchase_account,sales_account"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY("purchase_account,sales_account,company"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY_PURCHASE_TAX_RATE( - "purchase_account,sales_account,company,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY_SALES_TAX_RATE("purchase_account,sales_account,company,sales_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE( - "purchase_account,sales_account,company,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_PURCHASE_TAX_RATE("purchase_account,sales_account,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_SALES_TAX_RATE("purchase_account,sales_account,sales_tax_rate"), - - PURCHASE_ACCOUNT_SALES_ACCOUNT_SALES_TAX_RATE_PURCHASE_TAX_RATE( - "purchase_account,sales_account,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_ACCOUNT_SALES_TAX_RATE("purchase_account,sales_tax_rate"), - - PURCHASE_ACCOUNT_SALES_TAX_RATE_PURCHASE_TAX_RATE("purchase_account,sales_tax_rate,purchase_tax_rate"), - - PURCHASE_TAX_RATE("purchase_tax_rate"), - - SALES_ACCOUNT("sales_account"), - - SALES_ACCOUNT_COMPANY("sales_account,company"), - - SALES_ACCOUNT_COMPANY_PURCHASE_TAX_RATE("sales_account,company,purchase_tax_rate"), - - SALES_ACCOUNT_COMPANY_SALES_TAX_RATE("sales_account,company,sales_tax_rate"), - - SALES_ACCOUNT_COMPANY_SALES_TAX_RATE_PURCHASE_TAX_RATE("sales_account,company,sales_tax_rate,purchase_tax_rate"), - - SALES_ACCOUNT_PURCHASE_TAX_RATE("sales_account,purchase_tax_rate"), - - SALES_ACCOUNT_SALES_TAX_RATE("sales_account,sales_tax_rate"), - - SALES_ACCOUNT_SALES_TAX_RATE_PURCHASE_TAX_RATE("sales_account,sales_tax_rate,purchase_tax_rate"), - - SALES_TAX_RATE("sales_tax_rate"), - - SALES_TAX_RATE_PURCHASE_TAX_RATE("sales_tax_rate,purchase_tax_rate"); - - private final String value; - - ItemsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/JournalEntriesClient.java b/src/main/java/com/merge/api/resources/accounting/journalentries/JournalEntriesClient.java deleted file mode 100644 index 77c0ab52c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/JournalEntriesClient.java +++ /dev/null @@ -1,449 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.journalentries; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.journalentries.requests.JournalEntriesLinesRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.journalentries.requests.JournalEntriesListRequest; -import com.merge.api.resources.accounting.journalentries.requests.JournalEntriesRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.journalentries.requests.JournalEntriesRetrieveRequest; -import com.merge.api.resources.accounting.journalentries.requests.JournalEntryEndpointRequest; -import com.merge.api.resources.accounting.types.JournalEntry; -import com.merge.api.resources.accounting.types.JournalEntryResponse; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedJournalEntryList; -import com.merge.api.resources.accounting.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class JournalEntriesClient { - protected final ClientOptions clientOptions; - - public JournalEntriesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of JournalEntry objects. - */ - public PaginatedJournalEntryList list() { - return list(JournalEntriesListRequest.builder().build()); - } - - /** - * Returns a list of JournalEntry objects. - */ - public PaginatedJournalEntryList list(JournalEntriesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of JournalEntry objects. - */ - public PaginatedJournalEntryList list(JournalEntriesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/journal-entries"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTransactionDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_after", - request.getTransactionDateAfter().get().toString()); - } - if (request.getTransactionDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_before", - request.getTransactionDateBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedJournalEntryList.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); - } - } - - /** - * Creates a JournalEntry object with the given values. - */ - public JournalEntryResponse create(JournalEntryEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a JournalEntry object with the given values. - */ - public JournalEntryResponse create(JournalEntryEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/journal-entries"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), JournalEntryResponse.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); - } - } - - /** - * Returns a JournalEntry object with the given id. - */ - public JournalEntry retrieve(String id) { - return retrieve(id, JournalEntriesRetrieveRequest.builder().build()); - } - - /** - * Returns a JournalEntry object with the given id. - */ - public JournalEntry retrieve(String id, JournalEntriesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a JournalEntry object with the given id. - */ - public JournalEntry retrieve(String id, JournalEntriesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/journal-entries") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), JournalEntry.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList linesRemoteFieldClassesList() { - return linesRemoteFieldClassesList( - JournalEntriesLinesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList linesRemoteFieldClassesList( - JournalEntriesLinesRemoteFieldClassesListRequest request) { - return linesRemoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList linesRemoteFieldClassesList( - JournalEntriesLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/journal-entries/lines/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } - - /** - * Returns metadata for JournalEntry POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for JournalEntry POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/journal-entries/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - JournalEntriesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(JournalEntriesRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - JournalEntriesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/journal-entries/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesRetrieveRequest.java deleted file mode 100644 index f199d3218..000000000 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/requests/JournalEntriesRetrieveRequest.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.journalentries.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.journalentries.types.JournalEntriesRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = JournalEntriesRetrieveRequest.Builder.class) -public final class JournalEntriesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private JournalEntriesRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JournalEntriesRetrieveRequest && equalTo((JournalEntriesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(JournalEntriesRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(JournalEntriesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(JournalEntriesRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public JournalEntriesRetrieveRequest build() { - return new JournalEntriesRetrieveRequest( - expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/types/JournalEntriesListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/journalentries/types/JournalEntriesListRequestExpand.java deleted file mode 100644 index 4bc04dfb9..000000000 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/types/JournalEntriesListRequestExpand.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.journalentries.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum JournalEntriesListRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_PAYMENTS("applied_payments"), - - APPLIED_PAYMENTS_ACCOUNTING_PERIOD("applied_payments,accounting_period"), - - APPLIED_PAYMENTS_COMPANY("applied_payments,company"), - - APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("applied_payments,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES("applied_payments,tracking_categories"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("applied_payments,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("applied_payments,tracking_categories,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - LINES("lines"), - - LINES_ACCOUNTING_PERIOD("lines,accounting_period"), - - LINES_APPLIED_PAYMENTS("lines,applied_payments"), - - LINES_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("lines,applied_payments,accounting_period"), - - LINES_APPLIED_PAYMENTS_COMPANY("lines,applied_payments,company"), - - LINES_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("lines,applied_payments,company,accounting_period"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES("lines,applied_payments,tracking_categories"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "lines,applied_payments,tracking_categories,accounting_period"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("lines,applied_payments,tracking_categories,company"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "lines,applied_payments,tracking_categories,company,accounting_period"), - - LINES_COMPANY("lines,company"), - - LINES_COMPANY_ACCOUNTING_PERIOD("lines,company,accounting_period"), - - LINES_PAYMENTS("lines,payments"), - - LINES_PAYMENTS_ACCOUNTING_PERIOD("lines,payments,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS("lines,payments,applied_payments"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("lines,payments,applied_payments,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_COMPANY("lines,payments,applied_payments,company"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD( - "lines,payments,applied_payments,company,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("lines,payments,applied_payments,tracking_categories"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "lines,payments,applied_payments,tracking_categories,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY( - "lines,payments,applied_payments,tracking_categories,company"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "lines,payments,applied_payments,tracking_categories,company,accounting_period"), - - LINES_PAYMENTS_COMPANY("lines,payments,company"), - - LINES_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("lines,payments,company,accounting_period"), - - LINES_PAYMENTS_TRACKING_CATEGORIES("lines,payments,tracking_categories"), - - LINES_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("lines,payments,tracking_categories,accounting_period"), - - LINES_PAYMENTS_TRACKING_CATEGORIES_COMPANY("lines,payments,tracking_categories,company"), - - LINES_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "lines,payments,tracking_categories,company,accounting_period"), - - LINES_TRACKING_CATEGORIES("lines,tracking_categories"), - - LINES_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("lines,tracking_categories,accounting_period"), - - LINES_TRACKING_CATEGORIES_COMPANY("lines,tracking_categories,company"), - - LINES_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("lines,tracking_categories,company,accounting_period"), - - PAYMENTS("payments"), - - PAYMENTS_ACCOUNTING_PERIOD("payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS("payments,applied_payments"), - - PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("payments,applied_payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY("payments,applied_payments,company"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,applied_payments,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("payments,applied_payments,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,applied_payments,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,accounting_period"), - - PAYMENTS_COMPANY("payments,company"), - - PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES("payments,tracking_categories"), - - PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("payments,tracking_categories,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,tracking_categories,company"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("payments,tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"); - - private final String value; - - JournalEntriesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/journalentries/types/JournalEntriesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/journalentries/types/JournalEntriesRetrieveRequestExpand.java deleted file mode 100644 index fead59048..000000000 --- a/src/main/java/com/merge/api/resources/accounting/journalentries/types/JournalEntriesRetrieveRequestExpand.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.journalentries.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum JournalEntriesRetrieveRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_PAYMENTS("applied_payments"), - - APPLIED_PAYMENTS_ACCOUNTING_PERIOD("applied_payments,accounting_period"), - - APPLIED_PAYMENTS_COMPANY("applied_payments,company"), - - APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("applied_payments,company,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES("applied_payments,tracking_categories"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("applied_payments,tracking_categories,accounting_period"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("applied_payments,tracking_categories,company"), - - APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "applied_payments,tracking_categories,company,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - LINES("lines"), - - LINES_ACCOUNTING_PERIOD("lines,accounting_period"), - - LINES_APPLIED_PAYMENTS("lines,applied_payments"), - - LINES_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("lines,applied_payments,accounting_period"), - - LINES_APPLIED_PAYMENTS_COMPANY("lines,applied_payments,company"), - - LINES_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("lines,applied_payments,company,accounting_period"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES("lines,applied_payments,tracking_categories"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "lines,applied_payments,tracking_categories,accounting_period"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("lines,applied_payments,tracking_categories,company"), - - LINES_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "lines,applied_payments,tracking_categories,company,accounting_period"), - - LINES_COMPANY("lines,company"), - - LINES_COMPANY_ACCOUNTING_PERIOD("lines,company,accounting_period"), - - LINES_PAYMENTS("lines,payments"), - - LINES_PAYMENTS_ACCOUNTING_PERIOD("lines,payments,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS("lines,payments,applied_payments"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("lines,payments,applied_payments,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_COMPANY("lines,payments,applied_payments,company"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD( - "lines,payments,applied_payments,company,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("lines,payments,applied_payments,tracking_categories"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "lines,payments,applied_payments,tracking_categories,accounting_period"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY( - "lines,payments,applied_payments,tracking_categories,company"), - - LINES_PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "lines,payments,applied_payments,tracking_categories,company,accounting_period"), - - LINES_PAYMENTS_COMPANY("lines,payments,company"), - - LINES_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("lines,payments,company,accounting_period"), - - LINES_PAYMENTS_TRACKING_CATEGORIES("lines,payments,tracking_categories"), - - LINES_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("lines,payments,tracking_categories,accounting_period"), - - LINES_PAYMENTS_TRACKING_CATEGORIES_COMPANY("lines,payments,tracking_categories,company"), - - LINES_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "lines,payments,tracking_categories,company,accounting_period"), - - LINES_TRACKING_CATEGORIES("lines,tracking_categories"), - - LINES_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("lines,tracking_categories,accounting_period"), - - LINES_TRACKING_CATEGORIES_COMPANY("lines,tracking_categories,company"), - - LINES_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("lines,tracking_categories,company,accounting_period"), - - PAYMENTS("payments"), - - PAYMENTS_ACCOUNTING_PERIOD("payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS("payments,applied_payments"), - - PAYMENTS_APPLIED_PAYMENTS_ACCOUNTING_PERIOD("payments,applied_payments,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY("payments,applied_payments,company"), - - PAYMENTS_APPLIED_PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,applied_payments,company,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES("payments,applied_payments,tracking_categories"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,accounting_period"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,applied_payments,tracking_categories,company"), - - PAYMENTS_APPLIED_PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "payments,applied_payments,tracking_categories,company,accounting_period"), - - PAYMENTS_COMPANY("payments,company"), - - PAYMENTS_COMPANY_ACCOUNTING_PERIOD("payments,company,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES("payments,tracking_categories"), - - PAYMENTS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("payments,tracking_categories,accounting_period"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY("payments,tracking_categories,company"), - - PAYMENTS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("payments,tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"); - - private final String value; - - JournalEntriesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/api/resources/accounting/linkedaccounts/LinkedAccountsClient.java deleted file mode 100644 index 54d76fa08..000000000 --- a/src/main/java/com/merge/api/resources/accounting/linkedaccounts/LinkedAccountsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.linkedaccounts; - -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.linkedaccounts.requests.LinkedAccountsListRequest; -import com.merge.api.resources.accounting.types.PaginatedAccountDetailsAndActionsList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkedAccountsClient { - protected final ClientOptions clientOptions; - - public LinkedAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list() { - return list(LinkedAccountsListRequest.builder().build()); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list(LinkedAccountsListRequest request) { - return list(request, null); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list( - LinkedAccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/linked-accounts"); - if (request.getCategory().isPresent()) { - httpUrl.addQueryParameter("category", request.getCategory().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndUserEmailAddress().isPresent()) { - httpUrl.addQueryParameter( - "end_user_email_address", request.getEndUserEmailAddress().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getEndUserOriginId().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_id", request.getEndUserOriginId().get()); - } - if (request.getEndUserOriginIds().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_ids", request.getEndUserOriginIds().get()); - } - if (request.getId().isPresent()) { - httpUrl.addQueryParameter("id", request.getId().get()); - } - if (request.getIds().isPresent()) { - httpUrl.addQueryParameter("ids", request.getIds().get()); - } - if (request.getIncludeDuplicates().isPresent()) { - httpUrl.addQueryParameter( - "include_duplicates", request.getIncludeDuplicates().get().toString()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getIsTestAccount().isPresent()) { - httpUrl.addQueryParameter( - "is_test_account", request.getIsTestAccount().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountDetailsAndActionsList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/resources/accounting/linkedaccounts/requests/LinkedAccountsListRequest.java deleted file mode 100644 index 59f1643bb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/linkedaccounts/requests/LinkedAccountsListRequest.java +++ /dev/null @@ -1,458 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.linkedaccounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.linkedaccounts.types.LinkedAccountsListRequestCategory; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) -public final class LinkedAccountsListRequest { - private final Optional category; - - private final Optional cursor; - - private final Optional endUserEmailAddress; - - private final Optional endUserOrganizationName; - - private final Optional endUserOriginId; - - private final Optional endUserOriginIds; - - private final Optional id; - - private final Optional ids; - - private final Optional includeDuplicates; - - private final Optional integrationName; - - private final Optional isTestAccount; - - private final Optional pageSize; - - private final Optional status; - - private final Map additionalProperties; - - private LinkedAccountsListRequest( - Optional category, - Optional cursor, - Optional endUserEmailAddress, - Optional endUserOrganizationName, - Optional endUserOriginId, - Optional endUserOriginIds, - Optional id, - Optional ids, - Optional includeDuplicates, - Optional integrationName, - Optional isTestAccount, - Optional pageSize, - Optional status, - Map additionalProperties) { - this.category = category; - this.cursor = cursor; - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.endUserOriginIds = endUserOriginIds; - this.id = id; - this.ids = ids; - this.includeDuplicates = includeDuplicates; - this.integrationName = integrationName; - this.isTestAccount = isTestAccount; - this.pageSize = pageSize; - this.status = status; - this.additionalProperties = additionalProperties; - } - - /** - * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing - *
    - *
  • hris - hris
  • - *
  • ats - ats
  • - *
  • accounting - accounting
  • - *
  • ticketing - ticketing
  • - *
  • crm - crm
  • - *
  • mktg - mktg
  • - *
  • filestorage - filestorage
  • - *
- */ - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return linked accounts associated with the given email address. - */ - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return If provided, will only return linked accounts associated with the given organization name. - */ - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return linked accounts associated with the given origin ID. - */ - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. - */ - @JsonProperty("end_user_origin_ids") - public Optional getEndUserOriginIds() { - return endUserOriginIds; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. - */ - @JsonProperty("ids") - public Optional getIds() { - return ids; - } - - /** - * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. - */ - @JsonProperty("include_duplicates") - public Optional getIncludeDuplicates() { - return includeDuplicates; - } - - /** - * @return If provided, will only return linked accounts associated with the given integration name. - */ - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. - */ - @JsonProperty("is_test_account") - public Optional getIsTestAccount() { - return isTestAccount; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountsListRequest other) { - return category.equals(other.category) - && cursor.equals(other.cursor) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOriginIds.equals(other.endUserOriginIds) - && id.equals(other.id) - && ids.equals(other.ids) - && includeDuplicates.equals(other.includeDuplicates) - && integrationName.equals(other.integrationName) - && isTestAccount.equals(other.isTestAccount) - && pageSize.equals(other.pageSize) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.category, - this.cursor, - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.endUserOriginIds, - this.id, - this.ids, - this.includeDuplicates, - this.integrationName, - this.isTestAccount, - this.pageSize, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional category = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOriginIds = Optional.empty(); - - private Optional id = Optional.empty(); - - private Optional ids = Optional.empty(); - - private Optional includeDuplicates = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional isTestAccount = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountsListRequest other) { - category(other.getCategory()); - cursor(other.getCursor()); - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - endUserOriginIds(other.getEndUserOriginIds()); - id(other.getId()); - ids(other.getIds()); - includeDuplicates(other.getIncludeDuplicates()); - integrationName(other.getIntegrationName()); - isTestAccount(other.getIsTestAccount()); - pageSize(other.getPageSize()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(LinkedAccountsListRequestCategory category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) - public Builder endUserOriginIds(Optional endUserOriginIds) { - this.endUserOriginIds = endUserOriginIds; - return this; - } - - public Builder endUserOriginIds(String endUserOriginIds) { - this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "ids", nulls = Nulls.SKIP) - public Builder ids(Optional ids) { - this.ids = ids; - return this; - } - - public Builder ids(String ids) { - this.ids = Optional.ofNullable(ids); - return this; - } - - @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) - public Builder includeDuplicates(Optional includeDuplicates) { - this.includeDuplicates = includeDuplicates; - return this; - } - - public Builder includeDuplicates(Boolean includeDuplicates) { - this.includeDuplicates = Optional.ofNullable(includeDuplicates); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) - public Builder isTestAccount(Optional isTestAccount) { - this.isTestAccount = isTestAccount; - return this; - } - - public Builder isTestAccount(String isTestAccount) { - this.isTestAccount = Optional.ofNullable(isTestAccount); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - public LinkedAccountsListRequest build() { - return new LinkedAccountsListRequest( - category, - cursor, - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - endUserOriginIds, - id, - ids, - includeDuplicates, - integrationName, - isTestAccount, - pageSize, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/resources/accounting/linkedaccounts/types/LinkedAccountsListRequestCategory.java deleted file mode 100644 index a4a036c5d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/linkedaccounts/types/LinkedAccountsListRequestCategory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.linkedaccounts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LinkedAccountsListRequestCategory { - ACCOUNTING("accounting"), - - ATS("ats"), - - CRM("crm"), - - FILESTORAGE("filestorage"), - - HRIS("hris"), - - MKTG("mktg"), - - TICKETING("ticketing"); - - private final String value; - - LinkedAccountsListRequestCategory(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/linktoken/LinkTokenClient.java b/src/main/java/com/merge/api/resources/accounting/linktoken/LinkTokenClient.java deleted file mode 100644 index c3a471517..000000000 --- a/src/main/java/com/merge/api/resources/accounting/linktoken/LinkTokenClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.linktoken; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.linktoken.requests.EndUserDetailsRequest; -import com.merge.api.resources.accounting.types.LinkToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkTokenClient { - protected final ClientOptions clientOptions; - - public LinkTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request) { - return create(request, null); - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/link-token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), LinkToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/api/resources/accounting/linktoken/requests/EndUserDetailsRequest.java deleted file mode 100644 index 3ea17e256..000000000 --- a/src/main/java/com/merge/api/resources/accounting/linktoken/requests/EndUserDetailsRequest.java +++ /dev/null @@ -1,611 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.linktoken.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.CategoriesEnum; -import com.merge.api.resources.accounting.types.CommonModelScopesBodyRequest; -import com.merge.api.resources.accounting.types.IndividualCommonModelScopeDeserializerRequest; -import com.merge.api.resources.accounting.types.LanguageEnum; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) -public final class EndUserDetailsRequest { - private final String endUserEmailAddress; - - private final String endUserOrganizationName; - - private final String endUserOriginId; - - private final List categories; - - private final Optional integration; - - private final Optional linkExpiryMins; - - private final Optional shouldCreateMagicLinkUrl; - - private final Optional hideAdminMagicLink; - - private final Optional> commonModels; - - private final Optional>>> - categoryCommonModelScopes; - - private final Optional language; - - private final Optional areSyncsDisabled; - - private final Optional> integrationSpecificConfig; - - private final Map additionalProperties; - - private EndUserDetailsRequest( - String endUserEmailAddress, - String endUserOrganizationName, - String endUserOriginId, - List categories, - Optional integration, - Optional linkExpiryMins, - Optional shouldCreateMagicLinkUrl, - Optional hideAdminMagicLink, - Optional> commonModels, - Optional>>> - categoryCommonModelScopes, - Optional language, - Optional areSyncsDisabled, - Optional> integrationSpecificConfig, - Map additionalProperties) { - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.categories = categories; - this.integration = integration; - this.linkExpiryMins = linkExpiryMins; - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - this.hideAdminMagicLink = hideAdminMagicLink; - this.commonModels = commonModels; - this.categoryCommonModelScopes = categoryCommonModelScopes; - this.language = language; - this.areSyncsDisabled = areSyncsDisabled; - this.integrationSpecificConfig = integrationSpecificConfig; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. - */ - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return Your end user's organization. - */ - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. - */ - @JsonProperty("end_user_origin_id") - public String getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return The integration categories to show in Merge Link. - */ - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - /** - * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. - */ - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - /** - * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. - */ - @JsonProperty("link_expiry_mins") - public Optional getLinkExpiryMins() { - return linkExpiryMins; - } - - /** - * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("should_create_magic_link_url") - public Optional getShouldCreateMagicLinkUrl() { - return shouldCreateMagicLinkUrl; - } - - /** - * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("hide_admin_magic_link") - public Optional getHideAdminMagicLink() { - return hideAdminMagicLink; - } - - /** - * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. - */ - @JsonProperty("common_models") - public Optional> getCommonModels() { - return commonModels; - } - - /** - * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. - */ - @JsonProperty("category_common_model_scopes") - public Optional>>> - getCategoryCommonModelScopes() { - return categoryCommonModelScopes; - } - - /** - * @return The following subset of IETF language tags can be used to configure localization. - *
    - *
  • en - en
  • - *
  • de - de
  • - *
- */ - @JsonProperty("language") - public Optional getLanguage() { - return language; - } - - /** - * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. - */ - @JsonProperty("are_syncs_disabled") - public Optional getAreSyncsDisabled() { - return areSyncsDisabled; - } - - /** - * @return A JSON object containing integration-specific configuration options. - */ - @JsonProperty("integration_specific_config") - public Optional> getIntegrationSpecificConfig() { - return integrationSpecificConfig; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EndUserDetailsRequest other) { - return endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && categories.equals(other.categories) - && integration.equals(other.integration) - && linkExpiryMins.equals(other.linkExpiryMins) - && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) - && hideAdminMagicLink.equals(other.hideAdminMagicLink) - && commonModels.equals(other.commonModels) - && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) - && language.equals(other.language) - && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.categories, - this.integration, - this.linkExpiryMins, - this.shouldCreateMagicLinkUrl, - this.hideAdminMagicLink, - this.commonModels, - this.categoryCommonModelScopes, - this.language, - this.areSyncsDisabled, - this.integrationSpecificConfig); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EndUserEmailAddressStage builder() { - return new Builder(); - } - - public interface EndUserEmailAddressStage { - EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); - - Builder from(EndUserDetailsRequest other); - } - - public interface EndUserOrganizationNameStage { - EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserOriginIdStage { - _FinalStage endUserOriginId(@NotNull String endUserOriginId); - } - - public interface _FinalStage { - EndUserDetailsRequest build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage integration(Optional integration); - - _FinalStage integration(String integration); - - _FinalStage linkExpiryMins(Optional linkExpiryMins); - - _FinalStage linkExpiryMins(Integer linkExpiryMins); - - _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); - - _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); - - _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); - - _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); - - _FinalStage commonModels(Optional> commonModels); - - _FinalStage commonModels(List commonModels); - - _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes); - - _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes); - - _FinalStage language(Optional language); - - _FinalStage language(LanguageEnum language); - - _FinalStage areSyncsDisabled(Optional areSyncsDisabled); - - _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); - - _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); - - _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { - private String endUserEmailAddress; - - private String endUserOrganizationName; - - private String endUserOriginId; - - private Optional> integrationSpecificConfig = Optional.empty(); - - private Optional areSyncsDisabled = Optional.empty(); - - private Optional language = Optional.empty(); - - private Optional>>> - categoryCommonModelScopes = Optional.empty(); - - private Optional> commonModels = Optional.empty(); - - private Optional hideAdminMagicLink = Optional.empty(); - - private Optional shouldCreateMagicLinkUrl = Optional.empty(); - - private Optional linkExpiryMins = Optional.empty(); - - private Optional integration = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EndUserDetailsRequest other) { - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - categories(other.getCategories()); - integration(other.getIntegration()); - linkExpiryMins(other.getLinkExpiryMins()); - shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); - hideAdminMagicLink(other.getHideAdminMagicLink()); - commonModels(other.getCommonModels()); - categoryCommonModelScopes(other.getCategoryCommonModelScopes()); - language(other.getLanguage()); - areSyncsDisabled(other.getAreSyncsDisabled()); - integrationSpecificConfig(other.getIntegrationSpecificConfig()); - return this; - } - - /** - *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_email_address") - public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - /** - *

Your end user's organization.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - /** - *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_origin_id") - public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - /** - *

A JSON object containing integration-specific configuration options.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { - this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) - public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { - this.integrationSpecificConfig = integrationSpecificConfig; - return this; - } - - /** - *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { - this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) - public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { - this.areSyncsDisabled = areSyncsDisabled; - return this; - } - - /** - *

The following subset of IETF language tags can be used to configure localization.

- *
    - *
  • en - en
  • - *
  • de - de
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage language(LanguageEnum language) { - this.language = Optional.ofNullable(language); - return this; - } - - @java.lang.Override - @JsonSetter(value = "language", nulls = Nulls.SKIP) - public _FinalStage language(Optional language) { - this.language = language; - return this; - } - - /** - *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes) { - this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) - public _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes) { - this.categoryCommonModelScopes = categoryCommonModelScopes; - return this; - } - - /** - *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage commonModels(List commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @java.lang.Override - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public _FinalStage commonModels(Optional> commonModels) { - this.commonModels = commonModels; - return this; - } - - /** - *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { - this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); - return this; - } - - @java.lang.Override - @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) - public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { - this.hideAdminMagicLink = hideAdminMagicLink; - return this; - } - - /** - *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) - public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - return this; - } - - /** - *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage linkExpiryMins(Integer linkExpiryMins) { - this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); - return this; - } - - @java.lang.Override - @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) - public _FinalStage linkExpiryMins(Optional linkExpiryMins) { - this.linkExpiryMins = linkExpiryMins; - return this; - } - - /** - *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public EndUserDetailsRequest build() { - return new EndUserDetailsRequest( - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - categories, - integration, - linkExpiryMins, - shouldCreateMagicLinkUrl, - hideAdminMagicLink, - commonModels, - categoryCommonModelScopes, - language, - areSyncsDisabled, - integrationSpecificConfig, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/passthrough/PassthroughClient.java b/src/main/java/com/merge/api/resources/accounting/passthrough/PassthroughClient.java deleted file mode 100644 index 053a54d56..000000000 --- a/src/main/java/com/merge/api/resources/accounting/passthrough/PassthroughClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.passthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -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.DataPassthroughRequest; -import com.merge.api.resources.accounting.types.RemoteResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PassthroughClient { - protected final ClientOptions clientOptions; - - public PassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), RemoteResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/payments/PaymentsClient.java b/src/main/java/com/merge/api/resources/accounting/payments/PaymentsClient.java deleted file mode 100644 index d921522d6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/payments/PaymentsClient.java +++ /dev/null @@ -1,556 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.payments; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.payments.requests.PatchedPaymentEndpointRequest; -import com.merge.api.resources.accounting.payments.requests.PaymentEndpointRequest; -import com.merge.api.resources.accounting.payments.requests.PaymentsLineItemsRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.payments.requests.PaymentsListRequest; -import com.merge.api.resources.accounting.payments.requests.PaymentsRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.payments.requests.PaymentsRetrieveRequest; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedPaymentList; -import com.merge.api.resources.accounting.types.PaginatedRemoteFieldClassList; -import com.merge.api.resources.accounting.types.Payment; -import com.merge.api.resources.accounting.types.PaymentResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PaymentsClient { - protected final ClientOptions clientOptions; - - public PaymentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Payment objects. - */ - public PaginatedPaymentList list() { - return list(PaymentsListRequest.builder().build()); - } - - /** - * Returns a list of Payment objects. - */ - public PaginatedPaymentList list(PaymentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Payment objects. - */ - public PaginatedPaymentList list(PaymentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments"); - if (request.getAccountId().isPresent()) { - httpUrl.addQueryParameter("account_id", request.getAccountId().get()); - } - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getContactId().isPresent()) { - httpUrl.addQueryParameter("contact_id", request.getContactId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTransactionDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_after", - request.getTransactionDateAfter().get().toString()); - } - if (request.getTransactionDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_before", - request.getTransactionDateBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedPaymentList.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); - } - } - - /** - * Creates a Payment object with the given values. - */ - public PaymentResponse create(PaymentEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Payment object with the given values. - */ - public PaymentResponse create(PaymentEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaymentResponse.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); - } - } - - /** - * Returns a Payment object with the given id. - */ - public Payment retrieve(String id) { - return retrieve(id, PaymentsRetrieveRequest.builder().build()); - } - - /** - * Returns a Payment object with the given id. - */ - public Payment retrieve(String id, PaymentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Payment object with the given id. - */ - public Payment retrieve(String id, PaymentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Payment.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); - } - } - - /** - * Updates a Payment object with the given id. - */ - public PaymentResponse partialUpdate(String id, PatchedPaymentEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates a Payment object with the given id. - */ - public PaymentResponse partialUpdate( - String id, PatchedPaymentEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaymentResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList() { - return lineItemsRemoteFieldClassesList( - PaymentsLineItemsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList( - PaymentsLineItemsRemoteFieldClassesListRequest request) { - return lineItemsRemoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList( - PaymentsLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments/line-items/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } - - /** - * Returns metadata for Payment PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for Payment PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for Payment POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Payment POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - PaymentsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(PaymentsRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - PaymentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/payments/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentsRetrieveRequest.java deleted file mode 100644 index 15c7d8a85..000000000 --- a/src/main/java/com/merge/api/resources/accounting/payments/requests/PaymentsRetrieveRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.payments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.payments.types.PaymentsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaymentsRetrieveRequest.Builder.class) -public final class PaymentsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private PaymentsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaymentsRetrieveRequest && equalTo((PaymentsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaymentsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaymentsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(PaymentsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public PaymentsRetrieveRequest build() { - return new PaymentsRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/payments/types/PaymentsListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/payments/types/PaymentsListRequestExpand.java deleted file mode 100644 index ad4b0141a..000000000 --- a/src/main/java/com/merge/api/resources/accounting/payments/types/PaymentsListRequestExpand.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.payments.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum PaymentsListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ACCOUNTING_PERIOD("account,accounting_period"), - - ACCOUNT_COMPANY("account,company"), - - ACCOUNT_COMPANY_ACCOUNTING_PERIOD("account,company,accounting_period"), - - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_TO_LINES("applied_to_lines"), - - APPLIED_TO_LINES_ACCOUNT("applied_to_lines,account"), - - APPLIED_TO_LINES_ACCOUNT_ACCOUNTING_PERIOD("applied_to_lines,account,accounting_period"), - - APPLIED_TO_LINES_ACCOUNT_COMPANY("applied_to_lines,account,company"), - - APPLIED_TO_LINES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("applied_to_lines,account,company,accounting_period"), - - APPLIED_TO_LINES_ACCOUNTING_PERIOD("applied_to_lines,accounting_period"), - - APPLIED_TO_LINES_COMPANY("applied_to_lines,company"), - - APPLIED_TO_LINES_COMPANY_ACCOUNTING_PERIOD("applied_to_lines,company,accounting_period"), - - APPLIED_TO_LINES_CONTACT("applied_to_lines,contact"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT("applied_to_lines,contact,account"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("applied_to_lines,contact,account,accounting_period"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY("applied_to_lines,contact,account,company"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "applied_to_lines,contact,account,company,accounting_period"), - - APPLIED_TO_LINES_CONTACT_ACCOUNTING_PERIOD("applied_to_lines,contact,accounting_period"), - - APPLIED_TO_LINES_CONTACT_COMPANY("applied_to_lines,contact,company"), - - APPLIED_TO_LINES_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_to_lines,contact,company,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNT("contact,account"), - - CONTACT_ACCOUNT_ACCOUNTING_PERIOD("contact,account,accounting_period"), - - CONTACT_ACCOUNT_COMPANY("contact,account,company"), - - CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("contact,account,company,accounting_period"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNT("tracking_categories,account"), - - TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,account,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY("tracking_categories,account,company"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,account,company,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES("tracking_categories,applied_to_lines"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT("tracking_categories,applied_to_lines,account"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,account,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT_COMPANY("tracking_categories,applied_to_lines,account,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,account,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNTING_PERIOD("tracking_categories,applied_to_lines,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_COMPANY("tracking_categories,applied_to_lines,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT("tracking_categories,applied_to_lines,contact"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT("tracking_categories,applied_to_lines,contact,account"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,account,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY( - "tracking_categories,applied_to_lines,contact,account,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,account,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_COMPANY("tracking_categories,applied_to_lines,contact,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,company,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT("tracking_categories,contact,account"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,contact,account,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_COMPANY("tracking_categories,contact,account,company"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,contact,account,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"); - - private final String value; - - PaymentsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/payments/types/PaymentsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/payments/types/PaymentsRetrieveRequestExpand.java deleted file mode 100644 index ebc5f9912..000000000 --- a/src/main/java/com/merge/api/resources/accounting/payments/types/PaymentsRetrieveRequestExpand.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.payments.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum PaymentsRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ACCOUNTING_PERIOD("account,accounting_period"), - - ACCOUNT_COMPANY("account,company"), - - ACCOUNT_COMPANY_ACCOUNTING_PERIOD("account,company,accounting_period"), - - ACCOUNTING_PERIOD("accounting_period"), - - APPLIED_TO_LINES("applied_to_lines"), - - APPLIED_TO_LINES_ACCOUNT("applied_to_lines,account"), - - APPLIED_TO_LINES_ACCOUNT_ACCOUNTING_PERIOD("applied_to_lines,account,accounting_period"), - - APPLIED_TO_LINES_ACCOUNT_COMPANY("applied_to_lines,account,company"), - - APPLIED_TO_LINES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("applied_to_lines,account,company,accounting_period"), - - APPLIED_TO_LINES_ACCOUNTING_PERIOD("applied_to_lines,accounting_period"), - - APPLIED_TO_LINES_COMPANY("applied_to_lines,company"), - - APPLIED_TO_LINES_COMPANY_ACCOUNTING_PERIOD("applied_to_lines,company,accounting_period"), - - APPLIED_TO_LINES_CONTACT("applied_to_lines,contact"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT("applied_to_lines,contact,account"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("applied_to_lines,contact,account,accounting_period"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY("applied_to_lines,contact,account,company"), - - APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "applied_to_lines,contact,account,company,accounting_period"), - - APPLIED_TO_LINES_CONTACT_ACCOUNTING_PERIOD("applied_to_lines,contact,accounting_period"), - - APPLIED_TO_LINES_CONTACT_COMPANY("applied_to_lines,contact,company"), - - APPLIED_TO_LINES_CONTACT_COMPANY_ACCOUNTING_PERIOD("applied_to_lines,contact,company,accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNT("contact,account"), - - CONTACT_ACCOUNT_ACCOUNTING_PERIOD("contact,account,accounting_period"), - - CONTACT_ACCOUNT_COMPANY("contact,account,company"), - - CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("contact,account,company,accounting_period"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - CONTACT_COMPANY("contact,company"), - - CONTACT_COMPANY_ACCOUNTING_PERIOD("contact,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNT("tracking_categories,account"), - - TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,account,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY("tracking_categories,account,company"), - - TRACKING_CATEGORIES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,account,company,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES("tracking_categories,applied_to_lines"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT("tracking_categories,applied_to_lines,account"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,account,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT_COMPANY("tracking_categories,applied_to_lines,account,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,account,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_ACCOUNTING_PERIOD("tracking_categories,applied_to_lines,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_COMPANY("tracking_categories,applied_to_lines,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT("tracking_categories,applied_to_lines,contact"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT("tracking_categories,applied_to_lines,contact,account"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,account,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY( - "tracking_categories,applied_to_lines,contact,account,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,account,company,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,accounting_period"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_COMPANY("tracking_categories,applied_to_lines,contact,company"), - - TRACKING_CATEGORIES_APPLIED_TO_LINES_CONTACT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,applied_to_lines,contact,company,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT("tracking_categories,contact,account"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,contact,account,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_COMPANY("tracking_categories,contact,account,company"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,contact,account,company,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_COMPANY("tracking_categories,contact,company"), - - TRACKING_CATEGORIES_CONTACT_COMPANY_ACCOUNTING_PERIOD("tracking_categories,contact,company,accounting_period"); - - private final String value; - - PaymentsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/phonenumbers/PhoneNumbersClient.java b/src/main/java/com/merge/api/resources/accounting/phonenumbers/PhoneNumbersClient.java deleted file mode 100644 index 7475f690a..000000000 --- a/src/main/java/com/merge/api/resources/accounting/phonenumbers/PhoneNumbersClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.phonenumbers; - -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.phonenumbers.requests.PhoneNumbersRetrieveRequest; -import com.merge.api.resources.accounting.types.AccountingPhoneNumber; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PhoneNumbersClient { - protected final ClientOptions clientOptions; - - public PhoneNumbersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns an AccountingPhoneNumber object with the given id. - */ - public AccountingPhoneNumber retrieve(String id) { - return retrieve(id, PhoneNumbersRetrieveRequest.builder().build()); - } - - /** - * Returns an AccountingPhoneNumber object with the given id. - */ - public AccountingPhoneNumber retrieve(String id, PhoneNumbersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an AccountingPhoneNumber object with the given id. - */ - public AccountingPhoneNumber retrieve( - String id, PhoneNumbersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/phone-numbers") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), AccountingPhoneNumber.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/phonenumbers/requests/PhoneNumbersRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/phonenumbers/requests/PhoneNumbersRetrieveRequest.java deleted file mode 100644 index 11fb2e3ee..000000000 --- a/src/main/java/com/merge/api/resources/accounting/phonenumbers/requests/PhoneNumbersRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.phonenumbers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PhoneNumbersRetrieveRequest.Builder.class) -public final class PhoneNumbersRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private PhoneNumbersRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneNumbersRetrieveRequest && equalTo((PhoneNumbersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PhoneNumbersRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PhoneNumbersRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public PhoneNumbersRetrieveRequest build() { - return new PhoneNumbersRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/purchaseorders/PurchaseOrdersClient.java b/src/main/java/com/merge/api/resources/accounting/purchaseorders/PurchaseOrdersClient.java deleted file mode 100644 index 51595349d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/purchaseorders/PurchaseOrdersClient.java +++ /dev/null @@ -1,461 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.purchaseorders; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.purchaseorders.requests.PurchaseOrderEndpointRequest; -import com.merge.api.resources.accounting.purchaseorders.requests.PurchaseOrdersLineItemsRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.purchaseorders.requests.PurchaseOrdersListRequest; -import com.merge.api.resources.accounting.purchaseorders.requests.PurchaseOrdersRemoteFieldClassesListRequest; -import com.merge.api.resources.accounting.purchaseorders.requests.PurchaseOrdersRetrieveRequest; -import com.merge.api.resources.accounting.types.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedPurchaseOrderList; -import com.merge.api.resources.accounting.types.PaginatedRemoteFieldClassList; -import com.merge.api.resources.accounting.types.PurchaseOrder; -import com.merge.api.resources.accounting.types.PurchaseOrderResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PurchaseOrdersClient { - protected final ClientOptions clientOptions; - - public PurchaseOrdersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of PurchaseOrder objects. - */ - public PaginatedPurchaseOrderList list() { - return list(PurchaseOrdersListRequest.builder().build()); - } - - /** - * Returns a list of PurchaseOrder objects. - */ - public PaginatedPurchaseOrderList list(PurchaseOrdersListRequest request) { - return list(request, null); - } - - /** - * Returns a list of PurchaseOrder objects. - */ - public PaginatedPurchaseOrderList list(PurchaseOrdersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/purchase-orders"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIssueDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "issue_date_after", request.getIssueDateAfter().get().toString()); - } - if (request.getIssueDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "issue_date_before", request.getIssueDateBefore().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedPurchaseOrderList.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); - } - } - - /** - * Creates a PurchaseOrder object with the given values. - */ - public PurchaseOrderResponse create(PurchaseOrderEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a PurchaseOrder object with the given values. - */ - public PurchaseOrderResponse create(PurchaseOrderEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/purchase-orders"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PurchaseOrderResponse.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); - } - } - - /** - * Returns a PurchaseOrder object with the given id. - */ - public PurchaseOrder retrieve(String id) { - return retrieve(id, PurchaseOrdersRetrieveRequest.builder().build()); - } - - /** - * Returns a PurchaseOrder object with the given id. - */ - public PurchaseOrder retrieve(String id, PurchaseOrdersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a PurchaseOrder object with the given id. - */ - public PurchaseOrder retrieve(String id, PurchaseOrdersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/purchase-orders") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PurchaseOrder.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList() { - return lineItemsRemoteFieldClassesList( - PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList( - PurchaseOrdersLineItemsRemoteFieldClassesListRequest request) { - return lineItemsRemoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList lineItemsRemoteFieldClassesList( - PurchaseOrdersLineItemsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/purchase-orders/line-items/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } - - /** - * Returns metadata for PurchaseOrder POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for PurchaseOrder POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/purchase-orders/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - PurchaseOrdersRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(PurchaseOrdersRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - PurchaseOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/purchase-orders/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/purchaseorders/types/PurchaseOrdersListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/purchaseorders/types/PurchaseOrdersListRequestExpand.java deleted file mode 100644 index f8d55ecbf..000000000 --- a/src/main/java/com/merge/api/resources/accounting/purchaseorders/types/PurchaseOrdersListRequestExpand.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.purchaseorders.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum PurchaseOrdersListRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - DELIVERY_ADDRESS("delivery_address"), - - DELIVERY_ADDRESS_ACCOUNTING_PERIOD("delivery_address,accounting_period"), - - DELIVERY_ADDRESS_COMPANY("delivery_address,company"), - - DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD("delivery_address,company,accounting_period"), - - DELIVERY_ADDRESS_VENDOR("delivery_address,vendor"), - - DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD("delivery_address,vendor,accounting_period"), - - DELIVERY_ADDRESS_VENDOR_COMPANY("delivery_address,vendor,company"), - - DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD("delivery_address,vendor,company,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_COMPANY("line_items,company"), - - LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("line_items,company,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS("line_items,delivery_address"), - - LINE_ITEMS_DELIVERY_ADDRESS_ACCOUNTING_PERIOD("line_items,delivery_address,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS_COMPANY("line_items,delivery_address,company"), - - LINE_ITEMS_DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD("line_items,delivery_address,company,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR("line_items,delivery_address,vendor"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD("line_items,delivery_address,vendor,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR_COMPANY("line_items,delivery_address,vendor,company"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "line_items,delivery_address,vendor,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("line_items,tracking_categories,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS("line_items,tracking_categories,delivery_address"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY("line_items,tracking_categories,delivery_address,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR("line_items,tracking_categories,delivery_address,vendor"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,vendor,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY( - "line_items,tracking_categories,delivery_address,vendor,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,vendor,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR("line_items,tracking_categories,vendor"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("line_items,tracking_categories,vendor,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR_COMPANY("line_items,tracking_categories,vendor,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,vendor,company,accounting_period"), - - LINE_ITEMS_VENDOR("line_items,vendor"), - - LINE_ITEMS_VENDOR_ACCOUNTING_PERIOD("line_items,vendor,accounting_period"), - - LINE_ITEMS_VENDOR_COMPANY("line_items,vendor,company"), - - LINE_ITEMS_VENDOR_COMPANY_ACCOUNTING_PERIOD("line_items,vendor,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS("tracking_categories,delivery_address"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_ACCOUNTING_PERIOD("tracking_categories,delivery_address,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY("tracking_categories,delivery_address,company"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,delivery_address,company,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR("tracking_categories,delivery_address,vendor"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD( - "tracking_categories,delivery_address,vendor,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY("tracking_categories,delivery_address,vendor,company"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,delivery_address,vendor,company,accounting_period"), - - TRACKING_CATEGORIES_VENDOR("tracking_categories,vendor"), - - TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("tracking_categories,vendor,accounting_period"), - - TRACKING_CATEGORIES_VENDOR_COMPANY("tracking_categories,vendor,company"), - - TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD("tracking_categories,vendor,company,accounting_period"), - - VENDOR("vendor"), - - VENDOR_ACCOUNTING_PERIOD("vendor,accounting_period"), - - VENDOR_COMPANY("vendor,company"), - - VENDOR_COMPANY_ACCOUNTING_PERIOD("vendor,company,accounting_period"); - - private final String value; - - PurchaseOrdersListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/purchaseorders/types/PurchaseOrdersRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/purchaseorders/types/PurchaseOrdersRetrieveRequestExpand.java deleted file mode 100644 index 664dadb64..000000000 --- a/src/main/java/com/merge/api/resources/accounting/purchaseorders/types/PurchaseOrdersRetrieveRequestExpand.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.purchaseorders.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum PurchaseOrdersRetrieveRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - DELIVERY_ADDRESS("delivery_address"), - - DELIVERY_ADDRESS_ACCOUNTING_PERIOD("delivery_address,accounting_period"), - - DELIVERY_ADDRESS_COMPANY("delivery_address,company"), - - DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD("delivery_address,company,accounting_period"), - - DELIVERY_ADDRESS_VENDOR("delivery_address,vendor"), - - DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD("delivery_address,vendor,accounting_period"), - - DELIVERY_ADDRESS_VENDOR_COMPANY("delivery_address,vendor,company"), - - DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD("delivery_address,vendor,company,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_COMPANY("line_items,company"), - - LINE_ITEMS_COMPANY_ACCOUNTING_PERIOD("line_items,company,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS("line_items,delivery_address"), - - LINE_ITEMS_DELIVERY_ADDRESS_ACCOUNTING_PERIOD("line_items,delivery_address,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS_COMPANY("line_items,delivery_address,company"), - - LINE_ITEMS_DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD("line_items,delivery_address,company,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR("line_items,delivery_address,vendor"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD("line_items,delivery_address,vendor,accounting_period"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR_COMPANY("line_items,delivery_address,vendor,company"), - - LINE_ITEMS_DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "line_items,delivery_address,vendor,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY("line_items,tracking_categories,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS("line_items,tracking_categories,delivery_address"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY("line_items,tracking_categories,delivery_address,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR("line_items,tracking_categories,delivery_address,vendor"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,vendor,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY( - "line_items,tracking_categories,delivery_address,vendor,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,delivery_address,vendor,company,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR("line_items,tracking_categories,vendor"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("line_items,tracking_categories,vendor,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR_COMPANY("line_items,tracking_categories,vendor,company"), - - LINE_ITEMS_TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "line_items,tracking_categories,vendor,company,accounting_period"), - - LINE_ITEMS_VENDOR("line_items,vendor"), - - LINE_ITEMS_VENDOR_ACCOUNTING_PERIOD("line_items,vendor,accounting_period"), - - LINE_ITEMS_VENDOR_COMPANY("line_items,vendor,company"), - - LINE_ITEMS_VENDOR_COMPANY_ACCOUNTING_PERIOD("line_items,vendor,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS("tracking_categories,delivery_address"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_ACCOUNTING_PERIOD("tracking_categories,delivery_address,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY("tracking_categories,delivery_address,company"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,delivery_address,company,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR("tracking_categories,delivery_address,vendor"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_ACCOUNTING_PERIOD( - "tracking_categories,delivery_address,vendor,accounting_period"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY("tracking_categories,delivery_address,vendor,company"), - - TRACKING_CATEGORIES_DELIVERY_ADDRESS_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "tracking_categories,delivery_address,vendor,company,accounting_period"), - - TRACKING_CATEGORIES_VENDOR("tracking_categories,vendor"), - - TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("tracking_categories,vendor,accounting_period"), - - TRACKING_CATEGORIES_VENDOR_COMPANY("tracking_categories,vendor,company"), - - TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD("tracking_categories,vendor,company,accounting_period"), - - VENDOR("vendor"), - - VENDOR_ACCOUNTING_PERIOD("vendor,accounting_period"), - - VENDOR_COMPANY("vendor,company"), - - VENDOR_COMPANY_ACCOUNTING_PERIOD("vendor,company,accounting_period"); - - private final String value; - - PurchaseOrdersRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/api/resources/accounting/regeneratekey/RegenerateKeyClient.java deleted file mode 100644 index f599650e1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/regeneratekey/RegenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.regeneratekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.regeneratekey.requests.RemoteKeyForRegenerationRequest; -import com.merge.api.resources.accounting.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RegenerateKeyClient { - protected final ClientOptions clientOptions; - - public RegenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request) { - return create(request, null); - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/regenerate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/resources/accounting/regeneratekey/requests/RemoteKeyForRegenerationRequest.java deleted file mode 100644 index 18851bdcb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/regeneratekey/requests/RemoteKeyForRegenerationRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.regeneratekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) -public final class RemoteKeyForRegenerationRequest { - private final String name; - - private final Map additionalProperties; - - private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKeyForRegenerationRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(RemoteKeyForRegenerationRequest other); - } - - public interface _FinalStage { - RemoteKeyForRegenerationRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKeyForRegenerationRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public RemoteKeyForRegenerationRequest build() { - return new RemoteKeyForRegenerationRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/scopes/ScopesClient.java b/src/main/java/com/merge/api/resources/accounting/scopes/ScopesClient.java deleted file mode 100644 index 7d46051ff..000000000 --- a/src/main/java/com/merge/api/resources/accounting/scopes/ScopesClient.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.scopes; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.accounting.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; -import com.merge.api.resources.accounting.types.CommonModelScopeApi; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ScopesClient { - protected final ClientOptions clientOptions; - - public ScopesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve() { - return defaultScopesRetrieve(null); - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/default-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve() { - return linkedAccountScopesRetrieve(null); - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/linked-account-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { - return linkedAccountScopesCreate(request, null); - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate( - LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/linked-account-scopes") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/accounting/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 6be494618..000000000 --- a/src/main/java/com/merge/api/resources/accounting/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.scopes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.types.IndividualCommonModelScopeDeserializerRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) -public final class LinkedAccountCommonModelScopeDeserializerRequest { - private final List commonModels; - - private final Map additionalProperties; - - private LinkedAccountCommonModelScopeDeserializerRequest( - List commonModels, - Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountCommonModelScopeDeserializerRequest - && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public LinkedAccountCommonModelScopeDeserializerRequest build() { - return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/api/resources/accounting/syncstatus/SyncStatusClient.java deleted file mode 100644 index e7c72bf3c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/syncstatus/SyncStatusClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.syncstatus; - -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.syncstatus.requests.SyncStatusListRequest; -import com.merge.api.resources.accounting.types.PaginatedSyncStatusList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SyncStatusClient { - protected final ClientOptions clientOptions; - - public SyncStatusClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list() { - return list(SyncStatusListRequest.builder().build()); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request) { - return list(request, null); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/sync-status"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedSyncStatusList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/api/resources/accounting/syncstatus/requests/SyncStatusListRequest.java deleted file mode 100644 index 3e50894d8..000000000 --- a/src/main/java/com/merge/api/resources/accounting/syncstatus/requests/SyncStatusListRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.syncstatus.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) -public final class SyncStatusListRequest { - private final Optional cursor; - - private final Optional pageSize; - - private final Map additionalProperties; - - private SyncStatusListRequest( - Optional cursor, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatusListRequest other) { - return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(SyncStatusListRequest other) { - cursor(other.getCursor()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public SyncStatusListRequest build() { - return new SyncStatusListRequest(cursor, pageSize, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/taxrates/TaxRatesClient.java b/src/main/java/com/merge/api/resources/accounting/taxrates/TaxRatesClient.java deleted file mode 100644 index 3b768fd30..000000000 --- a/src/main/java/com/merge/api/resources/accounting/taxrates/TaxRatesClient.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.taxrates; - -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.taxrates.requests.TaxRatesListRequest; -import com.merge.api.resources.accounting.taxrates.requests.TaxRatesRetrieveRequest; -import com.merge.api.resources.accounting.types.PaginatedTaxRateList; -import com.merge.api.resources.accounting.types.TaxRate; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TaxRatesClient { - protected final ClientOptions clientOptions; - - public TaxRatesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of TaxRate objects. - */ - public PaginatedTaxRateList list() { - return list(TaxRatesListRequest.builder().build()); - } - - /** - * Returns a list of TaxRate objects. - */ - public PaginatedTaxRateList list(TaxRatesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of TaxRate objects. - */ - public PaginatedTaxRateList list(TaxRatesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/tax-rates"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTaxRateList.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); - } - } - - /** - * Returns a TaxRate object with the given id. - */ - public TaxRate retrieve(String id) { - return retrieve(id, TaxRatesRetrieveRequest.builder().build()); - } - - /** - * Returns a TaxRate object with the given id. - */ - public TaxRate retrieve(String id, TaxRatesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a TaxRate object with the given id. - */ - public TaxRate retrieve(String id, TaxRatesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/tax-rates") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TaxRate.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/taxrates/requests/TaxRatesRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/taxrates/requests/TaxRatesRetrieveRequest.java deleted file mode 100644 index f5c825ed7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/taxrates/requests/TaxRatesRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.taxrates.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TaxRatesRetrieveRequest.Builder.class) -public final class TaxRatesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private TaxRatesRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TaxRatesRetrieveRequest && equalTo((TaxRatesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TaxRatesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TaxRatesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public TaxRatesRetrieveRequest build() { - return new TaxRatesRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/trackingcategories/TrackingCategoriesClient.java b/src/main/java/com/merge/api/resources/accounting/trackingcategories/TrackingCategoriesClient.java deleted file mode 100644 index eabad40e7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/trackingcategories/TrackingCategoriesClient.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.trackingcategories; - -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.trackingcategories.requests.TrackingCategoriesListRequest; -import com.merge.api.resources.accounting.trackingcategories.requests.TrackingCategoriesRetrieveRequest; -import com.merge.api.resources.accounting.types.PaginatedTrackingCategoryList; -import com.merge.api.resources.accounting.types.TrackingCategory; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TrackingCategoriesClient { - protected final ClientOptions clientOptions; - - public TrackingCategoriesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of TrackingCategory objects. - */ - public PaginatedTrackingCategoryList list() { - return list(TrackingCategoriesListRequest.builder().build()); - } - - /** - * Returns a list of TrackingCategory objects. - */ - public PaginatedTrackingCategoryList list(TrackingCategoriesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of TrackingCategory objects. - */ - public PaginatedTrackingCategoryList list(TrackingCategoriesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/tracking-categories"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTrackingCategoryList.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); - } - } - - /** - * Returns a TrackingCategory object with the given id. - */ - public TrackingCategory retrieve(String id) { - return retrieve(id, TrackingCategoriesRetrieveRequest.builder().build()); - } - - /** - * Returns a TrackingCategory object with the given id. - */ - public TrackingCategory retrieve(String id, TrackingCategoriesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a TrackingCategory object with the given id. - */ - public TrackingCategory retrieve( - String id, TrackingCategoriesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/tracking-categories") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TrackingCategory.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/transactions/TransactionsClient.java b/src/main/java/com/merge/api/resources/accounting/transactions/TransactionsClient.java deleted file mode 100644 index b7727fa63..000000000 --- a/src/main/java/com/merge/api/resources/accounting/transactions/TransactionsClient.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.transactions; - -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.transactions.requests.TransactionsListRequest; -import com.merge.api.resources.accounting.transactions.requests.TransactionsRetrieveRequest; -import com.merge.api.resources.accounting.types.PaginatedTransactionList; -import com.merge.api.resources.accounting.types.Transaction; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TransactionsClient { - protected final ClientOptions clientOptions; - - public TransactionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Transaction objects. - */ - public PaginatedTransactionList list() { - return list(TransactionsListRequest.builder().build()); - } - - /** - * Returns a list of Transaction objects. - */ - public PaginatedTransactionList list(TransactionsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Transaction objects. - */ - public PaginatedTransactionList list(TransactionsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/transactions"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTransactionDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_after", - request.getTransactionDateAfter().get().toString()); - } - if (request.getTransactionDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_before", - request.getTransactionDateBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTransactionList.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); - } - } - - /** - * Returns a Transaction object with the given id. - */ - public Transaction retrieve(String id) { - return retrieve(id, TransactionsRetrieveRequest.builder().build()); - } - - /** - * Returns a Transaction object with the given id. - */ - public Transaction retrieve(String id, TransactionsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Transaction object with the given id. - */ - public Transaction retrieve(String id, TransactionsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/transactions") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Transaction.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/transactions/requests/TransactionsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/transactions/requests/TransactionsRetrieveRequest.java deleted file mode 100644 index 6d14b2dc4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/transactions/requests/TransactionsRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.transactions.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.transactions.types.TransactionsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TransactionsRetrieveRequest.Builder.class) -public final class TransactionsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private TransactionsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TransactionsRetrieveRequest && equalTo((TransactionsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TransactionsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TransactionsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(TransactionsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public TransactionsRetrieveRequest build() { - return new TransactionsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/transactions/types/TransactionsListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/transactions/types/TransactionsListRequestExpand.java deleted file mode 100644 index bf80268d0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/transactions/types/TransactionsListRequestExpand.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.transactions.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TransactionsListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ACCOUNTING_PERIOD("account,accounting_period"), - - ACCOUNTING_PERIOD("accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNT("contact,account"), - - CONTACT_ACCOUNT_ACCOUNTING_PERIOD("contact,account,accounting_period"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNT("line_items,account"), - - LINE_ITEMS_ACCOUNT_ACCOUNTING_PERIOD("line_items,account,accounting_period"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_CONTACT("line_items,contact"), - - LINE_ITEMS_CONTACT_ACCOUNT("line_items,contact,account"), - - LINE_ITEMS_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("line_items,contact,account,accounting_period"), - - LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("line_items,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNT("line_items,tracking_categories,account"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,account,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("line_items,tracking_categories,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNT("line_items,tracking_categories,contact,account"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,account,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNT("tracking_categories,account"), - - TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,account,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT("tracking_categories,contact,account"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,contact,account,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"); - - private final String value; - - TransactionsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/transactions/types/TransactionsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/transactions/types/TransactionsRetrieveRequestExpand.java deleted file mode 100644 index 8c816c1fc..000000000 --- a/src/main/java/com/merge/api/resources/accounting/transactions/types/TransactionsRetrieveRequestExpand.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.transactions.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TransactionsRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ACCOUNTING_PERIOD("account,accounting_period"), - - ACCOUNTING_PERIOD("accounting_period"), - - CONTACT("contact"), - - CONTACT_ACCOUNT("contact,account"), - - CONTACT_ACCOUNT_ACCOUNTING_PERIOD("contact,account,accounting_period"), - - CONTACT_ACCOUNTING_PERIOD("contact,accounting_period"), - - LINE_ITEMS("line_items"), - - LINE_ITEMS_ACCOUNT("line_items,account"), - - LINE_ITEMS_ACCOUNT_ACCOUNTING_PERIOD("line_items,account,accounting_period"), - - LINE_ITEMS_ACCOUNTING_PERIOD("line_items,accounting_period"), - - LINE_ITEMS_CONTACT("line_items,contact"), - - LINE_ITEMS_CONTACT_ACCOUNT("line_items,contact,account"), - - LINE_ITEMS_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("line_items,contact,account,accounting_period"), - - LINE_ITEMS_CONTACT_ACCOUNTING_PERIOD("line_items,contact,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES("line_items,tracking_categories"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNT("line_items,tracking_categories,account"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,account,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("line_items,tracking_categories,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT("line_items,tracking_categories,contact"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNT("line_items,tracking_categories,contact,account"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,account,accounting_period"), - - LINE_ITEMS_TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD( - "line_items,tracking_categories,contact,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNT("tracking_categories,account"), - - TRACKING_CATEGORIES_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,account,accounting_period"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_CONTACT("tracking_categories,contact"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT("tracking_categories,contact,account"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNT_ACCOUNTING_PERIOD("tracking_categories,contact,account,accounting_period"), - - TRACKING_CATEGORIES_CONTACT_ACCOUNTING_PERIOD("tracking_categories,contact,accounting_period"); - - private final String value; - - TransactionsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Account.java b/src/main/java/com/merge/api/resources/accounting/types/Account.java deleted file mode 100644 index cdf071ea9..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/Account.java +++ /dev/null @@ -1,925 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Account.Builder.class) -public final class Account { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional description; - - private final Optional classification; - - private final Optional type; - - private final Optional accountType; - - private final Optional status; - - private final Optional currentBalance; - - private final Optional currency; - - private final Optional accountNumber; - - private final Optional parentAccount; - - private final Optional company; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Account( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional description, - Optional classification, - Optional type, - Optional accountType, - Optional status, - Optional currentBalance, - Optional currency, - Optional accountNumber, - Optional parentAccount, - Optional company, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.description = description; - this.classification = classification; - this.type = type; - this.accountType = accountType; - this.status = status; - this.currentBalance = currentBalance; - this.currency = currency; - this.accountNumber = accountNumber; - this.parentAccount = parentAccount; - this.company = company; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The account's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The account's description. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return The account's broadest grouping. - *
    - *
  • ASSET - ASSET
  • - *
  • EQUITY - EQUITY
  • - *
  • EXPENSE - EXPENSE
  • - *
  • LIABILITY - LIABILITY
  • - *
  • REVENUE - REVENUE
  • - *
- */ - @JsonProperty("classification") - public Optional getClassification() { - return classification; - } - - /** - * @return The account's type is a narrower and more specific grouping within the account's classification. - */ - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return Normalized account type- which is a narrower and more specific grouping within the account's classification. - *
    - *
  • BANK - BANK
  • - *
  • CREDIT_CARD - CREDIT_CARD
  • - *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • - *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • - *
  • FIXED_ASSET - FIXED_ASSET
  • - *
  • OTHER_ASSET - OTHER_ASSET
  • - *
  • OTHER_CURRENT_ASSET - OTHER_CURRENT_ASSET
  • - *
  • OTHER_EXPENSE - OTHER_EXPENSE
  • - *
  • OTHER_INCOME - OTHER_INCOME
  • - *
  • COST_OF_GOODS_SOLD - COST_OF_GOODS_SOLD
  • - *
  • OTHER_CURRENT_LIABILITY - OTHER_CURRENT_LIABILITY
  • - *
  • LONG_TERM_LIABILITY - LONG_TERM_LIABILITY
  • - *
  • NON_POSTING - NON_POSTING
  • - *
- */ - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The account's status. - *
    - *
  • ACTIVE - ACTIVE
  • - *
  • PENDING - PENDING
  • - *
  • INACTIVE - INACTIVE
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - /** - * @return The account's current balance. - */ - @JsonProperty("current_balance") - public Optional getCurrentBalance() { - return currentBalance; - } - - /** - * @return The account's currency. - *
    - *
  • XUA - ADB Unit of Account
  • - *
  • AFN - Afghan Afghani
  • - *
  • AFA - Afghan Afghani (1927–2002)
  • - *
  • ALL - Albanian Lek
  • - *
  • ALK - Albanian Lek (1946–1965)
  • - *
  • DZD - Algerian Dinar
  • - *
  • ADP - Andorran Peseta
  • - *
  • AOA - Angolan Kwanza
  • - *
  • AOK - Angolan Kwanza (1977–1991)
  • - *
  • AON - Angolan New Kwanza (1990–2000)
  • - *
  • AOR - Angolan Readjusted Kwanza (1995–1999)
  • - *
  • ARA - Argentine Austral
  • - *
  • ARS - Argentine Peso
  • - *
  • ARM - Argentine Peso (1881–1970)
  • - *
  • ARP - Argentine Peso (1983–1985)
  • - *
  • ARL - Argentine Peso Ley (1970–1983)
  • - *
  • AMD - Armenian Dram
  • - *
  • AWG - Aruban Florin
  • - *
  • AUD - Australian Dollar
  • - *
  • ATS - Austrian Schilling
  • - *
  • AZN - Azerbaijani Manat
  • - *
  • AZM - Azerbaijani Manat (1993–2006)
  • - *
  • BSD - Bahamian Dollar
  • - *
  • BHD - Bahraini Dinar
  • - *
  • BDT - Bangladeshi Taka
  • - *
  • BBD - Barbadian Dollar
  • - *
  • BYN - Belarusian Ruble
  • - *
  • BYB - Belarusian Ruble (1994–1999)
  • - *
  • BYR - Belarusian Ruble (2000–2016)
  • - *
  • BEF - Belgian Franc
  • - *
  • BEC - Belgian Franc (convertible)
  • - *
  • BEL - Belgian Franc (financial)
  • - *
  • BZD - Belize Dollar
  • - *
  • BMD - Bermudan Dollar
  • - *
  • BTN - Bhutanese Ngultrum
  • - *
  • BOB - Bolivian Boliviano
  • - *
  • BOL - Bolivian Boliviano (1863–1963)
  • - *
  • BOV - Bolivian Mvdol
  • - *
  • BOP - Bolivian Peso
  • - *
  • BAM - Bosnia-Herzegovina Convertible Mark
  • - *
  • BAD - Bosnia-Herzegovina Dinar (1992–1994)
  • - *
  • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
  • - *
  • BWP - Botswanan Pula
  • - *
  • BRC - Brazilian Cruzado (1986–1989)
  • - *
  • BRZ - Brazilian Cruzeiro (1942–1967)
  • - *
  • BRE - Brazilian Cruzeiro (1990–1993)
  • - *
  • BRR - Brazilian Cruzeiro (1993–1994)
  • - *
  • BRN - Brazilian New Cruzado (1989–1990)
  • - *
  • BRB - Brazilian New Cruzeiro (1967–1986)
  • - *
  • BRL - Brazilian Real
  • - *
  • GBP - British Pound
  • - *
  • BND - Brunei Dollar
  • - *
  • BGL - Bulgarian Hard Lev
  • - *
  • BGN - Bulgarian Lev
  • - *
  • BGO - Bulgarian Lev (1879–1952)
  • - *
  • BGM - Bulgarian Socialist Lev
  • - *
  • BUK - Burmese Kyat
  • - *
  • BIF - Burundian Franc
  • - *
  • XPF - CFP Franc
  • - *
  • KHR - Cambodian Riel
  • - *
  • CAD - Canadian Dollar
  • - *
  • CVE - Cape Verdean Escudo
  • - *
  • KYD - Cayman Islands Dollar
  • - *
  • XAF - Central African CFA Franc
  • - *
  • CLE - Chilean Escudo
  • - *
  • CLP - Chilean Peso
  • - *
  • CLF - Chilean Unit of Account (UF)
  • - *
  • CNX - Chinese People’s Bank Dollar
  • - *
  • CNY - Chinese Yuan
  • - *
  • CNH - Chinese Yuan (offshore)
  • - *
  • COP - Colombian Peso
  • - *
  • COU - Colombian Real Value Unit
  • - *
  • KMF - Comorian Franc
  • - *
  • CDF - Congolese Franc
  • - *
  • CRC - Costa Rican Colón
  • - *
  • HRD - Croatian Dinar
  • - *
  • HRK - Croatian Kuna
  • - *
  • CUC - Cuban Convertible Peso
  • - *
  • CUP - Cuban Peso
  • - *
  • CYP - Cypriot Pound
  • - *
  • CZK - Czech Koruna
  • - *
  • CSK - Czechoslovak Hard Koruna
  • - *
  • DKK - Danish Krone
  • - *
  • DJF - Djiboutian Franc
  • - *
  • DOP - Dominican Peso
  • - *
  • NLG - Dutch Guilder
  • - *
  • XCD - East Caribbean Dollar
  • - *
  • DDM - East German Mark
  • - *
  • ECS - Ecuadorian Sucre
  • - *
  • ECV - Ecuadorian Unit of Constant Value
  • - *
  • EGP - Egyptian Pound
  • - *
  • GQE - Equatorial Guinean Ekwele
  • - *
  • ERN - Eritrean Nakfa
  • - *
  • EEK - Estonian Kroon
  • - *
  • ETB - Ethiopian Birr
  • - *
  • EUR - Euro
  • - *
  • XBA - European Composite Unit
  • - *
  • XEU - European Currency Unit
  • - *
  • XBB - European Monetary Unit
  • - *
  • XBC - European Unit of Account (XBC)
  • - *
  • XBD - European Unit of Account (XBD)
  • - *
  • FKP - Falkland Islands Pound
  • - *
  • FJD - Fijian Dollar
  • - *
  • FIM - Finnish Markka
  • - *
  • FRF - French Franc
  • - *
  • XFO - French Gold Franc
  • - *
  • XFU - French UIC-Franc
  • - *
  • GMD - Gambian Dalasi
  • - *
  • GEK - Georgian Kupon Larit
  • - *
  • GEL - Georgian Lari
  • - *
  • DEM - German Mark
  • - *
  • GHS - Ghanaian Cedi
  • - *
  • GHC - Ghanaian Cedi (1979–2007)
  • - *
  • GIP - Gibraltar Pound
  • - *
  • XAU - Gold
  • - *
  • GRD - Greek Drachma
  • - *
  • GTQ - Guatemalan Quetzal
  • - *
  • GWP - Guinea-Bissau Peso
  • - *
  • GNF - Guinean Franc
  • - *
  • GNS - Guinean Syli
  • - *
  • GYD - Guyanaese Dollar
  • - *
  • HTG - Haitian Gourde
  • - *
  • HNL - Honduran Lempira
  • - *
  • HKD - Hong Kong Dollar
  • - *
  • HUF - Hungarian Forint
  • - *
  • IMP - IMP
  • - *
  • ISK - Icelandic Króna
  • - *
  • ISJ - Icelandic Króna (1918–1981)
  • - *
  • INR - Indian Rupee
  • - *
  • IDR - Indonesian Rupiah
  • - *
  • IRR - Iranian Rial
  • - *
  • IQD - Iraqi Dinar
  • - *
  • IEP - Irish Pound
  • - *
  • ILS - Israeli New Shekel
  • - *
  • ILP - Israeli Pound
  • - *
  • ILR - Israeli Shekel (1980–1985)
  • - *
  • ITL - Italian Lira
  • - *
  • JMD - Jamaican Dollar
  • - *
  • JPY - Japanese Yen
  • - *
  • JOD - Jordanian Dinar
  • - *
  • KZT - Kazakhstani Tenge
  • - *
  • KES - Kenyan Shilling
  • - *
  • KWD - Kuwaiti Dinar
  • - *
  • KGS - Kyrgystani Som
  • - *
  • LAK - Laotian Kip
  • - *
  • LVL - Latvian Lats
  • - *
  • LVR - Latvian Ruble
  • - *
  • LBP - Lebanese Pound
  • - *
  • LSL - Lesotho Loti
  • - *
  • LRD - Liberian Dollar
  • - *
  • LYD - Libyan Dinar
  • - *
  • LTL - Lithuanian Litas
  • - *
  • LTT - Lithuanian Talonas
  • - *
  • LUL - Luxembourg Financial Franc
  • - *
  • LUC - Luxembourgian Convertible Franc
  • - *
  • LUF - Luxembourgian Franc
  • - *
  • MOP - Macanese Pataca
  • - *
  • MKD - Macedonian Denar
  • - *
  • MKN - Macedonian Denar (1992–1993)
  • - *
  • MGA - Malagasy Ariary
  • - *
  • MGF - Malagasy Franc
  • - *
  • MWK - Malawian Kwacha
  • - *
  • MYR - Malaysian Ringgit
  • - *
  • MVR - Maldivian Rufiyaa
  • - *
  • MVP - Maldivian Rupee (1947–1981)
  • - *
  • MLF - Malian Franc
  • - *
  • MTL - Maltese Lira
  • - *
  • MTP - Maltese Pound
  • - *
  • MRU - Mauritanian Ouguiya
  • - *
  • MRO - Mauritanian Ouguiya (1973–2017)
  • - *
  • MUR - Mauritian Rupee
  • - *
  • MXV - Mexican Investment Unit
  • - *
  • MXN - Mexican Peso
  • - *
  • MXP - Mexican Silver Peso (1861–1992)
  • - *
  • MDC - Moldovan Cupon
  • - *
  • MDL - Moldovan Leu
  • - *
  • MCF - Monegasque Franc
  • - *
  • MNT - Mongolian Tugrik
  • - *
  • MAD - Moroccan Dirham
  • - *
  • MAF - Moroccan Franc
  • - *
  • MZE - Mozambican Escudo
  • - *
  • MZN - Mozambican Metical
  • - *
  • MZM - Mozambican Metical (1980–2006)
  • - *
  • MMK - Myanmar Kyat
  • - *
  • NAD - Namibian Dollar
  • - *
  • NPR - Nepalese Rupee
  • - *
  • ANG - Netherlands Antillean Guilder
  • - *
  • TWD - New Taiwan Dollar
  • - *
  • NZD - New Zealand Dollar
  • - *
  • NIO - Nicaraguan Córdoba
  • - *
  • NIC - Nicaraguan Córdoba (1988–1991)
  • - *
  • NGN - Nigerian Naira
  • - *
  • KPW - North Korean Won
  • - *
  • NOK - Norwegian Krone
  • - *
  • OMR - Omani Rial
  • - *
  • PKR - Pakistani Rupee
  • - *
  • XPD - Palladium
  • - *
  • PAB - Panamanian Balboa
  • - *
  • PGK - Papua New Guinean Kina
  • - *
  • PYG - Paraguayan Guarani
  • - *
  • PEI - Peruvian Inti
  • - *
  • PEN - Peruvian Sol
  • - *
  • PES - Peruvian Sol (1863–1965)
  • - *
  • PHP - Philippine Peso
  • - *
  • XPT - Platinum
  • - *
  • PLN - Polish Zloty
  • - *
  • PLZ - Polish Zloty (1950–1995)
  • - *
  • PTE - Portuguese Escudo
  • - *
  • GWE - Portuguese Guinea Escudo
  • - *
  • QAR - Qatari Rial
  • - *
  • XRE - RINET Funds
  • - *
  • RHD - Rhodesian Dollar
  • - *
  • RON - Romanian Leu
  • - *
  • ROL - Romanian Leu (1952–2006)
  • - *
  • RUB - Russian Ruble
  • - *
  • RUR - Russian Ruble (1991–1998)
  • - *
  • RWF - Rwandan Franc
  • - *
  • SVC - Salvadoran Colón
  • - *
  • WST - Samoan Tala
  • - *
  • SAR - Saudi Riyal
  • - *
  • RSD - Serbian Dinar
  • - *
  • CSD - Serbian Dinar (2002–2006)
  • - *
  • SCR - Seychellois Rupee
  • - *
  • SLL - Sierra Leonean Leone
  • - *
  • XAG - Silver
  • - *
  • SGD - Singapore Dollar
  • - *
  • SKK - Slovak Koruna
  • - *
  • SIT - Slovenian Tolar
  • - *
  • SBD - Solomon Islands Dollar
  • - *
  • SOS - Somali Shilling
  • - *
  • ZAR - South African Rand
  • - *
  • ZAL - South African Rand (financial)
  • - *
  • KRH - South Korean Hwan (1953–1962)
  • - *
  • KRW - South Korean Won
  • - *
  • KRO - South Korean Won (1945–1953)
  • - *
  • SSP - South Sudanese Pound
  • - *
  • SUR - Soviet Rouble
  • - *
  • ESP - Spanish Peseta
  • - *
  • ESA - Spanish Peseta (A account)
  • - *
  • ESB - Spanish Peseta (convertible account)
  • - *
  • XDR - Special Drawing Rights
  • - *
  • LKR - Sri Lankan Rupee
  • - *
  • SHP - St. Helena Pound
  • - *
  • XSU - Sucre
  • - *
  • SDD - Sudanese Dinar (1992–2007)
  • - *
  • SDG - Sudanese Pound
  • - *
  • SDP - Sudanese Pound (1957–1998)
  • - *
  • SRD - Surinamese Dollar
  • - *
  • SRG - Surinamese Guilder
  • - *
  • SZL - Swazi Lilangeni
  • - *
  • SEK - Swedish Krona
  • - *
  • CHF - Swiss Franc
  • - *
  • SYP - Syrian Pound
  • - *
  • STN - São Tomé & Príncipe Dobra
  • - *
  • STD - São Tomé & Príncipe Dobra (1977–2017)
  • - *
  • TVD - TVD
  • - *
  • TJR - Tajikistani Ruble
  • - *
  • TJS - Tajikistani Somoni
  • - *
  • TZS - Tanzanian Shilling
  • - *
  • XTS - Testing Currency Code
  • - *
  • THB - Thai Baht
  • - *
  • XXX - The codes assigned for transactions where no currency is involved
  • - *
  • TPE - Timorese Escudo
  • - *
  • TOP - Tongan PaÊ»anga
  • - *
  • TTD - Trinidad & Tobago Dollar
  • - *
  • TND - Tunisian Dinar
  • - *
  • TRY - Turkish Lira
  • - *
  • TRL - Turkish Lira (1922–2005)
  • - *
  • TMT - Turkmenistani Manat
  • - *
  • TMM - Turkmenistani Manat (1993–2009)
  • - *
  • USD - US Dollar
  • - *
  • USN - US Dollar (Next day)
  • - *
  • USS - US Dollar (Same day)
  • - *
  • UGX - Ugandan Shilling
  • - *
  • UGS - Ugandan Shilling (1966–1987)
  • - *
  • UAH - Ukrainian Hryvnia
  • - *
  • UAK - Ukrainian Karbovanets
  • - *
  • AED - United Arab Emirates Dirham
  • - *
  • UYW - Uruguayan Nominal Wage Index Unit
  • - *
  • UYU - Uruguayan Peso
  • - *
  • UYP - Uruguayan Peso (1975–1993)
  • - *
  • UYI - Uruguayan Peso (Indexed Units)
  • - *
  • UZS - Uzbekistani Som
  • - *
  • VUV - Vanuatu Vatu
  • - *
  • VES - Venezuelan Bolívar
  • - *
  • VEB - Venezuelan Bolívar (1871–2008)
  • - *
  • VEF - Venezuelan Bolívar (2008–2018)
  • - *
  • VND - Vietnamese Dong
  • - *
  • VNN - Vietnamese Dong (1978–1985)
  • - *
  • CHE - WIR Euro
  • - *
  • CHW - WIR Franc
  • - *
  • XOF - West African CFA Franc
  • - *
  • YDD - Yemeni Dinar
  • - *
  • YER - Yemeni Rial
  • - *
  • YUN - Yugoslavian Convertible Dinar (1990–1992)
  • - *
  • YUD - Yugoslavian Hard Dinar (1966–1990)
  • - *
  • YUM - Yugoslavian New Dinar (1994–2002)
  • - *
  • YUR - Yugoslavian Reformed Dinar (1992–1993)
  • - *
  • ZWN - ZWN
  • - *
  • ZRN - Zairean New Zaire (1993–1998)
  • - *
  • ZRZ - Zairean Zaire (1971–1993)
  • - *
  • ZMW - Zambian Kwacha
  • - *
  • ZMK - Zambian Kwacha (1968–2012)
  • - *
  • ZWD - Zimbabwean Dollar (1980–2008)
  • - *
  • ZWR - Zimbabwean Dollar (2008)
  • - *
  • ZWL - Zimbabwean Dollar (2009)
  • - *
- */ - @JsonProperty("currency") - public Optional getCurrency() { - return currency; - } - - /** - * @return The account's number. - */ - @JsonProperty("account_number") - public Optional getAccountNumber() { - return accountNumber; - } - - /** - * @return ID of the parent account. - */ - @JsonProperty("parent_account") - public Optional getParentAccount() { - return parentAccount; - } - - /** - * @return The company the account belongs to. - */ - @JsonProperty("company") - public Optional getCompany() { - return company; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Account && equalTo((Account) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Account other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && description.equals(other.description) - && classification.equals(other.classification) - && type.equals(other.type) - && accountType.equals(other.accountType) - && status.equals(other.status) - && currentBalance.equals(other.currentBalance) - && currency.equals(other.currency) - && accountNumber.equals(other.accountNumber) - && parentAccount.equals(other.parentAccount) - && company.equals(other.company) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.description, - this.classification, - this.type, - this.accountType, - this.status, - this.currentBalance, - this.currency, - this.accountNumber, - this.parentAccount, - this.company, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional classification = Optional.empty(); - - private Optional type = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional currentBalance = Optional.empty(); - - private Optional currency = Optional.empty(); - - private Optional accountNumber = Optional.empty(); - - private Optional parentAccount = Optional.empty(); - - private Optional company = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Account other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - description(other.getDescription()); - classification(other.getClassification()); - type(other.getType()); - accountType(other.getAccountType()); - status(other.getStatus()); - currentBalance(other.getCurrentBalance()); - currency(other.getCurrency()); - accountNumber(other.getAccountNumber()); - parentAccount(other.getParentAccount()); - company(other.getCompany()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "classification", nulls = Nulls.SKIP) - public Builder classification(Optional classification) { - this.classification = classification; - return this; - } - - public Builder classification(AccountClassification classification) { - this.classification = Optional.ofNullable(classification); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(AccountAccountType accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(AccountStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "current_balance", nulls = Nulls.SKIP) - public Builder currentBalance(Optional currentBalance) { - this.currentBalance = currentBalance; - return this; - } - - public Builder currentBalance(Double currentBalance) { - this.currentBalance = Optional.ofNullable(currentBalance); - return this; - } - - @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { - this.currency = currency; - return this; - } - - public Builder currency(AccountCurrency currency) { - this.currency = Optional.ofNullable(currency); - return this; - } - - @JsonSetter(value = "account_number", nulls = Nulls.SKIP) - public Builder accountNumber(Optional accountNumber) { - this.accountNumber = accountNumber; - return this; - } - - public Builder accountNumber(String accountNumber) { - this.accountNumber = Optional.ofNullable(accountNumber); - return this; - } - - @JsonSetter(value = "parent_account", nulls = Nulls.SKIP) - public Builder parentAccount(Optional parentAccount) { - this.parentAccount = parentAccount; - return this; - } - - public Builder parentAccount(String parentAccount) { - this.parentAccount = Optional.ofNullable(parentAccount); - return this; - } - - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { - this.company = company; - return this; - } - - public Builder company(String company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Account build() { - return new Account( - id, - remoteId, - createdAt, - modifiedAt, - name, - description, - classification, - type, - accountType, - status, - currentBalance, - currency, - accountNumber, - parentAccount, - company, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountAccountType.java b/src/main/java/com/merge/api/resources/accounting/types/AccountAccountType.java deleted file mode 100644 index fbd63a7e8..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountAccountType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountAccountType.Deserializer.class) -public final class AccountAccountType { - private final Object value; - - private final int type; - - private AccountAccountType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AccountAccountTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountAccountType && equalTo((AccountAccountType) other); - } - - private boolean equalTo(AccountAccountType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountAccountType of(AccountAccountTypeEnum value) { - return new AccountAccountType(value, 0); - } - - public static AccountAccountType of(String value) { - return new AccountAccountType(value, 1); - } - - public interface Visitor { - T visit(AccountAccountTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountAccountType.class); - } - - @java.lang.Override - public AccountAccountType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountAccountTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountClassification.java b/src/main/java/com/merge/api/resources/accounting/types/AccountClassification.java deleted file mode 100644 index 2c96d0441..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountClassification.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountClassification.Deserializer.class) -public final class AccountClassification { - private final Object value; - - private final int type; - - private AccountClassification(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ClassificationEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountClassification && equalTo((AccountClassification) other); - } - - private boolean equalTo(AccountClassification other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountClassification of(ClassificationEnum value) { - return new AccountClassification(value, 0); - } - - public static AccountClassification of(String value) { - return new AccountClassification(value, 1); - } - - public interface Visitor { - T visit(ClassificationEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountClassification.class); - } - - @java.lang.Override - public AccountClassification deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ClassificationEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/AccountCurrency.java deleted file mode 100644 index 96ffdddd0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountCurrency.Deserializer.class) -public final class AccountCurrency { - private final Object value; - - private final int type; - - private AccountCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountCurrency && equalTo((AccountCurrency) other); - } - - private boolean equalTo(AccountCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountCurrency of(TransactionCurrencyEnum value) { - return new AccountCurrency(value, 0); - } - - public static AccountCurrency of(String value) { - return new AccountCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountCurrency.class); - } - - @java.lang.Override - public AccountCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountDetails.java b/src/main/java/com/merge/api/resources/accounting/types/AccountDetails.java deleted file mode 100644 index fc18ae146..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountDetails.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetails.Builder.class) -public final class AccountDetails { - private final Optional id; - - private final Optional integration; - - private final Optional integrationSlug; - - private final Optional category; - - private final Optional endUserOriginId; - - private final Optional endUserOrganizationName; - - private final Optional endUserEmailAddress; - - private final Optional status; - - private final Optional webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional accountType; - - private final Optional completedAt; - - private final Map additionalProperties; - - private AccountDetails( - Optional id, - Optional integration, - Optional integrationSlug, - Optional category, - Optional endUserOriginId, - Optional endUserOrganizationName, - Optional endUserEmailAddress, - Optional status, - Optional webhookListenerUrl, - Optional isDuplicate, - Optional accountType, - Optional completedAt, - Map additionalProperties) { - this.id = id; - this.integration = integration; - this.integrationSlug = integrationSlug; - this.category = category; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.status = status; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("integration_slug") - public Optional getIntegrationSlug() { - return integrationSlug; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("webhook_listener_url") - public Optional getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The time at which account completes the linking flow. - */ - @JsonProperty("completed_at") - public Optional getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetails && equalTo((AccountDetails) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetails other) { - return id.equals(other.id) - && integration.equals(other.integration) - && integrationSlug.equals(other.integrationSlug) - && category.equals(other.category) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && status.equals(other.status) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.integration, - this.integrationSlug, - this.category, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.status, - this.webhookListenerUrl, - this.isDuplicate, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional integration = Optional.empty(); - - private Optional integrationSlug = Optional.empty(); - - private Optional category = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional webhookListenerUrl = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional completedAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountDetails other) { - id(other.getId()); - integration(other.getIntegration()); - integrationSlug(other.getIntegrationSlug()); - category(other.getCategory()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - status(other.getStatus()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public Builder integration(Optional integration) { - this.integration = integration; - return this; - } - - public Builder integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) - public Builder integrationSlug(Optional integrationSlug) { - this.integrationSlug = integrationSlug; - return this; - } - - public Builder integrationSlug(String integrationSlug) { - this.integrationSlug = Optional.ofNullable(integrationSlug); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) - public Builder webhookListenerUrl(Optional webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - public Builder webhookListenerUrl(String webhookListenerUrl) { - this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); - return this; - } - - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public Builder isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - public Builder isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(String accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) - public Builder completedAt(Optional completedAt) { - this.completedAt = completedAt; - return this; - } - - public Builder completedAt(OffsetDateTime completedAt) { - this.completedAt = Optional.ofNullable(completedAt); - return this; - } - - public AccountDetails build() { - return new AccountDetails( - id, - integration, - integrationSlug, - category, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - status, - webhookListenerUrl, - isDuplicate, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActions.java deleted file mode 100644 index 4cf951ea6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActions.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) -public final class AccountDetailsAndActions { - private final String id; - - private final Optional category; - - private final AccountDetailsAndActionsStatusEnum status; - - private final Optional statusDetail; - - private final Optional endUserOriginId; - - private final String endUserOrganizationName; - - private final String endUserEmailAddress; - - private final Optional subdomain; - - private final String webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional integration; - - private final String accountType; - - private final OffsetDateTime completedAt; - - private final Map additionalProperties; - - private AccountDetailsAndActions( - String id, - Optional category, - AccountDetailsAndActionsStatusEnum status, - Optional statusDetail, - Optional endUserOriginId, - String endUserOrganizationName, - String endUserEmailAddress, - Optional subdomain, - String webhookListenerUrl, - Optional isDuplicate, - Optional integration, - String accountType, - OffsetDateTime completedAt, - Map additionalProperties) { - this.id = id; - this.category = category; - this.status = status; - this.statusDetail = statusDetail; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.subdomain = subdomain; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.integration = integration; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("status") - public AccountDetailsAndActionsStatusEnum getStatus() { - return status; - } - - @JsonProperty("status_detail") - public Optional getStatusDetail() { - return statusDetail; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return The tenant or domain the customer has provided access to. - */ - @JsonProperty("subdomain") - public Optional getSubdomain() { - return subdomain; - } - - @JsonProperty("webhook_listener_url") - public String getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("account_type") - public String getAccountType() { - return accountType; - } - - @JsonProperty("completed_at") - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActions other) { - return id.equals(other.id) - && category.equals(other.category) - && status.equals(other.status) - && statusDetail.equals(other.statusDetail) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && subdomain.equals(other.subdomain) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && integration.equals(other.integration) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.category, - this.status, - this.statusDetail, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.subdomain, - this.webhookListenerUrl, - this.isDuplicate, - this.integration, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - StatusStage id(@NotNull String id); - - Builder from(AccountDetailsAndActions other); - } - - public interface StatusStage { - EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); - } - - public interface EndUserOrganizationNameStage { - EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserEmailAddressStage { - WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); - } - - public interface WebhookListenerUrlStage { - AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); - } - - public interface AccountTypeStage { - CompletedAtStage accountType(@NotNull String accountType); - } - - public interface CompletedAtStage { - _FinalStage completedAt(@NotNull OffsetDateTime completedAt); - } - - public interface _FinalStage { - AccountDetailsAndActions build(); - - _FinalStage category(Optional category); - - _FinalStage category(CategoryEnum category); - - _FinalStage statusDetail(Optional statusDetail); - - _FinalStage statusDetail(String statusDetail); - - _FinalStage endUserOriginId(Optional endUserOriginId); - - _FinalStage endUserOriginId(String endUserOriginId); - - _FinalStage subdomain(Optional subdomain); - - _FinalStage subdomain(String subdomain); - - _FinalStage isDuplicate(Optional isDuplicate); - - _FinalStage isDuplicate(Boolean isDuplicate); - - _FinalStage integration(Optional integration); - - _FinalStage integration(AccountDetailsAndActionsIntegration integration); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements IdStage, - StatusStage, - EndUserOrganizationNameStage, - EndUserEmailAddressStage, - WebhookListenerUrlStage, - AccountTypeStage, - CompletedAtStage, - _FinalStage { - private String id; - - private AccountDetailsAndActionsStatusEnum status; - - private String endUserOrganizationName; - - private String endUserEmailAddress; - - private String webhookListenerUrl; - - private String accountType; - - private OffsetDateTime completedAt; - - private Optional integration = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional subdomain = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional statusDetail = Optional.empty(); - - private Optional category = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActions other) { - id(other.getId()); - category(other.getCategory()); - status(other.getStatus()); - statusDetail(other.getStatusDetail()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - subdomain(other.getSubdomain()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - integration(other.getIntegration()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public StatusStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_email_address") - public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - @java.lang.Override - @JsonSetter("webhook_listener_url") - public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - @java.lang.Override - @JsonSetter("account_type") - public CompletedAtStage accountType(@NotNull String accountType) { - this.accountType = accountType; - return this; - } - - @java.lang.Override - @JsonSetter("completed_at") - public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - @java.lang.Override - public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public _FinalStage isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - /** - *

The tenant or domain the customer has provided access to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage subdomain(String subdomain) { - this.subdomain = Optional.ofNullable(subdomain); - return this; - } - - @java.lang.Override - @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) - public _FinalStage subdomain(Optional subdomain) { - this.subdomain = subdomain; - return this; - } - - @java.lang.Override - public _FinalStage endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public _FinalStage endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - @java.lang.Override - public _FinalStage statusDetail(String statusDetail) { - this.statusDetail = Optional.ofNullable(statusDetail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) - public _FinalStage statusDetail(Optional statusDetail) { - this.statusDetail = statusDetail; - return this; - } - - @java.lang.Override - public _FinalStage category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public _FinalStage category(Optional category) { - this.category = category; - return this; - } - - @java.lang.Override - public AccountDetailsAndActions build() { - return new AccountDetailsAndActions( - id, - category, - status, - statusDetail, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - subdomain, - webhookListenerUrl, - isDuplicate, - integration, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActionsIntegration.java deleted file mode 100644 index 736e7164a..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActionsIntegration.java +++ /dev/null @@ -1,328 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) -public final class AccountDetailsAndActionsIntegration { - private final String name; - - private final List categories; - - private final Optional image; - - private final Optional squareImage; - - private final String color; - - private final String slug; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AccountDetailsAndActionsIntegration( - String name, - List categories, - Optional image, - Optional squareImage, - String color, - String slug, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.name = name; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - @JsonProperty("image") - public Optional getImage() { - return image; - } - - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - @JsonProperty("color") - public String getColor() { - return color; - } - - @JsonProperty("slug") - public String getSlug() { - return slug; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActionsIntegration - && equalTo((AccountDetailsAndActionsIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActionsIntegration other) { - return name.equals(other.name) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.passthroughAvailable, - this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - ColorStage name(@NotNull String name); - - Builder from(AccountDetailsAndActionsIntegration other); - } - - public interface ColorStage { - SlugStage color(@NotNull String color); - } - - public interface SlugStage { - PassthroughAvailableStage slug(@NotNull String slug); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AccountDetailsAndActionsIntegration build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { - private String name; - - private String color; - - private String slug; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActionsIntegration other) { - name(other.getName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public ColorStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("color") - public SlugStage color(@NotNull String color) { - this.color = color; - return this; - } - - @java.lang.Override - @JsonSetter("slug") - public PassthroughAvailableStage slug(@NotNull String slug) { - this.slug = slug; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public AccountDetailsAndActionsIntegration build() { - return new AccountDetailsAndActionsIntegration( - name, - categories, - image, - squareImage, - color, - slug, - passthroughAvailable, - availableModelOperations, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActionsStatusEnum.java deleted file mode 100644 index 371da1fc0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountDetailsAndActionsStatusEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AccountDetailsAndActionsStatusEnum { - COMPLETE("COMPLETE"), - - INCOMPLETE("INCOMPLETE"), - - RELINK_NEEDED("RELINK_NEEDED"), - - IDLE("IDLE"); - - private final String value; - - AccountDetailsAndActionsStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountIntegration.java b/src/main/java/com/merge/api/resources/accounting/types/AccountIntegration.java deleted file mode 100644 index b76e4767e..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountIntegration.java +++ /dev/null @@ -1,463 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountIntegration.Builder.class) -public final class AccountIntegration { - private final String name; - - private final Optional abbreviatedName; - - private final Optional> categories; - - private final Optional image; - - private final Optional squareImage; - - private final Optional color; - - private final Optional slug; - - private final Optional> apiEndpointsToDocumentationUrls; - - private final Optional webhookSetupGuideUrl; - - private final Optional> categoryBetaStatus; - - private final Map additionalProperties; - - private AccountIntegration( - String name, - Optional abbreviatedName, - Optional> categories, - Optional image, - Optional squareImage, - Optional color, - Optional slug, - Optional> apiEndpointsToDocumentationUrls, - Optional webhookSetupGuideUrl, - Optional> categoryBetaStatus, - Map additionalProperties) { - this.name = name; - this.abbreviatedName = abbreviatedName; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - this.categoryBetaStatus = categoryBetaStatus; - this.additionalProperties = additionalProperties; - } - - /** - * @return Company name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> - */ - @JsonProperty("abbreviated_name") - public Optional getAbbreviatedName() { - return abbreviatedName; - } - - /** - * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. - */ - @JsonProperty("categories") - public Optional> getCategories() { - return categories; - } - - /** - * @return Company logo in rectangular shape. - */ - @JsonProperty("image") - public Optional getImage() { - return image; - } - - /** - * @return Company logo in square shape. - */ - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - /** - * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> - */ - @JsonProperty("color") - public Optional getColor() { - return color; - } - - @JsonProperty("slug") - public Optional getSlug() { - return slug; - } - - /** - * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} - */ - @JsonProperty("api_endpoints_to_documentation_urls") - public Optional> getApiEndpointsToDocumentationUrls() { - return apiEndpointsToDocumentationUrls; - } - - /** - * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. - */ - @JsonProperty("webhook_setup_guide_url") - public Optional getWebhookSetupGuideUrl() { - return webhookSetupGuideUrl; - } - - /** - * @return Category or categories this integration is in beta status for. - */ - @JsonProperty("category_beta_status") - public Optional> getCategoryBetaStatus() { - return categoryBetaStatus; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountIntegration && equalTo((AccountIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountIntegration other) { - return name.equals(other.name) - && abbreviatedName.equals(other.abbreviatedName) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) - && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) - && categoryBetaStatus.equals(other.categoryBetaStatus); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.abbreviatedName, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.apiEndpointsToDocumentationUrls, - this.webhookSetupGuideUrl, - this.categoryBetaStatus); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(AccountIntegration other); - } - - public interface _FinalStage { - AccountIntegration build(); - - _FinalStage abbreviatedName(Optional abbreviatedName); - - _FinalStage abbreviatedName(String abbreviatedName); - - _FinalStage categories(Optional> categories); - - _FinalStage categories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage color(Optional color); - - _FinalStage color(String color); - - _FinalStage slug(Optional slug); - - _FinalStage slug(String slug); - - _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); - - _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); - - _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); - - _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); - - _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); - - _FinalStage categoryBetaStatus(Map categoryBetaStatus); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - private Optional> categoryBetaStatus = Optional.empty(); - - private Optional webhookSetupGuideUrl = Optional.empty(); - - private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); - - private Optional slug = Optional.empty(); - - private Optional color = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private Optional> categories = Optional.empty(); - - private Optional abbreviatedName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountIntegration other) { - name(other.getName()); - abbreviatedName(other.getAbbreviatedName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); - webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); - categoryBetaStatus(other.getCategoryBetaStatus()); - return this; - } - - /** - *

Company name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

Category or categories this integration is in beta status for.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { - this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) - public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { - this.categoryBetaStatus = categoryBetaStatus; - return this; - } - - /** - *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) - public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - return this; - } - - /** - *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); - return this; - } - - @java.lang.Override - @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) - public _FinalStage apiEndpointsToDocumentationUrls( - Optional> apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - return this; - } - - @java.lang.Override - public _FinalStage slug(String slug) { - this.slug = Optional.ofNullable(slug); - return this; - } - - @java.lang.Override - @JsonSetter(value = "slug", nulls = Nulls.SKIP) - public _FinalStage slug(Optional slug) { - this.slug = slug; - return this; - } - - /** - *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage color(String color) { - this.color = Optional.ofNullable(color); - return this; - } - - @java.lang.Override - @JsonSetter(value = "color", nulls = Nulls.SKIP) - public _FinalStage color(Optional color) { - this.color = color; - return this; - } - - /** - *

Company logo in square shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - /** - *

Company logo in rectangular shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - /** - *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categories(List categories) { - this.categories = Optional.ofNullable(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(Optional> categories) { - this.categories = categories; - return this; - } - - /** - *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage abbreviatedName(String abbreviatedName) { - this.abbreviatedName = Optional.ofNullable(abbreviatedName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) - public _FinalStage abbreviatedName(Optional abbreviatedName) { - this.abbreviatedName = abbreviatedName; - return this; - } - - @java.lang.Override - public AccountIntegration build() { - return new AccountIntegration( - name, - abbreviatedName, - categories, - image, - squareImage, - color, - slug, - apiEndpointsToDocumentationUrls, - webhookSetupGuideUrl, - categoryBetaStatus, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountRequest.java b/src/main/java/com/merge/api/resources/accounting/types/AccountRequest.java deleted file mode 100644 index bc6dacbad..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountRequest.java +++ /dev/null @@ -1,781 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountRequest.Builder.class) -public final class AccountRequest { - private final Optional name; - - private final Optional description; - - private final Optional classification; - - private final Optional type; - - private final Optional accountType; - - private final Optional status; - - private final Optional currentBalance; - - private final Optional currency; - - private final Optional accountNumber; - - private final Optional parentAccount; - - private final Optional company; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private AccountRequest( - Optional name, - Optional description, - Optional classification, - Optional type, - Optional accountType, - Optional status, - Optional currentBalance, - Optional currency, - Optional accountNumber, - Optional parentAccount, - Optional company, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.name = name; - this.description = description; - this.classification = classification; - this.type = type; - this.accountType = accountType; - this.status = status; - this.currentBalance = currentBalance; - this.currency = currency; - this.accountNumber = accountNumber; - this.parentAccount = parentAccount; - this.company = company; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The account's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The account's description. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return The account's broadest grouping. - *
    - *
  • ASSET - ASSET
  • - *
  • EQUITY - EQUITY
  • - *
  • EXPENSE - EXPENSE
  • - *
  • LIABILITY - LIABILITY
  • - *
  • REVENUE - REVENUE
  • - *
- */ - @JsonProperty("classification") - public Optional getClassification() { - return classification; - } - - /** - * @return The account's type is a narrower and more specific grouping within the account's classification. - */ - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return Normalized account type- which is a narrower and more specific grouping within the account's classification. - *
    - *
  • BANK - BANK
  • - *
  • CREDIT_CARD - CREDIT_CARD
  • - *
  • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
  • - *
  • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
  • - *
  • FIXED_ASSET - FIXED_ASSET
  • - *
  • OTHER_ASSET - OTHER_ASSET
  • - *
  • OTHER_CURRENT_ASSET - OTHER_CURRENT_ASSET
  • - *
  • OTHER_EXPENSE - OTHER_EXPENSE
  • - *
  • OTHER_INCOME - OTHER_INCOME
  • - *
  • COST_OF_GOODS_SOLD - COST_OF_GOODS_SOLD
  • - *
  • OTHER_CURRENT_LIABILITY - OTHER_CURRENT_LIABILITY
  • - *
  • LONG_TERM_LIABILITY - LONG_TERM_LIABILITY
  • - *
  • NON_POSTING - NON_POSTING
  • - *
- */ - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The account's status. - *
    - *
  • ACTIVE - ACTIVE
  • - *
  • PENDING - PENDING
  • - *
  • INACTIVE - INACTIVE
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - /** - * @return The account's current balance. - */ - @JsonProperty("current_balance") - public Optional getCurrentBalance() { - return currentBalance; - } - - /** - * @return The account's currency. - *
    - *
  • XUA - ADB Unit of Account
  • - *
  • AFN - Afghan Afghani
  • - *
  • AFA - Afghan Afghani (1927–2002)
  • - *
  • ALL - Albanian Lek
  • - *
  • ALK - Albanian Lek (1946–1965)
  • - *
  • DZD - Algerian Dinar
  • - *
  • ADP - Andorran Peseta
  • - *
  • AOA - Angolan Kwanza
  • - *
  • AOK - Angolan Kwanza (1977–1991)
  • - *
  • AON - Angolan New Kwanza (1990–2000)
  • - *
  • AOR - Angolan Readjusted Kwanza (1995–1999)
  • - *
  • ARA - Argentine Austral
  • - *
  • ARS - Argentine Peso
  • - *
  • ARM - Argentine Peso (1881–1970)
  • - *
  • ARP - Argentine Peso (1983–1985)
  • - *
  • ARL - Argentine Peso Ley (1970–1983)
  • - *
  • AMD - Armenian Dram
  • - *
  • AWG - Aruban Florin
  • - *
  • AUD - Australian Dollar
  • - *
  • ATS - Austrian Schilling
  • - *
  • AZN - Azerbaijani Manat
  • - *
  • AZM - Azerbaijani Manat (1993–2006)
  • - *
  • BSD - Bahamian Dollar
  • - *
  • BHD - Bahraini Dinar
  • - *
  • BDT - Bangladeshi Taka
  • - *
  • BBD - Barbadian Dollar
  • - *
  • BYN - Belarusian Ruble
  • - *
  • BYB - Belarusian Ruble (1994–1999)
  • - *
  • BYR - Belarusian Ruble (2000–2016)
  • - *
  • BEF - Belgian Franc
  • - *
  • BEC - Belgian Franc (convertible)
  • - *
  • BEL - Belgian Franc (financial)
  • - *
  • BZD - Belize Dollar
  • - *
  • BMD - Bermudan Dollar
  • - *
  • BTN - Bhutanese Ngultrum
  • - *
  • BOB - Bolivian Boliviano
  • - *
  • BOL - Bolivian Boliviano (1863–1963)
  • - *
  • BOV - Bolivian Mvdol
  • - *
  • BOP - Bolivian Peso
  • - *
  • BAM - Bosnia-Herzegovina Convertible Mark
  • - *
  • BAD - Bosnia-Herzegovina Dinar (1992–1994)
  • - *
  • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
  • - *
  • BWP - Botswanan Pula
  • - *
  • BRC - Brazilian Cruzado (1986–1989)
  • - *
  • BRZ - Brazilian Cruzeiro (1942–1967)
  • - *
  • BRE - Brazilian Cruzeiro (1990–1993)
  • - *
  • BRR - Brazilian Cruzeiro (1993–1994)
  • - *
  • BRN - Brazilian New Cruzado (1989–1990)
  • - *
  • BRB - Brazilian New Cruzeiro (1967–1986)
  • - *
  • BRL - Brazilian Real
  • - *
  • GBP - British Pound
  • - *
  • BND - Brunei Dollar
  • - *
  • BGL - Bulgarian Hard Lev
  • - *
  • BGN - Bulgarian Lev
  • - *
  • BGO - Bulgarian Lev (1879–1952)
  • - *
  • BGM - Bulgarian Socialist Lev
  • - *
  • BUK - Burmese Kyat
  • - *
  • BIF - Burundian Franc
  • - *
  • XPF - CFP Franc
  • - *
  • KHR - Cambodian Riel
  • - *
  • CAD - Canadian Dollar
  • - *
  • CVE - Cape Verdean Escudo
  • - *
  • KYD - Cayman Islands Dollar
  • - *
  • XAF - Central African CFA Franc
  • - *
  • CLE - Chilean Escudo
  • - *
  • CLP - Chilean Peso
  • - *
  • CLF - Chilean Unit of Account (UF)
  • - *
  • CNX - Chinese People’s Bank Dollar
  • - *
  • CNY - Chinese Yuan
  • - *
  • CNH - Chinese Yuan (offshore)
  • - *
  • COP - Colombian Peso
  • - *
  • COU - Colombian Real Value Unit
  • - *
  • KMF - Comorian Franc
  • - *
  • CDF - Congolese Franc
  • - *
  • CRC - Costa Rican Colón
  • - *
  • HRD - Croatian Dinar
  • - *
  • HRK - Croatian Kuna
  • - *
  • CUC - Cuban Convertible Peso
  • - *
  • CUP - Cuban Peso
  • - *
  • CYP - Cypriot Pound
  • - *
  • CZK - Czech Koruna
  • - *
  • CSK - Czechoslovak Hard Koruna
  • - *
  • DKK - Danish Krone
  • - *
  • DJF - Djiboutian Franc
  • - *
  • DOP - Dominican Peso
  • - *
  • NLG - Dutch Guilder
  • - *
  • XCD - East Caribbean Dollar
  • - *
  • DDM - East German Mark
  • - *
  • ECS - Ecuadorian Sucre
  • - *
  • ECV - Ecuadorian Unit of Constant Value
  • - *
  • EGP - Egyptian Pound
  • - *
  • GQE - Equatorial Guinean Ekwele
  • - *
  • ERN - Eritrean Nakfa
  • - *
  • EEK - Estonian Kroon
  • - *
  • ETB - Ethiopian Birr
  • - *
  • EUR - Euro
  • - *
  • XBA - European Composite Unit
  • - *
  • XEU - European Currency Unit
  • - *
  • XBB - European Monetary Unit
  • - *
  • XBC - European Unit of Account (XBC)
  • - *
  • XBD - European Unit of Account (XBD)
  • - *
  • FKP - Falkland Islands Pound
  • - *
  • FJD - Fijian Dollar
  • - *
  • FIM - Finnish Markka
  • - *
  • FRF - French Franc
  • - *
  • XFO - French Gold Franc
  • - *
  • XFU - French UIC-Franc
  • - *
  • GMD - Gambian Dalasi
  • - *
  • GEK - Georgian Kupon Larit
  • - *
  • GEL - Georgian Lari
  • - *
  • DEM - German Mark
  • - *
  • GHS - Ghanaian Cedi
  • - *
  • GHC - Ghanaian Cedi (1979–2007)
  • - *
  • GIP - Gibraltar Pound
  • - *
  • XAU - Gold
  • - *
  • GRD - Greek Drachma
  • - *
  • GTQ - Guatemalan Quetzal
  • - *
  • GWP - Guinea-Bissau Peso
  • - *
  • GNF - Guinean Franc
  • - *
  • GNS - Guinean Syli
  • - *
  • GYD - Guyanaese Dollar
  • - *
  • HTG - Haitian Gourde
  • - *
  • HNL - Honduran Lempira
  • - *
  • HKD - Hong Kong Dollar
  • - *
  • HUF - Hungarian Forint
  • - *
  • IMP - IMP
  • - *
  • ISK - Icelandic Króna
  • - *
  • ISJ - Icelandic Króna (1918–1981)
  • - *
  • INR - Indian Rupee
  • - *
  • IDR - Indonesian Rupiah
  • - *
  • IRR - Iranian Rial
  • - *
  • IQD - Iraqi Dinar
  • - *
  • IEP - Irish Pound
  • - *
  • ILS - Israeli New Shekel
  • - *
  • ILP - Israeli Pound
  • - *
  • ILR - Israeli Shekel (1980–1985)
  • - *
  • ITL - Italian Lira
  • - *
  • JMD - Jamaican Dollar
  • - *
  • JPY - Japanese Yen
  • - *
  • JOD - Jordanian Dinar
  • - *
  • KZT - Kazakhstani Tenge
  • - *
  • KES - Kenyan Shilling
  • - *
  • KWD - Kuwaiti Dinar
  • - *
  • KGS - Kyrgystani Som
  • - *
  • LAK - Laotian Kip
  • - *
  • LVL - Latvian Lats
  • - *
  • LVR - Latvian Ruble
  • - *
  • LBP - Lebanese Pound
  • - *
  • LSL - Lesotho Loti
  • - *
  • LRD - Liberian Dollar
  • - *
  • LYD - Libyan Dinar
  • - *
  • LTL - Lithuanian Litas
  • - *
  • LTT - Lithuanian Talonas
  • - *
  • LUL - Luxembourg Financial Franc
  • - *
  • LUC - Luxembourgian Convertible Franc
  • - *
  • LUF - Luxembourgian Franc
  • - *
  • MOP - Macanese Pataca
  • - *
  • MKD - Macedonian Denar
  • - *
  • MKN - Macedonian Denar (1992–1993)
  • - *
  • MGA - Malagasy Ariary
  • - *
  • MGF - Malagasy Franc
  • - *
  • MWK - Malawian Kwacha
  • - *
  • MYR - Malaysian Ringgit
  • - *
  • MVR - Maldivian Rufiyaa
  • - *
  • MVP - Maldivian Rupee (1947–1981)
  • - *
  • MLF - Malian Franc
  • - *
  • MTL - Maltese Lira
  • - *
  • MTP - Maltese Pound
  • - *
  • MRU - Mauritanian Ouguiya
  • - *
  • MRO - Mauritanian Ouguiya (1973–2017)
  • - *
  • MUR - Mauritian Rupee
  • - *
  • MXV - Mexican Investment Unit
  • - *
  • MXN - Mexican Peso
  • - *
  • MXP - Mexican Silver Peso (1861–1992)
  • - *
  • MDC - Moldovan Cupon
  • - *
  • MDL - Moldovan Leu
  • - *
  • MCF - Monegasque Franc
  • - *
  • MNT - Mongolian Tugrik
  • - *
  • MAD - Moroccan Dirham
  • - *
  • MAF - Moroccan Franc
  • - *
  • MZE - Mozambican Escudo
  • - *
  • MZN - Mozambican Metical
  • - *
  • MZM - Mozambican Metical (1980–2006)
  • - *
  • MMK - Myanmar Kyat
  • - *
  • NAD - Namibian Dollar
  • - *
  • NPR - Nepalese Rupee
  • - *
  • ANG - Netherlands Antillean Guilder
  • - *
  • TWD - New Taiwan Dollar
  • - *
  • NZD - New Zealand Dollar
  • - *
  • NIO - Nicaraguan Córdoba
  • - *
  • NIC - Nicaraguan Córdoba (1988–1991)
  • - *
  • NGN - Nigerian Naira
  • - *
  • KPW - North Korean Won
  • - *
  • NOK - Norwegian Krone
  • - *
  • OMR - Omani Rial
  • - *
  • PKR - Pakistani Rupee
  • - *
  • XPD - Palladium
  • - *
  • PAB - Panamanian Balboa
  • - *
  • PGK - Papua New Guinean Kina
  • - *
  • PYG - Paraguayan Guarani
  • - *
  • PEI - Peruvian Inti
  • - *
  • PEN - Peruvian Sol
  • - *
  • PES - Peruvian Sol (1863–1965)
  • - *
  • PHP - Philippine Peso
  • - *
  • XPT - Platinum
  • - *
  • PLN - Polish Zloty
  • - *
  • PLZ - Polish Zloty (1950–1995)
  • - *
  • PTE - Portuguese Escudo
  • - *
  • GWE - Portuguese Guinea Escudo
  • - *
  • QAR - Qatari Rial
  • - *
  • XRE - RINET Funds
  • - *
  • RHD - Rhodesian Dollar
  • - *
  • RON - Romanian Leu
  • - *
  • ROL - Romanian Leu (1952–2006)
  • - *
  • RUB - Russian Ruble
  • - *
  • RUR - Russian Ruble (1991–1998)
  • - *
  • RWF - Rwandan Franc
  • - *
  • SVC - Salvadoran Colón
  • - *
  • WST - Samoan Tala
  • - *
  • SAR - Saudi Riyal
  • - *
  • RSD - Serbian Dinar
  • - *
  • CSD - Serbian Dinar (2002–2006)
  • - *
  • SCR - Seychellois Rupee
  • - *
  • SLL - Sierra Leonean Leone
  • - *
  • XAG - Silver
  • - *
  • SGD - Singapore Dollar
  • - *
  • SKK - Slovak Koruna
  • - *
  • SIT - Slovenian Tolar
  • - *
  • SBD - Solomon Islands Dollar
  • - *
  • SOS - Somali Shilling
  • - *
  • ZAR - South African Rand
  • - *
  • ZAL - South African Rand (financial)
  • - *
  • KRH - South Korean Hwan (1953–1962)
  • - *
  • KRW - South Korean Won
  • - *
  • KRO - South Korean Won (1945–1953)
  • - *
  • SSP - South Sudanese Pound
  • - *
  • SUR - Soviet Rouble
  • - *
  • ESP - Spanish Peseta
  • - *
  • ESA - Spanish Peseta (A account)
  • - *
  • ESB - Spanish Peseta (convertible account)
  • - *
  • XDR - Special Drawing Rights
  • - *
  • LKR - Sri Lankan Rupee
  • - *
  • SHP - St. Helena Pound
  • - *
  • XSU - Sucre
  • - *
  • SDD - Sudanese Dinar (1992–2007)
  • - *
  • SDG - Sudanese Pound
  • - *
  • SDP - Sudanese Pound (1957–1998)
  • - *
  • SRD - Surinamese Dollar
  • - *
  • SRG - Surinamese Guilder
  • - *
  • SZL - Swazi Lilangeni
  • - *
  • SEK - Swedish Krona
  • - *
  • CHF - Swiss Franc
  • - *
  • SYP - Syrian Pound
  • - *
  • STN - São Tomé & Príncipe Dobra
  • - *
  • STD - São Tomé & Príncipe Dobra (1977–2017)
  • - *
  • TVD - TVD
  • - *
  • TJR - Tajikistani Ruble
  • - *
  • TJS - Tajikistani Somoni
  • - *
  • TZS - Tanzanian Shilling
  • - *
  • XTS - Testing Currency Code
  • - *
  • THB - Thai Baht
  • - *
  • XXX - The codes assigned for transactions where no currency is involved
  • - *
  • TPE - Timorese Escudo
  • - *
  • TOP - Tongan PaÊ»anga
  • - *
  • TTD - Trinidad & Tobago Dollar
  • - *
  • TND - Tunisian Dinar
  • - *
  • TRY - Turkish Lira
  • - *
  • TRL - Turkish Lira (1922–2005)
  • - *
  • TMT - Turkmenistani Manat
  • - *
  • TMM - Turkmenistani Manat (1993–2009)
  • - *
  • USD - US Dollar
  • - *
  • USN - US Dollar (Next day)
  • - *
  • USS - US Dollar (Same day)
  • - *
  • UGX - Ugandan Shilling
  • - *
  • UGS - Ugandan Shilling (1966–1987)
  • - *
  • UAH - Ukrainian Hryvnia
  • - *
  • UAK - Ukrainian Karbovanets
  • - *
  • AED - United Arab Emirates Dirham
  • - *
  • UYW - Uruguayan Nominal Wage Index Unit
  • - *
  • UYU - Uruguayan Peso
  • - *
  • UYP - Uruguayan Peso (1975–1993)
  • - *
  • UYI - Uruguayan Peso (Indexed Units)
  • - *
  • UZS - Uzbekistani Som
  • - *
  • VUV - Vanuatu Vatu
  • - *
  • VES - Venezuelan Bolívar
  • - *
  • VEB - Venezuelan Bolívar (1871–2008)
  • - *
  • VEF - Venezuelan Bolívar (2008–2018)
  • - *
  • VND - Vietnamese Dong
  • - *
  • VNN - Vietnamese Dong (1978–1985)
  • - *
  • CHE - WIR Euro
  • - *
  • CHW - WIR Franc
  • - *
  • XOF - West African CFA Franc
  • - *
  • YDD - Yemeni Dinar
  • - *
  • YER - Yemeni Rial
  • - *
  • YUN - Yugoslavian Convertible Dinar (1990–1992)
  • - *
  • YUD - Yugoslavian Hard Dinar (1966–1990)
  • - *
  • YUM - Yugoslavian New Dinar (1994–2002)
  • - *
  • YUR - Yugoslavian Reformed Dinar (1992–1993)
  • - *
  • ZWN - ZWN
  • - *
  • ZRN - Zairean New Zaire (1993–1998)
  • - *
  • ZRZ - Zairean Zaire (1971–1993)
  • - *
  • ZMW - Zambian Kwacha
  • - *
  • ZMK - Zambian Kwacha (1968–2012)
  • - *
  • ZWD - Zimbabwean Dollar (1980–2008)
  • - *
  • ZWR - Zimbabwean Dollar (2008)
  • - *
  • ZWL - Zimbabwean Dollar (2009)
  • - *
- */ - @JsonProperty("currency") - public Optional getCurrency() { - return currency; - } - - /** - * @return The account's number. - */ - @JsonProperty("account_number") - public Optional getAccountNumber() { - return accountNumber; - } - - /** - * @return ID of the parent account. - */ - @JsonProperty("parent_account") - public Optional getParentAccount() { - return parentAccount; - } - - /** - * @return The company the account belongs to. - */ - @JsonProperty("company") - public Optional getCompany() { - return company; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountRequest && equalTo((AccountRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountRequest other) { - return name.equals(other.name) - && description.equals(other.description) - && classification.equals(other.classification) - && type.equals(other.type) - && accountType.equals(other.accountType) - && status.equals(other.status) - && currentBalance.equals(other.currentBalance) - && currency.equals(other.currency) - && accountNumber.equals(other.accountNumber) - && parentAccount.equals(other.parentAccount) - && company.equals(other.company) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.description, - this.classification, - this.type, - this.accountType, - this.status, - this.currentBalance, - this.currency, - this.accountNumber, - this.parentAccount, - this.company, - this.integrationParams, - this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional classification = Optional.empty(); - - private Optional type = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional currentBalance = Optional.empty(); - - private Optional currency = Optional.empty(); - - private Optional accountNumber = Optional.empty(); - - private Optional parentAccount = Optional.empty(); - - private Optional company = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountRequest other) { - name(other.getName()); - description(other.getDescription()); - classification(other.getClassification()); - type(other.getType()); - accountType(other.getAccountType()); - status(other.getStatus()); - currentBalance(other.getCurrentBalance()); - currency(other.getCurrency()); - accountNumber(other.getAccountNumber()); - parentAccount(other.getParentAccount()); - company(other.getCompany()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "classification", nulls = Nulls.SKIP) - public Builder classification(Optional classification) { - this.classification = classification; - return this; - } - - public Builder classification(AccountRequestClassification classification) { - this.classification = Optional.ofNullable(classification); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(AccountRequestAccountType accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(AccountRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "current_balance", nulls = Nulls.SKIP) - public Builder currentBalance(Optional currentBalance) { - this.currentBalance = currentBalance; - return this; - } - - public Builder currentBalance(Double currentBalance) { - this.currentBalance = Optional.ofNullable(currentBalance); - return this; - } - - @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { - this.currency = currency; - return this; - } - - public Builder currency(AccountRequestCurrency currency) { - this.currency = Optional.ofNullable(currency); - return this; - } - - @JsonSetter(value = "account_number", nulls = Nulls.SKIP) - public Builder accountNumber(Optional accountNumber) { - this.accountNumber = accountNumber; - return this; - } - - public Builder accountNumber(String accountNumber) { - this.accountNumber = Optional.ofNullable(accountNumber); - return this; - } - - @JsonSetter(value = "parent_account", nulls = Nulls.SKIP) - public Builder parentAccount(Optional parentAccount) { - this.parentAccount = parentAccount; - return this; - } - - public Builder parentAccount(String parentAccount) { - this.parentAccount = Optional.ofNullable(parentAccount); - return this; - } - - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { - this.company = company; - return this; - } - - public Builder company(String company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public AccountRequest build() { - return new AccountRequest( - name, - description, - classification, - type, - accountType, - status, - currentBalance, - currency, - accountNumber, - parentAccount, - company, - integrationParams, - linkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestAccountType.java b/src/main/java/com/merge/api/resources/accounting/types/AccountRequestAccountType.java deleted file mode 100644 index db7767408..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestAccountType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountRequestAccountType.Deserializer.class) -public final class AccountRequestAccountType { - private final Object value; - - private final int type; - - private AccountRequestAccountType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AccountAccountTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountRequestAccountType && equalTo((AccountRequestAccountType) other); - } - - private boolean equalTo(AccountRequestAccountType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountRequestAccountType of(AccountAccountTypeEnum value) { - return new AccountRequestAccountType(value, 0); - } - - public static AccountRequestAccountType of(String value) { - return new AccountRequestAccountType(value, 1); - } - - public interface Visitor { - T visit(AccountAccountTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountRequestAccountType.class); - } - - @java.lang.Override - public AccountRequestAccountType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountAccountTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestClassification.java b/src/main/java/com/merge/api/resources/accounting/types/AccountRequestClassification.java deleted file mode 100644 index cd0b768cb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestClassification.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountRequestClassification.Deserializer.class) -public final class AccountRequestClassification { - private final Object value; - - private final int type; - - private AccountRequestClassification(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ClassificationEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountRequestClassification && equalTo((AccountRequestClassification) other); - } - - private boolean equalTo(AccountRequestClassification other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountRequestClassification of(ClassificationEnum value) { - return new AccountRequestClassification(value, 0); - } - - public static AccountRequestClassification of(String value) { - return new AccountRequestClassification(value, 1); - } - - public interface Visitor { - T visit(ClassificationEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountRequestClassification.class); - } - - @java.lang.Override - public AccountRequestClassification deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ClassificationEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/AccountRequestCurrency.java deleted file mode 100644 index f5675288f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountRequestCurrency.Deserializer.class) -public final class AccountRequestCurrency { - private final Object value; - - private final int type; - - private AccountRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountRequestCurrency && equalTo((AccountRequestCurrency) other); - } - - private boolean equalTo(AccountRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountRequestCurrency of(TransactionCurrencyEnum value) { - return new AccountRequestCurrency(value, 0); - } - - public static AccountRequestCurrency of(String value) { - return new AccountRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountRequestCurrency.class); - } - - @java.lang.Override - public AccountRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestStatus.java b/src/main/java/com/merge/api/resources/accounting/types/AccountRequestStatus.java deleted file mode 100644 index 282f3aa4f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountRequestStatus.Deserializer.class) -public final class AccountRequestStatus { - private final Object value; - - private final int type; - - private AccountRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AccountStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountRequestStatus && equalTo((AccountRequestStatus) other); - } - - private boolean equalTo(AccountRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountRequestStatus of(AccountStatusEnum value) { - return new AccountRequestStatus(value, 0); - } - - public static AccountRequestStatus of(String value) { - return new AccountRequestStatus(value, 1); - } - - public interface Visitor { - T visit(AccountStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountRequestStatus.class); - } - - @java.lang.Override - public AccountRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountStatus.java b/src/main/java/com/merge/api/resources/accounting/types/AccountStatus.java deleted file mode 100644 index bfc8eecd6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountStatus.Deserializer.class) -public final class AccountStatus { - private final Object value; - - private final int type; - - private AccountStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AccountStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountStatus && equalTo((AccountStatus) other); - } - - private boolean equalTo(AccountStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountStatus of(AccountStatusEnum value) { - return new AccountStatus(value, 0); - } - - public static AccountStatus of(String value) { - return new AccountStatus(value, 1); - } - - public interface Visitor { - T visit(AccountStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountStatus.class); - } - - @java.lang.Override - public AccountStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountToken.java b/src/main/java/com/merge/api/resources/accounting/types/AccountToken.java deleted file mode 100644 index 08643227f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountToken.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountToken.Builder.class) -public final class AccountToken { - private final String accountToken; - - private final AccountIntegration integration; - - private final Map additionalProperties; - - private AccountToken( - String accountToken, AccountIntegration integration, Map additionalProperties) { - this.accountToken = accountToken; - this.integration = integration; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public String getAccountToken() { - return accountToken; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountToken && equalTo((AccountToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountToken other) { - return accountToken.equals(other.accountToken) && integration.equals(other.integration); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.accountToken, this.integration); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccountTokenStage builder() { - return new Builder(); - } - - public interface AccountTokenStage { - IntegrationStage accountToken(@NotNull String accountToken); - - Builder from(AccountToken other); - } - - public interface IntegrationStage { - _FinalStage integration(@NotNull AccountIntegration integration); - } - - public interface _FinalStage { - AccountToken build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountTokenStage, IntegrationStage, _FinalStage { - private String accountToken; - - private AccountIntegration integration; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountToken other) { - accountToken(other.getAccountToken()); - integration(other.getIntegration()); - return this; - } - - @java.lang.Override - @JsonSetter("account_token") - public IntegrationStage accountToken(@NotNull String accountToken) { - this.accountToken = accountToken; - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public _FinalStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - public AccountToken build() { - return new AccountToken(accountToken, integration, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AccountingPeriodStatus.java b/src/main/java/com/merge/api/resources/accounting/types/AccountingPeriodStatus.java deleted file mode 100644 index fcc6cab69..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AccountingPeriodStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AccountingPeriodStatus.Deserializer.class) -public final class AccountingPeriodStatus { - private final Object value; - - private final int type; - - private AccountingPeriodStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((Status895Enum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountingPeriodStatus && equalTo((AccountingPeriodStatus) other); - } - - private boolean equalTo(AccountingPeriodStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AccountingPeriodStatus of(Status895Enum value) { - return new AccountingPeriodStatus(value, 0); - } - - public static AccountingPeriodStatus of(String value) { - return new AccountingPeriodStatus(value, 1); - } - - public interface Visitor { - T visit(Status895Enum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AccountingPeriodStatus.class); - } - - @java.lang.Override - public AccountingPeriodStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status895Enum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Address.java b/src/main/java/com/merge/api/resources/accounting/types/Address.java deleted file mode 100644 index f13b182ae..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/Address.java +++ /dev/null @@ -1,618 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Address.Builder.class) -public final class Address { - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional type; - - private final Optional street1; - - private final Optional street2; - - private final Optional city; - - private final Optional state; - - private final Optional countrySubdivision; - - private final Optional country; - - private final Optional zipCode; - - private final Map additionalProperties; - - private Address( - Optional createdAt, - Optional modifiedAt, - Optional type, - Optional street1, - Optional street2, - Optional city, - Optional state, - Optional countrySubdivision, - Optional country, - Optional zipCode, - Map additionalProperties) { - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.type = type; - this.street1 = street1; - this.street2 = street2; - this.city = city; - this.state = state; - this.countrySubdivision = countrySubdivision; - this.country = country; - this.zipCode = zipCode; - this.additionalProperties = additionalProperties; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The address type. - *
    - *
  • BILLING - BILLING
  • - *
  • SHIPPING - SHIPPING
  • - *
- */ - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return Line 1 of the address's street. - */ - @JsonProperty("street_1") - public Optional getStreet1() { - return street1; - } - - /** - * @return Line 2 of the address's street. - */ - @JsonProperty("street_2") - public Optional getStreet2() { - return street2; - } - - /** - * @return The address's city. - */ - @JsonProperty("city") - public Optional getCity() { - return city; - } - - @JsonProperty("state") - public Optional getState() { - return state; - } - - /** - * @return The address's state or region. - */ - @JsonProperty("country_subdivision") - public Optional getCountrySubdivision() { - return countrySubdivision; - } - - /** - * @return The address's country. - *
    - *
  • AF - Afghanistan
  • - *
  • AX - Ã…land Islands
  • - *
  • AL - Albania
  • - *
  • DZ - Algeria
  • - *
  • AS - American Samoa
  • - *
  • AD - Andorra
  • - *
  • AO - Angola
  • - *
  • AI - Anguilla
  • - *
  • AQ - Antarctica
  • - *
  • AG - Antigua and Barbuda
  • - *
  • AR - Argentina
  • - *
  • AM - Armenia
  • - *
  • AW - Aruba
  • - *
  • AU - Australia
  • - *
  • AT - Austria
  • - *
  • AZ - Azerbaijan
  • - *
  • BS - Bahamas
  • - *
  • BH - Bahrain
  • - *
  • BD - Bangladesh
  • - *
  • BB - Barbados
  • - *
  • BY - Belarus
  • - *
  • BE - Belgium
  • - *
  • BZ - Belize
  • - *
  • BJ - Benin
  • - *
  • BM - Bermuda
  • - *
  • BT - Bhutan
  • - *
  • BO - Bolivia
  • - *
  • BQ - Bonaire, Sint Eustatius and Saba
  • - *
  • BA - Bosnia and Herzegovina
  • - *
  • BW - Botswana
  • - *
  • BV - Bouvet Island
  • - *
  • BR - Brazil
  • - *
  • IO - British Indian Ocean Territory
  • - *
  • BN - Brunei
  • - *
  • BG - Bulgaria
  • - *
  • BF - Burkina Faso
  • - *
  • BI - Burundi
  • - *
  • CV - Cabo Verde
  • - *
  • KH - Cambodia
  • - *
  • CM - Cameroon
  • - *
  • CA - Canada
  • - *
  • KY - Cayman Islands
  • - *
  • CF - Central African Republic
  • - *
  • TD - Chad
  • - *
  • CL - Chile
  • - *
  • CN - China
  • - *
  • CX - Christmas Island
  • - *
  • CC - Cocos (Keeling) Islands
  • - *
  • CO - Colombia
  • - *
  • KM - Comoros
  • - *
  • CG - Congo
  • - *
  • CD - Congo (the Democratic Republic of the)
  • - *
  • CK - Cook Islands
  • - *
  • CR - Costa Rica
  • - *
  • CI - Côte d'Ivoire
  • - *
  • HR - Croatia
  • - *
  • CU - Cuba
  • - *
  • CW - Curaçao
  • - *
  • CY - Cyprus
  • - *
  • CZ - Czechia
  • - *
  • DK - Denmark
  • - *
  • DJ - Djibouti
  • - *
  • DM - Dominica
  • - *
  • DO - Dominican Republic
  • - *
  • EC - Ecuador
  • - *
  • EG - Egypt
  • - *
  • SV - El Salvador
  • - *
  • GQ - Equatorial Guinea
  • - *
  • ER - Eritrea
  • - *
  • EE - Estonia
  • - *
  • SZ - Eswatini
  • - *
  • ET - Ethiopia
  • - *
  • FK - Falkland Islands (Malvinas)
  • - *
  • FO - Faroe Islands
  • - *
  • FJ - Fiji
  • - *
  • FI - Finland
  • - *
  • FR - France
  • - *
  • GF - French Guiana
  • - *
  • PF - French Polynesia
  • - *
  • TF - French Southern Territories
  • - *
  • GA - Gabon
  • - *
  • GM - Gambia
  • - *
  • GE - Georgia
  • - *
  • DE - Germany
  • - *
  • GH - Ghana
  • - *
  • GI - Gibraltar
  • - *
  • GR - Greece
  • - *
  • GL - Greenland
  • - *
  • GD - Grenada
  • - *
  • GP - Guadeloupe
  • - *
  • GU - Guam
  • - *
  • GT - Guatemala
  • - *
  • GG - Guernsey
  • - *
  • GN - Guinea
  • - *
  • GW - Guinea-Bissau
  • - *
  • GY - Guyana
  • - *
  • HT - Haiti
  • - *
  • HM - Heard Island and McDonald Islands
  • - *
  • VA - Holy See
  • - *
  • HN - Honduras
  • - *
  • HK - Hong Kong
  • - *
  • HU - Hungary
  • - *
  • IS - Iceland
  • - *
  • IN - India
  • - *
  • ID - Indonesia
  • - *
  • IR - Iran
  • - *
  • IQ - Iraq
  • - *
  • IE - Ireland
  • - *
  • IM - Isle of Man
  • - *
  • IL - Israel
  • - *
  • IT - Italy
  • - *
  • JM - Jamaica
  • - *
  • JP - Japan
  • - *
  • JE - Jersey
  • - *
  • JO - Jordan
  • - *
  • KZ - Kazakhstan
  • - *
  • KE - Kenya
  • - *
  • KI - Kiribati
  • - *
  • KW - Kuwait
  • - *
  • KG - Kyrgyzstan
  • - *
  • LA - Laos
  • - *
  • LV - Latvia
  • - *
  • LB - Lebanon
  • - *
  • LS - Lesotho
  • - *
  • LR - Liberia
  • - *
  • LY - Libya
  • - *
  • LI - Liechtenstein
  • - *
  • LT - Lithuania
  • - *
  • LU - Luxembourg
  • - *
  • MO - Macao
  • - *
  • MG - Madagascar
  • - *
  • MW - Malawi
  • - *
  • MY - Malaysia
  • - *
  • MV - Maldives
  • - *
  • ML - Mali
  • - *
  • MT - Malta
  • - *
  • MH - Marshall Islands
  • - *
  • MQ - Martinique
  • - *
  • MR - Mauritania
  • - *
  • MU - Mauritius
  • - *
  • YT - Mayotte
  • - *
  • MX - Mexico
  • - *
  • FM - Micronesia (Federated States of)
  • - *
  • MD - Moldova
  • - *
  • MC - Monaco
  • - *
  • MN - Mongolia
  • - *
  • ME - Montenegro
  • - *
  • MS - Montserrat
  • - *
  • MA - Morocco
  • - *
  • MZ - Mozambique
  • - *
  • MM - Myanmar
  • - *
  • NA - Namibia
  • - *
  • NR - Nauru
  • - *
  • NP - Nepal
  • - *
  • NL - Netherlands
  • - *
  • NC - New Caledonia
  • - *
  • NZ - New Zealand
  • - *
  • NI - Nicaragua
  • - *
  • NE - Niger
  • - *
  • NG - Nigeria
  • - *
  • NU - Niue
  • - *
  • NF - Norfolk Island
  • - *
  • KP - North Korea
  • - *
  • MK - North Macedonia
  • - *
  • MP - Northern Mariana Islands
  • - *
  • NO - Norway
  • - *
  • OM - Oman
  • - *
  • PK - Pakistan
  • - *
  • PW - Palau
  • - *
  • PS - Palestine, State of
  • - *
  • PA - Panama
  • - *
  • PG - Papua New Guinea
  • - *
  • PY - Paraguay
  • - *
  • PE - Peru
  • - *
  • PH - Philippines
  • - *
  • PN - Pitcairn
  • - *
  • PL - Poland
  • - *
  • PT - Portugal
  • - *
  • PR - Puerto Rico
  • - *
  • QA - Qatar
  • - *
  • RE - Réunion
  • - *
  • RO - Romania
  • - *
  • RU - Russia
  • - *
  • RW - Rwanda
  • - *
  • BL - Saint Barthélemy
  • - *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • - *
  • KN - Saint Kitts and Nevis
  • - *
  • LC - Saint Lucia
  • - *
  • MF - Saint Martin (French part)
  • - *
  • PM - Saint Pierre and Miquelon
  • - *
  • VC - Saint Vincent and the Grenadines
  • - *
  • WS - Samoa
  • - *
  • SM - San Marino
  • - *
  • ST - Sao Tome and Principe
  • - *
  • SA - Saudi Arabia
  • - *
  • SN - Senegal
  • - *
  • RS - Serbia
  • - *
  • SC - Seychelles
  • - *
  • SL - Sierra Leone
  • - *
  • SG - Singapore
  • - *
  • SX - Sint Maarten (Dutch part)
  • - *
  • SK - Slovakia
  • - *
  • SI - Slovenia
  • - *
  • SB - Solomon Islands
  • - *
  • SO - Somalia
  • - *
  • ZA - South Africa
  • - *
  • GS - South Georgia and the South Sandwich Islands
  • - *
  • KR - South Korea
  • - *
  • SS - South Sudan
  • - *
  • ES - Spain
  • - *
  • LK - Sri Lanka
  • - *
  • SD - Sudan
  • - *
  • SR - Suriname
  • - *
  • SJ - Svalbard and Jan Mayen
  • - *
  • SE - Sweden
  • - *
  • CH - Switzerland
  • - *
  • SY - Syria
  • - *
  • TW - Taiwan
  • - *
  • TJ - Tajikistan
  • - *
  • TZ - Tanzania
  • - *
  • TH - Thailand
  • - *
  • TL - Timor-Leste
  • - *
  • TG - Togo
  • - *
  • TK - Tokelau
  • - *
  • TO - Tonga
  • - *
  • TT - Trinidad and Tobago
  • - *
  • TN - Tunisia
  • - *
  • TR - Turkey
  • - *
  • TM - Turkmenistan
  • - *
  • TC - Turks and Caicos Islands
  • - *
  • TV - Tuvalu
  • - *
  • UG - Uganda
  • - *
  • UA - Ukraine
  • - *
  • AE - United Arab Emirates
  • - *
  • GB - United Kingdom
  • - *
  • UM - United States Minor Outlying Islands
  • - *
  • US - United States of America
  • - *
  • UY - Uruguay
  • - *
  • UZ - Uzbekistan
  • - *
  • VU - Vanuatu
  • - *
  • VE - Venezuela
  • - *
  • VN - Vietnam
  • - *
  • VG - Virgin Islands (British)
  • - *
  • VI - Virgin Islands (U.S.)
  • - *
  • WF - Wallis and Futuna
  • - *
  • EH - Western Sahara
  • - *
  • YE - Yemen
  • - *
  • ZM - Zambia
  • - *
  • ZW - Zimbabwe
  • - *
- */ - @JsonProperty("country") - public Optional getCountry() { - return country; - } - - /** - * @return The address's zip code. - */ - @JsonProperty("zip_code") - public Optional getZipCode() { - return zipCode; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Address && equalTo((Address) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Address other) { - return createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && type.equals(other.type) - && street1.equals(other.street1) - && street2.equals(other.street2) - && city.equals(other.city) - && state.equals(other.state) - && countrySubdivision.equals(other.countrySubdivision) - && country.equals(other.country) - && zipCode.equals(other.zipCode); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAt, - this.modifiedAt, - this.type, - this.street1, - this.street2, - this.city, - this.state, - this.countrySubdivision, - this.country, - this.zipCode); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional type = Optional.empty(); - - private Optional street1 = Optional.empty(); - - private Optional street2 = Optional.empty(); - - private Optional city = Optional.empty(); - - private Optional state = Optional.empty(); - - private Optional countrySubdivision = Optional.empty(); - - private Optional country = Optional.empty(); - - private Optional zipCode = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Address other) { - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - type(other.getType()); - street1(other.getStreet1()); - street2(other.getStreet2()); - city(other.getCity()); - state(other.getState()); - countrySubdivision(other.getCountrySubdivision()); - country(other.getCountry()); - zipCode(other.getZipCode()); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(AddressType type) { - this.type = Optional.ofNullable(type); - return this; - } - - @JsonSetter(value = "street_1", nulls = Nulls.SKIP) - public Builder street1(Optional street1) { - this.street1 = street1; - return this; - } - - public Builder street1(String street1) { - this.street1 = Optional.ofNullable(street1); - return this; - } - - @JsonSetter(value = "street_2", nulls = Nulls.SKIP) - public Builder street2(Optional street2) { - this.street2 = street2; - return this; - } - - public Builder street2(String street2) { - this.street2 = Optional.ofNullable(street2); - return this; - } - - @JsonSetter(value = "city", nulls = Nulls.SKIP) - public Builder city(Optional city) { - this.city = city; - return this; - } - - public Builder city(String city) { - this.city = Optional.ofNullable(city); - return this; - } - - @JsonSetter(value = "state", nulls = Nulls.SKIP) - public Builder state(Optional state) { - this.state = state; - return this; - } - - public Builder state(JsonNode state) { - this.state = Optional.ofNullable(state); - return this; - } - - @JsonSetter(value = "country_subdivision", nulls = Nulls.SKIP) - public Builder countrySubdivision(Optional countrySubdivision) { - this.countrySubdivision = countrySubdivision; - return this; - } - - public Builder countrySubdivision(String countrySubdivision) { - this.countrySubdivision = Optional.ofNullable(countrySubdivision); - return this; - } - - @JsonSetter(value = "country", nulls = Nulls.SKIP) - public Builder country(Optional country) { - this.country = country; - return this; - } - - public Builder country(AddressCountry country) { - this.country = Optional.ofNullable(country); - return this; - } - - @JsonSetter(value = "zip_code", nulls = Nulls.SKIP) - public Builder zipCode(Optional zipCode) { - this.zipCode = zipCode; - return this; - } - - public Builder zipCode(String zipCode) { - this.zipCode = Optional.ofNullable(zipCode); - return this; - } - - public Address build() { - return new Address( - createdAt, - modifiedAt, - type, - street1, - street2, - city, - state, - countrySubdivision, - country, - zipCode, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AddressCountry.java b/src/main/java/com/merge/api/resources/accounting/types/AddressCountry.java deleted file mode 100644 index 563063501..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AddressCountry.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressCountry.Deserializer.class) -public final class AddressCountry { - private final Object value; - - private final int type; - - private AddressCountry(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CountryEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressCountry && equalTo((AddressCountry) other); - } - - private boolean equalTo(AddressCountry other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressCountry of(CountryEnum value) { - return new AddressCountry(value, 0); - } - - public static AddressCountry of(String value) { - return new AddressCountry(value, 1); - } - - public interface Visitor { - T visit(CountryEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressCountry.class); - } - - @java.lang.Override - public AddressCountry deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CountryEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AddressRequest.java b/src/main/java/com/merge/api/resources/accounting/types/AddressRequest.java deleted file mode 100644 index 66dbb21f1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AddressRequest.java +++ /dev/null @@ -1,585 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AddressRequest.Builder.class) -public final class AddressRequest { - private final Optional type; - - private final Optional street1; - - private final Optional street2; - - private final Optional city; - - private final Optional countrySubdivision; - - private final Optional country; - - private final Optional zipCode; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private AddressRequest( - Optional type, - Optional street1, - Optional street2, - Optional city, - Optional countrySubdivision, - Optional country, - Optional zipCode, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.type = type; - this.street1 = street1; - this.street2 = street2; - this.city = city; - this.countrySubdivision = countrySubdivision; - this.country = country; - this.zipCode = zipCode; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The address type. - *
    - *
  • BILLING - BILLING
  • - *
  • SHIPPING - SHIPPING
  • - *
- */ - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return Line 1 of the address's street. - */ - @JsonProperty("street_1") - public Optional getStreet1() { - return street1; - } - - /** - * @return Line 2 of the address's street. - */ - @JsonProperty("street_2") - public Optional getStreet2() { - return street2; - } - - /** - * @return The address's city. - */ - @JsonProperty("city") - public Optional getCity() { - return city; - } - - /** - * @return The address's state or region. - */ - @JsonProperty("country_subdivision") - public Optional getCountrySubdivision() { - return countrySubdivision; - } - - /** - * @return The address's country. - *
    - *
  • AF - Afghanistan
  • - *
  • AX - Ã…land Islands
  • - *
  • AL - Albania
  • - *
  • DZ - Algeria
  • - *
  • AS - American Samoa
  • - *
  • AD - Andorra
  • - *
  • AO - Angola
  • - *
  • AI - Anguilla
  • - *
  • AQ - Antarctica
  • - *
  • AG - Antigua and Barbuda
  • - *
  • AR - Argentina
  • - *
  • AM - Armenia
  • - *
  • AW - Aruba
  • - *
  • AU - Australia
  • - *
  • AT - Austria
  • - *
  • AZ - Azerbaijan
  • - *
  • BS - Bahamas
  • - *
  • BH - Bahrain
  • - *
  • BD - Bangladesh
  • - *
  • BB - Barbados
  • - *
  • BY - Belarus
  • - *
  • BE - Belgium
  • - *
  • BZ - Belize
  • - *
  • BJ - Benin
  • - *
  • BM - Bermuda
  • - *
  • BT - Bhutan
  • - *
  • BO - Bolivia
  • - *
  • BQ - Bonaire, Sint Eustatius and Saba
  • - *
  • BA - Bosnia and Herzegovina
  • - *
  • BW - Botswana
  • - *
  • BV - Bouvet Island
  • - *
  • BR - Brazil
  • - *
  • IO - British Indian Ocean Territory
  • - *
  • BN - Brunei
  • - *
  • BG - Bulgaria
  • - *
  • BF - Burkina Faso
  • - *
  • BI - Burundi
  • - *
  • CV - Cabo Verde
  • - *
  • KH - Cambodia
  • - *
  • CM - Cameroon
  • - *
  • CA - Canada
  • - *
  • KY - Cayman Islands
  • - *
  • CF - Central African Republic
  • - *
  • TD - Chad
  • - *
  • CL - Chile
  • - *
  • CN - China
  • - *
  • CX - Christmas Island
  • - *
  • CC - Cocos (Keeling) Islands
  • - *
  • CO - Colombia
  • - *
  • KM - Comoros
  • - *
  • CG - Congo
  • - *
  • CD - Congo (the Democratic Republic of the)
  • - *
  • CK - Cook Islands
  • - *
  • CR - Costa Rica
  • - *
  • CI - Côte d'Ivoire
  • - *
  • HR - Croatia
  • - *
  • CU - Cuba
  • - *
  • CW - Curaçao
  • - *
  • CY - Cyprus
  • - *
  • CZ - Czechia
  • - *
  • DK - Denmark
  • - *
  • DJ - Djibouti
  • - *
  • DM - Dominica
  • - *
  • DO - Dominican Republic
  • - *
  • EC - Ecuador
  • - *
  • EG - Egypt
  • - *
  • SV - El Salvador
  • - *
  • GQ - Equatorial Guinea
  • - *
  • ER - Eritrea
  • - *
  • EE - Estonia
  • - *
  • SZ - Eswatini
  • - *
  • ET - Ethiopia
  • - *
  • FK - Falkland Islands (Malvinas)
  • - *
  • FO - Faroe Islands
  • - *
  • FJ - Fiji
  • - *
  • FI - Finland
  • - *
  • FR - France
  • - *
  • GF - French Guiana
  • - *
  • PF - French Polynesia
  • - *
  • TF - French Southern Territories
  • - *
  • GA - Gabon
  • - *
  • GM - Gambia
  • - *
  • GE - Georgia
  • - *
  • DE - Germany
  • - *
  • GH - Ghana
  • - *
  • GI - Gibraltar
  • - *
  • GR - Greece
  • - *
  • GL - Greenland
  • - *
  • GD - Grenada
  • - *
  • GP - Guadeloupe
  • - *
  • GU - Guam
  • - *
  • GT - Guatemala
  • - *
  • GG - Guernsey
  • - *
  • GN - Guinea
  • - *
  • GW - Guinea-Bissau
  • - *
  • GY - Guyana
  • - *
  • HT - Haiti
  • - *
  • HM - Heard Island and McDonald Islands
  • - *
  • VA - Holy See
  • - *
  • HN - Honduras
  • - *
  • HK - Hong Kong
  • - *
  • HU - Hungary
  • - *
  • IS - Iceland
  • - *
  • IN - India
  • - *
  • ID - Indonesia
  • - *
  • IR - Iran
  • - *
  • IQ - Iraq
  • - *
  • IE - Ireland
  • - *
  • IM - Isle of Man
  • - *
  • IL - Israel
  • - *
  • IT - Italy
  • - *
  • JM - Jamaica
  • - *
  • JP - Japan
  • - *
  • JE - Jersey
  • - *
  • JO - Jordan
  • - *
  • KZ - Kazakhstan
  • - *
  • KE - Kenya
  • - *
  • KI - Kiribati
  • - *
  • KW - Kuwait
  • - *
  • KG - Kyrgyzstan
  • - *
  • LA - Laos
  • - *
  • LV - Latvia
  • - *
  • LB - Lebanon
  • - *
  • LS - Lesotho
  • - *
  • LR - Liberia
  • - *
  • LY - Libya
  • - *
  • LI - Liechtenstein
  • - *
  • LT - Lithuania
  • - *
  • LU - Luxembourg
  • - *
  • MO - Macao
  • - *
  • MG - Madagascar
  • - *
  • MW - Malawi
  • - *
  • MY - Malaysia
  • - *
  • MV - Maldives
  • - *
  • ML - Mali
  • - *
  • MT - Malta
  • - *
  • MH - Marshall Islands
  • - *
  • MQ - Martinique
  • - *
  • MR - Mauritania
  • - *
  • MU - Mauritius
  • - *
  • YT - Mayotte
  • - *
  • MX - Mexico
  • - *
  • FM - Micronesia (Federated States of)
  • - *
  • MD - Moldova
  • - *
  • MC - Monaco
  • - *
  • MN - Mongolia
  • - *
  • ME - Montenegro
  • - *
  • MS - Montserrat
  • - *
  • MA - Morocco
  • - *
  • MZ - Mozambique
  • - *
  • MM - Myanmar
  • - *
  • NA - Namibia
  • - *
  • NR - Nauru
  • - *
  • NP - Nepal
  • - *
  • NL - Netherlands
  • - *
  • NC - New Caledonia
  • - *
  • NZ - New Zealand
  • - *
  • NI - Nicaragua
  • - *
  • NE - Niger
  • - *
  • NG - Nigeria
  • - *
  • NU - Niue
  • - *
  • NF - Norfolk Island
  • - *
  • KP - North Korea
  • - *
  • MK - North Macedonia
  • - *
  • MP - Northern Mariana Islands
  • - *
  • NO - Norway
  • - *
  • OM - Oman
  • - *
  • PK - Pakistan
  • - *
  • PW - Palau
  • - *
  • PS - Palestine, State of
  • - *
  • PA - Panama
  • - *
  • PG - Papua New Guinea
  • - *
  • PY - Paraguay
  • - *
  • PE - Peru
  • - *
  • PH - Philippines
  • - *
  • PN - Pitcairn
  • - *
  • PL - Poland
  • - *
  • PT - Portugal
  • - *
  • PR - Puerto Rico
  • - *
  • QA - Qatar
  • - *
  • RE - Réunion
  • - *
  • RO - Romania
  • - *
  • RU - Russia
  • - *
  • RW - Rwanda
  • - *
  • BL - Saint Barthélemy
  • - *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • - *
  • KN - Saint Kitts and Nevis
  • - *
  • LC - Saint Lucia
  • - *
  • MF - Saint Martin (French part)
  • - *
  • PM - Saint Pierre and Miquelon
  • - *
  • VC - Saint Vincent and the Grenadines
  • - *
  • WS - Samoa
  • - *
  • SM - San Marino
  • - *
  • ST - Sao Tome and Principe
  • - *
  • SA - Saudi Arabia
  • - *
  • SN - Senegal
  • - *
  • RS - Serbia
  • - *
  • SC - Seychelles
  • - *
  • SL - Sierra Leone
  • - *
  • SG - Singapore
  • - *
  • SX - Sint Maarten (Dutch part)
  • - *
  • SK - Slovakia
  • - *
  • SI - Slovenia
  • - *
  • SB - Solomon Islands
  • - *
  • SO - Somalia
  • - *
  • ZA - South Africa
  • - *
  • GS - South Georgia and the South Sandwich Islands
  • - *
  • KR - South Korea
  • - *
  • SS - South Sudan
  • - *
  • ES - Spain
  • - *
  • LK - Sri Lanka
  • - *
  • SD - Sudan
  • - *
  • SR - Suriname
  • - *
  • SJ - Svalbard and Jan Mayen
  • - *
  • SE - Sweden
  • - *
  • CH - Switzerland
  • - *
  • SY - Syria
  • - *
  • TW - Taiwan
  • - *
  • TJ - Tajikistan
  • - *
  • TZ - Tanzania
  • - *
  • TH - Thailand
  • - *
  • TL - Timor-Leste
  • - *
  • TG - Togo
  • - *
  • TK - Tokelau
  • - *
  • TO - Tonga
  • - *
  • TT - Trinidad and Tobago
  • - *
  • TN - Tunisia
  • - *
  • TR - Turkey
  • - *
  • TM - Turkmenistan
  • - *
  • TC - Turks and Caicos Islands
  • - *
  • TV - Tuvalu
  • - *
  • UG - Uganda
  • - *
  • UA - Ukraine
  • - *
  • AE - United Arab Emirates
  • - *
  • GB - United Kingdom
  • - *
  • UM - United States Minor Outlying Islands
  • - *
  • US - United States of America
  • - *
  • UY - Uruguay
  • - *
  • UZ - Uzbekistan
  • - *
  • VU - Vanuatu
  • - *
  • VE - Venezuela
  • - *
  • VN - Vietnam
  • - *
  • VG - Virgin Islands (British)
  • - *
  • VI - Virgin Islands (U.S.)
  • - *
  • WF - Wallis and Futuna
  • - *
  • EH - Western Sahara
  • - *
  • YE - Yemen
  • - *
  • ZM - Zambia
  • - *
  • ZW - Zimbabwe
  • - *
- */ - @JsonProperty("country") - public Optional getCountry() { - return country; - } - - /** - * @return The address's zip code. - */ - @JsonProperty("zip_code") - public Optional getZipCode() { - return zipCode; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressRequest && equalTo((AddressRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AddressRequest other) { - return type.equals(other.type) - && street1.equals(other.street1) - && street2.equals(other.street2) - && city.equals(other.city) - && countrySubdivision.equals(other.countrySubdivision) - && country.equals(other.country) - && zipCode.equals(other.zipCode) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.street1, - this.street2, - this.city, - this.countrySubdivision, - this.country, - this.zipCode, - this.integrationParams, - this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional type = Optional.empty(); - - private Optional street1 = Optional.empty(); - - private Optional street2 = Optional.empty(); - - private Optional city = Optional.empty(); - - private Optional countrySubdivision = Optional.empty(); - - private Optional country = Optional.empty(); - - private Optional zipCode = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AddressRequest other) { - type(other.getType()); - street1(other.getStreet1()); - street2(other.getStreet2()); - city(other.getCity()); - countrySubdivision(other.getCountrySubdivision()); - country(other.getCountry()); - zipCode(other.getZipCode()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(AddressRequestType type) { - this.type = Optional.ofNullable(type); - return this; - } - - @JsonSetter(value = "street_1", nulls = Nulls.SKIP) - public Builder street1(Optional street1) { - this.street1 = street1; - return this; - } - - public Builder street1(String street1) { - this.street1 = Optional.ofNullable(street1); - return this; - } - - @JsonSetter(value = "street_2", nulls = Nulls.SKIP) - public Builder street2(Optional street2) { - this.street2 = street2; - return this; - } - - public Builder street2(String street2) { - this.street2 = Optional.ofNullable(street2); - return this; - } - - @JsonSetter(value = "city", nulls = Nulls.SKIP) - public Builder city(Optional city) { - this.city = city; - return this; - } - - public Builder city(String city) { - this.city = Optional.ofNullable(city); - return this; - } - - @JsonSetter(value = "country_subdivision", nulls = Nulls.SKIP) - public Builder countrySubdivision(Optional countrySubdivision) { - this.countrySubdivision = countrySubdivision; - return this; - } - - public Builder countrySubdivision(String countrySubdivision) { - this.countrySubdivision = Optional.ofNullable(countrySubdivision); - return this; - } - - @JsonSetter(value = "country", nulls = Nulls.SKIP) - public Builder country(Optional country) { - this.country = country; - return this; - } - - public Builder country(AddressRequestCountry country) { - this.country = Optional.ofNullable(country); - return this; - } - - @JsonSetter(value = "zip_code", nulls = Nulls.SKIP) - public Builder zipCode(Optional zipCode) { - this.zipCode = zipCode; - return this; - } - - public Builder zipCode(String zipCode) { - this.zipCode = Optional.ofNullable(zipCode); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public AddressRequest build() { - return new AddressRequest( - type, - street1, - street2, - city, - countrySubdivision, - country, - zipCode, - integrationParams, - linkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AddressRequestCountry.java b/src/main/java/com/merge/api/resources/accounting/types/AddressRequestCountry.java deleted file mode 100644 index 2447656bf..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AddressRequestCountry.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressRequestCountry.Deserializer.class) -public final class AddressRequestCountry { - private final Object value; - - private final int type; - - private AddressRequestCountry(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CountryEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressRequestCountry && equalTo((AddressRequestCountry) other); - } - - private boolean equalTo(AddressRequestCountry other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressRequestCountry of(CountryEnum value) { - return new AddressRequestCountry(value, 0); - } - - public static AddressRequestCountry of(String value) { - return new AddressRequestCountry(value, 1); - } - - public interface Visitor { - T visit(CountryEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressRequestCountry.class); - } - - @java.lang.Override - public AddressRequestCountry deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CountryEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AddressRequestType.java b/src/main/java/com/merge/api/resources/accounting/types/AddressRequestType.java deleted file mode 100644 index 1fe829512..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AddressRequestType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressRequestType.Deserializer.class) -public final class AddressRequestType { - private final Object value; - - private final int type; - - private AddressRequestType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AddressTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressRequestType && equalTo((AddressRequestType) other); - } - - private boolean equalTo(AddressRequestType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressRequestType of(AddressTypeEnum value) { - return new AddressRequestType(value, 0); - } - - public static AddressRequestType of(String value) { - return new AddressRequestType(value, 1); - } - - public interface Visitor { - T visit(AddressTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressRequestType.class); - } - - @java.lang.Override - public AddressRequestType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AddressTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AddressType.java b/src/main/java/com/merge/api/resources/accounting/types/AddressType.java deleted file mode 100644 index 928177578..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AddressType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressType.Deserializer.class) -public final class AddressType { - private final Object value; - - private final int type; - - private AddressType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AddressTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressType && equalTo((AddressType) other); - } - - private boolean equalTo(AddressType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressType of(AddressTypeEnum value) { - return new AddressType(value, 0); - } - - public static AddressType of(String value) { - return new AddressType(value, 1); - } - - public interface Visitor { - T visit(AddressTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressType.class); - } - - @java.lang.Override - public AddressType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AddressTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AddressTypeEnum.java b/src/main/java/com/merge/api/resources/accounting/types/AddressTypeEnum.java deleted file mode 100644 index aa83699b5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AddressTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AddressTypeEnum { - BILLING("BILLING"), - - SHIPPING("SHIPPING"); - - private final String value; - - AddressTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AdvancedMetadata.java b/src/main/java/com/merge/api/resources/accounting/types/AdvancedMetadata.java deleted file mode 100644 index f38530735..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AdvancedMetadata.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedMetadata.Builder.class) -public final class AdvancedMetadata { - private final String id; - - private final Optional displayName; - - private final Optional description; - - private final Optional isRequired; - - private final Optional isCustom; - - private final Optional> fieldChoices; - - private final Map additionalProperties; - - private AdvancedMetadata( - String id, - Optional displayName, - Optional description, - Optional isRequired, - Optional isCustom, - Optional> fieldChoices, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.description = description; - this.isRequired = isRequired; - this.isCustom = isCustom; - this.fieldChoices = fieldChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedMetadata other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && description.equals(other.description) - && isRequired.equals(other.isRequired) - && isCustom.equals(other.isCustom) - && fieldChoices.equals(other.fieldChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - _FinalStage id(@NotNull String id); - - Builder from(AdvancedMetadata other); - } - - public interface _FinalStage { - AdvancedMetadata build(); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage description(Optional description); - - _FinalStage description(String description); - - _FinalStage isRequired(Optional isRequired); - - _FinalStage isRequired(Boolean isRequired); - - _FinalStage isCustom(Optional isCustom); - - _FinalStage isCustom(Boolean isCustom); - - _FinalStage fieldChoices(Optional> fieldChoices); - - _FinalStage fieldChoices(List fieldChoices); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, _FinalStage { - private String id; - - private Optional> fieldChoices = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedMetadata other) { - id(other.getId()); - displayName(other.getDisplayName()); - description(other.getDescription()); - isRequired(other.getIsRequired()); - isCustom(other.getIsCustom()); - fieldChoices(other.getFieldChoices()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public _FinalStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - public _FinalStage fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public _FinalStage fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - @java.lang.Override - public _FinalStage isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public _FinalStage isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - @java.lang.Override - public _FinalStage isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public _FinalStage isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - @java.lang.Override - public _FinalStage description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @java.lang.Override - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public _FinalStage description(Optional description) { - this.description = description; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - @java.lang.Override - public AdvancedMetadata build() { - return new AdvancedMetadata( - id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/resources/accounting/types/AsyncPassthroughReciept.java deleted file mode 100644 index 6ef56c833..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AsyncPassthroughReciept.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) -public final class AsyncPassthroughReciept { - private final String asyncPassthroughReceiptId; - - private final Map additionalProperties; - - private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("async_passthrough_receipt_id") - public String getAsyncPassthroughReceiptId() { - return asyncPassthroughReceiptId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AsyncPassthroughReciept other) { - return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncPassthroughReceiptId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AsyncPassthroughReceiptIdStage builder() { - return new Builder(); - } - - public interface AsyncPassthroughReceiptIdStage { - _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); - - Builder from(AsyncPassthroughReciept other); - } - - public interface _FinalStage { - AsyncPassthroughReciept build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { - private String asyncPassthroughReceiptId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AsyncPassthroughReciept other) { - asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); - return this; - } - - @java.lang.Override - @JsonSetter("async_passthrough_receipt_id") - public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - return this; - } - - @java.lang.Override - public AsyncPassthroughReciept build() { - return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskStatus.java b/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskStatus.java deleted file mode 100644 index ee8c3bf18..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AsyncPostTaskStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AsyncPostTaskStatus.Deserializer.class) -public final class AsyncPostTaskStatus { - private final Object value; - - private final int type; - - private AsyncPostTaskStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AsyncPostTaskStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPostTaskStatus && equalTo((AsyncPostTaskStatus) other); - } - - private boolean equalTo(AsyncPostTaskStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AsyncPostTaskStatus of(AsyncPostTaskStatusEnum value) { - return new AsyncPostTaskStatus(value, 0); - } - - public static AsyncPostTaskStatus of(String value) { - return new AsyncPostTaskStatus(value, 1); - } - - public interface Visitor { - T visit(AsyncPostTaskStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AsyncPostTaskStatus.class); - } - - @java.lang.Override - public AsyncPostTaskStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AsyncPostTaskStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AuditLogEvent.java b/src/main/java/com/merge/api/resources/accounting/types/AuditLogEvent.java deleted file mode 100644 index d0980b0d4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AuditLogEvent.java +++ /dev/null @@ -1,447 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditLogEvent.Builder.class) -public final class AuditLogEvent { - private final Optional id; - - private final Optional userName; - - private final Optional userEmail; - - private final AuditLogEventRole role; - - private final String ipAddress; - - private final AuditLogEventEventType eventType; - - private final String eventDescription; - - private final Optional createdAt; - - private final Map additionalProperties; - - private AuditLogEvent( - Optional id, - Optional userName, - Optional userEmail, - AuditLogEventRole role, - String ipAddress, - AuditLogEventEventType eventType, - String eventDescription, - Optional createdAt, - Map additionalProperties) { - this.id = id; - this.userName = userName; - this.userEmail = userEmail; - this.role = role; - this.ipAddress = ipAddress; - this.eventType = eventType; - this.eventDescription = eventDescription; - this.createdAt = createdAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The User's full name at the time of this Event occurring. - */ - @JsonProperty("user_name") - public Optional getUserName() { - return userName; - } - - /** - * @return The User's email at the time of this Event occurring. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - /** - * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. - *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- */ - @JsonProperty("role") - public AuditLogEventRole getRole() { - return role; - } - - @JsonProperty("ip_address") - public String getIpAddress() { - return ipAddress; - } - - /** - * @return Designates the type of event that occurred. - *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- */ - @JsonProperty("event_type") - public AuditLogEventEventType getEventType() { - return eventType; - } - - @JsonProperty("event_description") - public String getEventDescription() { - return eventDescription; - } - - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditLogEvent other) { - return id.equals(other.id) - && userName.equals(other.userName) - && userEmail.equals(other.userEmail) - && role.equals(other.role) - && ipAddress.equals(other.ipAddress) - && eventType.equals(other.eventType) - && eventDescription.equals(other.eventDescription) - && createdAt.equals(other.createdAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.userName, - this.userEmail, - this.role, - this.ipAddress, - this.eventType, - this.eventDescription, - this.createdAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RoleStage builder() { - return new Builder(); - } - - public interface RoleStage { - IpAddressStage role(@NotNull AuditLogEventRole role); - - Builder from(AuditLogEvent other); - } - - public interface IpAddressStage { - EventTypeStage ipAddress(@NotNull String ipAddress); - } - - public interface EventTypeStage { - EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); - } - - public interface EventDescriptionStage { - _FinalStage eventDescription(@NotNull String eventDescription); - } - - public interface _FinalStage { - AuditLogEvent build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage userName(Optional userName); - - _FinalStage userName(String userName); - - _FinalStage userEmail(Optional userEmail); - - _FinalStage userEmail(String userEmail); - - _FinalStage createdAt(Optional createdAt); - - _FinalStage createdAt(OffsetDateTime createdAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { - private AuditLogEventRole role; - - private String ipAddress; - - private AuditLogEventEventType eventType; - - private String eventDescription; - - private Optional createdAt = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - private Optional userName = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AuditLogEvent other) { - id(other.getId()); - userName(other.getUserName()); - userEmail(other.getUserEmail()); - role(other.getRole()); - ipAddress(other.getIpAddress()); - eventType(other.getEventType()); - eventDescription(other.getEventDescription()); - createdAt(other.getCreatedAt()); - return this; - } - - /** - *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

- *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("role") - public IpAddressStage role(@NotNull AuditLogEventRole role) { - this.role = role; - return this; - } - - @java.lang.Override - @JsonSetter("ip_address") - public EventTypeStage ipAddress(@NotNull String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - *

Designates the type of event that occurred.

- *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("event_type") - public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { - this.eventType = eventType; - return this; - } - - @java.lang.Override - @JsonSetter("event_description") - public _FinalStage eventDescription(@NotNull String eventDescription) { - this.eventDescription = eventDescription; - return this; - } - - @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public _FinalStage createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The User's email at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public _FinalStage userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - *

The User's full name at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userName(String userName) { - this.userName = Optional.ofNullable(userName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_name", nulls = Nulls.SKIP) - public _FinalStage userName(Optional userName) { - this.userName = userName; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public AuditLogEvent build() { - return new AuditLogEvent( - id, - userName, - userEmail, - role, - ipAddress, - eventType, - eventDescription, - createdAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/resources/accounting/types/AuditLogEventEventType.java deleted file mode 100644 index 730ca99cd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AuditLogEventEventType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) -public final class AuditLogEventEventType { - private final Object value; - - private final int type; - - private AuditLogEventEventType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EventTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); - } - - private boolean equalTo(AuditLogEventEventType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventEventType of(EventTypeEnum value) { - return new AuditLogEventEventType(value, 0); - } - - public static AuditLogEventEventType of(String value) { - return new AuditLogEventEventType(value, 1); - } - - public interface Visitor { - T visit(EventTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventEventType.class); - } - - @java.lang.Override - public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AuditLogEventRole.java b/src/main/java/com/merge/api/resources/accounting/types/AuditLogEventRole.java deleted file mode 100644 index e001a3967..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AuditLogEventRole.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) -public final class AuditLogEventRole { - private final Object value; - - private final int type; - - private AuditLogEventRole(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RoleEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); - } - - private boolean equalTo(AuditLogEventRole other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventRole of(RoleEnum value) { - return new AuditLogEventRole(value, 0); - } - - public static AuditLogEventRole of(String value) { - return new AuditLogEventRole(value, 1); - } - - public interface Visitor { - T visit(RoleEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventRole.class); - } - - @java.lang.Override - public AuditLogEventRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/AvailableActions.java b/src/main/java/com/merge/api/resources/accounting/types/AvailableActions.java deleted file mode 100644 index 4ba96d8d7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/AvailableActions.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AvailableActions.Builder.class) -public final class AvailableActions { - private final AccountIntegration integration; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AvailableActions( - AccountIntegration integration, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.integration = integration; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AvailableActions && equalTo((AvailableActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AvailableActions other) { - return integration.equals(other.integration) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IntegrationStage builder() { - return new Builder(); - } - - public interface IntegrationStage { - PassthroughAvailableStage integration(@NotNull AccountIntegration integration); - - Builder from(AvailableActions other); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AvailableActions build(); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { - private AccountIntegration integration; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AvailableActions other) { - integration(other.getIntegration()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public AvailableActions build() { - return new AvailableActions( - integration, passthroughAvailable, availableModelOperations, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BalanceSheetCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/BalanceSheetCurrency.java deleted file mode 100644 index 4f67911de..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BalanceSheetCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BalanceSheetCurrency.Deserializer.class) -public final class BalanceSheetCurrency { - private final Object value; - - private final int type; - - private BalanceSheetCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BalanceSheetCurrency && equalTo((BalanceSheetCurrency) other); - } - - private boolean equalTo(BalanceSheetCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BalanceSheetCurrency of(TransactionCurrencyEnum value) { - return new BalanceSheetCurrency(value, 0); - } - - public static BalanceSheetCurrency of(String value) { - return new BalanceSheetCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BalanceSheetCurrency.class); - } - - @java.lang.Override - public BalanceSheetCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountAccountType.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountAccountType.java deleted file mode 100644 index cbb1e0c93..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountAccountType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedAccountAccountType.Deserializer.class) -public final class BankFeedAccountAccountType { - private final Object value; - - private final int type; - - private BankFeedAccountAccountType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((BankFeedAccountAccountTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedAccountAccountType && equalTo((BankFeedAccountAccountType) other); - } - - private boolean equalTo(BankFeedAccountAccountType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedAccountAccountType of(BankFeedAccountAccountTypeEnum value) { - return new BankFeedAccountAccountType(value, 0); - } - - public static BankFeedAccountAccountType of(String value) { - return new BankFeedAccountAccountType(value, 1); - } - - public interface Visitor { - T visit(BankFeedAccountAccountTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedAccountAccountType.class); - } - - @java.lang.Override - public BankFeedAccountAccountType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, BankFeedAccountAccountTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountCurrency.java deleted file mode 100644 index bccc953fd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedAccountCurrency.Deserializer.class) -public final class BankFeedAccountCurrency { - private final Object value; - - private final int type; - - private BankFeedAccountCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedAccountCurrency && equalTo((BankFeedAccountCurrency) other); - } - - private boolean equalTo(BankFeedAccountCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedAccountCurrency of(TransactionCurrencyEnum value) { - return new BankFeedAccountCurrency(value, 0); - } - - public static BankFeedAccountCurrency of(String value) { - return new BankFeedAccountCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedAccountCurrency.class); - } - - @java.lang.Override - public BankFeedAccountCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountFeedStatus.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountFeedStatus.java deleted file mode 100644 index 0d770f053..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountFeedStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedAccountFeedStatus.Deserializer.class) -public final class BankFeedAccountFeedStatus { - private final Object value; - - private final int type; - - private BankFeedAccountFeedStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((FeedStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedAccountFeedStatus && equalTo((BankFeedAccountFeedStatus) other); - } - - private boolean equalTo(BankFeedAccountFeedStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedAccountFeedStatus of(FeedStatusEnum value) { - return new BankFeedAccountFeedStatus(value, 0); - } - - public static BankFeedAccountFeedStatus of(String value) { - return new BankFeedAccountFeedStatus(value, 1); - } - - public interface Visitor { - T visit(FeedStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedAccountFeedStatus.class); - } - - @java.lang.Override - public BankFeedAccountFeedStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FeedStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestAccountType.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestAccountType.java deleted file mode 100644 index 89504c324..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestAccountType.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedAccountRequestAccountType.Deserializer.class) -public final class BankFeedAccountRequestAccountType { - private final Object value; - - private final int type; - - private BankFeedAccountRequestAccountType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((BankFeedAccountAccountTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedAccountRequestAccountType && equalTo((BankFeedAccountRequestAccountType) other); - } - - private boolean equalTo(BankFeedAccountRequestAccountType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedAccountRequestAccountType of(BankFeedAccountAccountTypeEnum value) { - return new BankFeedAccountRequestAccountType(value, 0); - } - - public static BankFeedAccountRequestAccountType of(String value) { - return new BankFeedAccountRequestAccountType(value, 1); - } - - public interface Visitor { - T visit(BankFeedAccountAccountTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedAccountRequestAccountType.class); - } - - @java.lang.Override - public BankFeedAccountRequestAccountType deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, BankFeedAccountAccountTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestCurrency.java deleted file mode 100644 index ce8393fae..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestCurrency.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedAccountRequestCurrency.Deserializer.class) -public final class BankFeedAccountRequestCurrency { - private final Object value; - - private final int type; - - private BankFeedAccountRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedAccountRequestCurrency && equalTo((BankFeedAccountRequestCurrency) other); - } - - private boolean equalTo(BankFeedAccountRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedAccountRequestCurrency of(TransactionCurrencyEnum value) { - return new BankFeedAccountRequestCurrency(value, 0); - } - - public static BankFeedAccountRequestCurrency of(String value) { - return new BankFeedAccountRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedAccountRequestCurrency.class); - } - - @java.lang.Override - public BankFeedAccountRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestFeedStatus.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestFeedStatus.java deleted file mode 100644 index 1d344ae85..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedAccountRequestFeedStatus.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedAccountRequestFeedStatus.Deserializer.class) -public final class BankFeedAccountRequestFeedStatus { - private final Object value; - - private final int type; - - private BankFeedAccountRequestFeedStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((FeedStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedAccountRequestFeedStatus && equalTo((BankFeedAccountRequestFeedStatus) other); - } - - private boolean equalTo(BankFeedAccountRequestFeedStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedAccountRequestFeedStatus of(FeedStatusEnum value) { - return new BankFeedAccountRequestFeedStatus(value, 0); - } - - public static BankFeedAccountRequestFeedStatus of(String value) { - return new BankFeedAccountRequestFeedStatus(value, 1); - } - - public interface Visitor { - T visit(FeedStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedAccountRequestFeedStatus.class); - } - - @java.lang.Override - public BankFeedAccountRequestFeedStatus deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FeedStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionCreditOrDebit.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionCreditOrDebit.java deleted file mode 100644 index 568aae666..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionCreditOrDebit.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedTransactionCreditOrDebit.Deserializer.class) -public final class BankFeedTransactionCreditOrDebit { - private final Object value; - - private final int type; - - private BankFeedTransactionCreditOrDebit(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CreditOrDebitEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedTransactionCreditOrDebit && equalTo((BankFeedTransactionCreditOrDebit) other); - } - - private boolean equalTo(BankFeedTransactionCreditOrDebit other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedTransactionCreditOrDebit of(CreditOrDebitEnum value) { - return new BankFeedTransactionCreditOrDebit(value, 0); - } - - public static BankFeedTransactionCreditOrDebit of(String value) { - return new BankFeedTransactionCreditOrDebit(value, 1); - } - - public interface Visitor { - T visit(CreditOrDebitEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedTransactionCreditOrDebit.class); - } - - @java.lang.Override - public BankFeedTransactionCreditOrDebit deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreditOrDebitEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionRequestRequestCreditOrDebit.java b/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionRequestRequestCreditOrDebit.java deleted file mode 100644 index be1795b39..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/BankFeedTransactionRequestRequestCreditOrDebit.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankFeedTransactionRequestRequestCreditOrDebit.Deserializer.class) -public final class BankFeedTransactionRequestRequestCreditOrDebit { - private final Object value; - - private final int type; - - private BankFeedTransactionRequestRequestCreditOrDebit(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CreditOrDebitEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankFeedTransactionRequestRequestCreditOrDebit - && equalTo((BankFeedTransactionRequestRequestCreditOrDebit) other); - } - - private boolean equalTo(BankFeedTransactionRequestRequestCreditOrDebit other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankFeedTransactionRequestRequestCreditOrDebit of(CreditOrDebitEnum value) { - return new BankFeedTransactionRequestRequestCreditOrDebit(value, 0); - } - - public static BankFeedTransactionRequestRequestCreditOrDebit of(String value) { - return new BankFeedTransactionRequestRequestCreditOrDebit(value, 1); - } - - public interface Visitor { - T visit(CreditOrDebitEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankFeedTransactionRequestRequestCreditOrDebit.class); - } - - @java.lang.Override - public BankFeedTransactionRequestRequestCreditOrDebit deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreditOrDebitEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CashFlowStatementCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/CashFlowStatementCurrency.java deleted file mode 100644 index 1af9b6273..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CashFlowStatementCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CashFlowStatementCurrency.Deserializer.class) -public final class CashFlowStatementCurrency { - private final Object value; - - private final int type; - - private CashFlowStatementCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CashFlowStatementCurrency && equalTo((CashFlowStatementCurrency) other); - } - - private boolean equalTo(CashFlowStatementCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CashFlowStatementCurrency of(TransactionCurrencyEnum value) { - return new CashFlowStatementCurrency(value, 0); - } - - public static CashFlowStatementCurrency of(String value) { - return new CashFlowStatementCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CashFlowStatementCurrency.class); - } - - @java.lang.Override - public CashFlowStatementCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CategoriesEnum.java b/src/main/java/com/merge/api/resources/accounting/types/CategoriesEnum.java deleted file mode 100644 index 85d7347f0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CategoriesEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoriesEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoriesEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CategoryEnum.java b/src/main/java/com/merge/api/resources/accounting/types/CategoryEnum.java deleted file mode 100644 index e63a976df..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CategoryEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoryEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/resources/accounting/types/CommonModelScopeApi.java deleted file mode 100644 index 4ccfc8849..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CommonModelScopeApi.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) -public final class CommonModelScopeApi { - private final List commonModels; - - private final Map additionalProperties; - - private CommonModelScopeApi( - List commonModels, Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopeApi other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CommonModelScopeApi other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public CommonModelScopeApi build() { - return new CommonModelScopeApi(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/resources/accounting/types/CommonModelScopesBodyRequest.java deleted file mode 100644 index 2d9bfc417..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CommonModelScopesBodyRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) -public final class CommonModelScopesBodyRequest { - private final String modelId; - - private final List enabledActions; - - private final List disabledFields; - - private final Map additionalProperties; - - private CommonModelScopesBodyRequest( - String modelId, - List enabledActions, - List disabledFields, - Map additionalProperties) { - this.modelId = modelId; - this.enabledActions = enabledActions; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("enabled_actions") - public List getEnabledActions() { - return enabledActions; - } - - @JsonProperty("disabled_fields") - public List getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopesBodyRequest other) { - return modelId.equals(other.modelId) - && enabledActions.equals(other.enabledActions) - && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelIdStage builder() { - return new Builder(); - } - - public interface ModelIdStage { - _FinalStage modelId(@NotNull String modelId); - - Builder from(CommonModelScopesBodyRequest other); - } - - public interface _FinalStage { - CommonModelScopesBodyRequest build(); - - _FinalStage enabledActions(List enabledActions); - - _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); - - _FinalStage addAllEnabledActions(List enabledActions); - - _FinalStage disabledFields(List disabledFields); - - _FinalStage addDisabledFields(String disabledFields); - - _FinalStage addAllDisabledFields(List disabledFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelIdStage, _FinalStage { - private String modelId; - - private List disabledFields = new ArrayList<>(); - - private List enabledActions = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CommonModelScopesBodyRequest other) { - modelId(other.getModelId()); - enabledActions(other.getEnabledActions()); - disabledFields(other.getDisabledFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public _FinalStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - public _FinalStage addAllDisabledFields(List disabledFields) { - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addDisabledFields(String disabledFields) { - this.disabledFields.add(disabledFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public _FinalStage disabledFields(List disabledFields) { - this.disabledFields.clear(); - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllEnabledActions(List enabledActions) { - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { - this.enabledActions.add(enabledActions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) - public _FinalStage enabledActions(List enabledActions) { - this.enabledActions.clear(); - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public CommonModelScopesBodyRequest build() { - return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CompanyInfoCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/CompanyInfoCurrency.java deleted file mode 100644 index c6b38713b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CompanyInfoCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CompanyInfoCurrency.Deserializer.class) -public final class CompanyInfoCurrency { - private final Object value; - - private final int type; - - private CompanyInfoCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CompanyInfoCurrency && equalTo((CompanyInfoCurrency) other); - } - - private boolean equalTo(CompanyInfoCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CompanyInfoCurrency of(TransactionCurrencyEnum value) { - return new CompanyInfoCurrency(value, 0); - } - - public static CompanyInfoCurrency of(String value) { - return new CompanyInfoCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CompanyInfoCurrency.class); - } - - @java.lang.Override - public CompanyInfoCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Contact.java b/src/main/java/com/merge/api/resources/accounting/types/Contact.java deleted file mode 100644 index debefd4ec..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/Contact.java +++ /dev/null @@ -1,620 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Contact.Builder.class) -public final class Contact { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional isSupplier; - - private final Optional isCustomer; - - private final Optional emailAddress; - - private final Optional taxNumber; - - private final Optional status; - - private final Optional currency; - - private final Optional remoteUpdatedAt; - - private final Optional company; - - private final Optional>> addresses; - - private final Optional> phoneNumbers; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Optional> remoteFields; - - private final Map additionalProperties; - - private Contact( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional isSupplier, - Optional isCustomer, - Optional emailAddress, - Optional taxNumber, - Optional status, - Optional currency, - Optional remoteUpdatedAt, - Optional company, - Optional>> addresses, - Optional> phoneNumbers, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Optional> remoteFields, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.isSupplier = isSupplier; - this.isCustomer = isCustomer; - this.emailAddress = emailAddress; - this.taxNumber = taxNumber; - this.status = status; - this.currency = currency; - this.remoteUpdatedAt = remoteUpdatedAt; - this.company = company; - this.addresses = addresses; - this.phoneNumbers = phoneNumbers; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.remoteFields = remoteFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The contact's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Whether the contact is a supplier. - */ - @JsonProperty("is_supplier") - public Optional getIsSupplier() { - return isSupplier; - } - - /** - * @return Whether the contact is a customer. - */ - @JsonProperty("is_customer") - public Optional getIsCustomer() { - return isCustomer; - } - - /** - * @return The contact's email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return The contact's tax number. - */ - @JsonProperty("tax_number") - public Optional getTaxNumber() { - return taxNumber; - } - - /** - * @return The contact's status - *
    - *
  • ACTIVE - ACTIVE
  • - *
  • ARCHIVED - ARCHIVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - /** - * @return The currency the contact's transactions are in. - */ - @JsonProperty("currency") - public Optional getCurrency() { - return currency; - } - - /** - * @return When the third party's contact was updated. - */ - @JsonProperty("remote_updated_at") - public Optional getRemoteUpdatedAt() { - return remoteUpdatedAt; - } - - /** - * @return The company the contact belongs to. - */ - @JsonProperty("company") - public Optional getCompany() { - return company; - } - - /** - * @return Address object IDs for the given Contacts object. - */ - @JsonProperty("addresses") - public Optional>> getAddresses() { - return addresses; - } - - /** - * @return AccountingPhoneNumber object for the given Contacts object. - */ - @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { - return phoneNumbers; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @JsonProperty("remote_fields") - public Optional> getRemoteFields() { - return remoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Contact && equalTo((Contact) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Contact other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && isSupplier.equals(other.isSupplier) - && isCustomer.equals(other.isCustomer) - && emailAddress.equals(other.emailAddress) - && taxNumber.equals(other.taxNumber) - && status.equals(other.status) - && currency.equals(other.currency) - && remoteUpdatedAt.equals(other.remoteUpdatedAt) - && company.equals(other.company) - && addresses.equals(other.addresses) - && phoneNumbers.equals(other.phoneNumbers) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData) - && remoteFields.equals(other.remoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.isSupplier, - this.isCustomer, - this.emailAddress, - this.taxNumber, - this.status, - this.currency, - this.remoteUpdatedAt, - this.company, - this.addresses, - this.phoneNumbers, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData, - this.remoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional isSupplier = Optional.empty(); - - private Optional isCustomer = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional taxNumber = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional currency = Optional.empty(); - - private Optional remoteUpdatedAt = Optional.empty(); - - private Optional company = Optional.empty(); - - private Optional>> addresses = Optional.empty(); - - private Optional> phoneNumbers = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - private Optional> remoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Contact other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - isSupplier(other.getIsSupplier()); - isCustomer(other.getIsCustomer()); - emailAddress(other.getEmailAddress()); - taxNumber(other.getTaxNumber()); - status(other.getStatus()); - currency(other.getCurrency()); - remoteUpdatedAt(other.getRemoteUpdatedAt()); - company(other.getCompany()); - addresses(other.getAddresses()); - phoneNumbers(other.getPhoneNumbers()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - remoteFields(other.getRemoteFields()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "is_supplier", nulls = Nulls.SKIP) - public Builder isSupplier(Optional isSupplier) { - this.isSupplier = isSupplier; - return this; - } - - public Builder isSupplier(Boolean isSupplier) { - this.isSupplier = Optional.ofNullable(isSupplier); - return this; - } - - @JsonSetter(value = "is_customer", nulls = Nulls.SKIP) - public Builder isCustomer(Optional isCustomer) { - this.isCustomer = isCustomer; - return this; - } - - public Builder isCustomer(Boolean isCustomer) { - this.isCustomer = Optional.ofNullable(isCustomer); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "tax_number", nulls = Nulls.SKIP) - public Builder taxNumber(Optional taxNumber) { - this.taxNumber = taxNumber; - return this; - } - - public Builder taxNumber(String taxNumber) { - this.taxNumber = Optional.ofNullable(taxNumber); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(ContactStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { - this.currency = currency; - return this; - } - - public Builder currency(String currency) { - this.currency = Optional.ofNullable(currency); - return this; - } - - @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) - public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { - this.remoteUpdatedAt = remoteUpdatedAt; - return this; - } - - public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { - this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); - return this; - } - - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { - this.company = company; - return this; - } - - public Builder company(String company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional>> addresses) { - this.addresses = addresses; - return this; - } - - public Builder addresses(List> addresses) { - this.addresses = Optional.ofNullable(addresses); - return this; - } - - @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - public Builder phoneNumbers(List phoneNumbers) { - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional> remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(List remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - public Contact build() { - return new Contact( - id, - remoteId, - createdAt, - modifiedAt, - name, - isSupplier, - isCustomer, - emailAddress, - taxNumber, - status, - currency, - remoteUpdatedAt, - company, - addresses, - phoneNumbers, - remoteWasDeleted, - fieldMappings, - remoteData, - remoteFields, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ContactRequest.java b/src/main/java/com/merge/api/resources/accounting/types/ContactRequest.java deleted file mode 100644 index 56fd570a1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ContactRequest.java +++ /dev/null @@ -1,448 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactRequest.Builder.class) -public final class ContactRequest { - private final Optional name; - - private final Optional isSupplier; - - private final Optional isCustomer; - - private final Optional emailAddress; - - private final Optional taxNumber; - - private final Optional status; - - private final Optional currency; - - private final Optional company; - - private final Optional>> addresses; - - private final Optional> phoneNumbers; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Optional> remoteFields; - - private final Map additionalProperties; - - private ContactRequest( - Optional name, - Optional isSupplier, - Optional isCustomer, - Optional emailAddress, - Optional taxNumber, - Optional status, - Optional currency, - Optional company, - Optional>> addresses, - Optional> phoneNumbers, - Optional> integrationParams, - Optional> linkedAccountParams, - Optional> remoteFields, - Map additionalProperties) { - this.name = name; - this.isSupplier = isSupplier; - this.isCustomer = isCustomer; - this.emailAddress = emailAddress; - this.taxNumber = taxNumber; - this.status = status; - this.currency = currency; - this.company = company; - this.addresses = addresses; - this.phoneNumbers = phoneNumbers; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.remoteFields = remoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return The contact's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Whether the contact is a supplier. - */ - @JsonProperty("is_supplier") - public Optional getIsSupplier() { - return isSupplier; - } - - /** - * @return Whether the contact is a customer. - */ - @JsonProperty("is_customer") - public Optional getIsCustomer() { - return isCustomer; - } - - /** - * @return The contact's email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return The contact's tax number. - */ - @JsonProperty("tax_number") - public Optional getTaxNumber() { - return taxNumber; - } - - /** - * @return The contact's status - *
    - *
  • ACTIVE - ACTIVE
  • - *
  • ARCHIVED - ARCHIVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - /** - * @return The currency the contact's transactions are in. - */ - @JsonProperty("currency") - public Optional getCurrency() { - return currency; - } - - /** - * @return The company the contact belongs to. - */ - @JsonProperty("company") - public Optional getCompany() { - return company; - } - - /** - * @return Address object IDs for the given Contacts object. - */ - @JsonProperty("addresses") - public Optional>> getAddresses() { - return addresses; - } - - /** - * @return AccountingPhoneNumber object for the given Contacts object. - */ - @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { - return phoneNumbers; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @JsonProperty("remote_fields") - public Optional> getRemoteFields() { - return remoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactRequest && equalTo((ContactRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactRequest other) { - return name.equals(other.name) - && isSupplier.equals(other.isSupplier) - && isCustomer.equals(other.isCustomer) - && emailAddress.equals(other.emailAddress) - && taxNumber.equals(other.taxNumber) - && status.equals(other.status) - && currency.equals(other.currency) - && company.equals(other.company) - && addresses.equals(other.addresses) - && phoneNumbers.equals(other.phoneNumbers) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams) - && remoteFields.equals(other.remoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.isSupplier, - this.isCustomer, - this.emailAddress, - this.taxNumber, - this.status, - this.currency, - this.company, - this.addresses, - this.phoneNumbers, - this.integrationParams, - this.linkedAccountParams, - this.remoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional isSupplier = Optional.empty(); - - private Optional isCustomer = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional taxNumber = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional currency = Optional.empty(); - - private Optional company = Optional.empty(); - - private Optional>> addresses = Optional.empty(); - - private Optional> phoneNumbers = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - private Optional> remoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactRequest other) { - name(other.getName()); - isSupplier(other.getIsSupplier()); - isCustomer(other.getIsCustomer()); - emailAddress(other.getEmailAddress()); - taxNumber(other.getTaxNumber()); - status(other.getStatus()); - currency(other.getCurrency()); - company(other.getCompany()); - addresses(other.getAddresses()); - phoneNumbers(other.getPhoneNumbers()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - remoteFields(other.getRemoteFields()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "is_supplier", nulls = Nulls.SKIP) - public Builder isSupplier(Optional isSupplier) { - this.isSupplier = isSupplier; - return this; - } - - public Builder isSupplier(Boolean isSupplier) { - this.isSupplier = Optional.ofNullable(isSupplier); - return this; - } - - @JsonSetter(value = "is_customer", nulls = Nulls.SKIP) - public Builder isCustomer(Optional isCustomer) { - this.isCustomer = isCustomer; - return this; - } - - public Builder isCustomer(Boolean isCustomer) { - this.isCustomer = Optional.ofNullable(isCustomer); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "tax_number", nulls = Nulls.SKIP) - public Builder taxNumber(Optional taxNumber) { - this.taxNumber = taxNumber; - return this; - } - - public Builder taxNumber(String taxNumber) { - this.taxNumber = Optional.ofNullable(taxNumber); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(ContactRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { - this.currency = currency; - return this; - } - - public Builder currency(String currency) { - this.currency = Optional.ofNullable(currency); - return this; - } - - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { - this.company = company; - return this; - } - - public Builder company(String company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional>> addresses) { - this.addresses = addresses; - return this; - } - - public Builder addresses(List> addresses) { - this.addresses = Optional.ofNullable(addresses); - return this; - } - - @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - public Builder phoneNumbers(List phoneNumbers) { - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional> remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(List remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - public ContactRequest build() { - return new ContactRequest( - name, - isSupplier, - isCustomer, - emailAddress, - taxNumber, - status, - currency, - company, - addresses, - phoneNumbers, - integrationParams, - linkedAccountParams, - remoteFields, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ContactRequestStatus.java b/src/main/java/com/merge/api/resources/accounting/types/ContactRequestStatus.java deleted file mode 100644 index e37a6a9cd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ContactRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ContactRequestStatus.Deserializer.class) -public final class ContactRequestStatus { - private final Object value; - - private final int type; - - private ContactRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((Status7D1Enum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactRequestStatus && equalTo((ContactRequestStatus) other); - } - - private boolean equalTo(ContactRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ContactRequestStatus of(Status7D1Enum value) { - return new ContactRequestStatus(value, 0); - } - - public static ContactRequestStatus of(String value) { - return new ContactRequestStatus(value, 1); - } - - public interface Visitor { - T visit(Status7D1Enum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ContactRequestStatus.class); - } - - @java.lang.Override - public ContactRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status7D1Enum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ContactStatus.java b/src/main/java/com/merge/api/resources/accounting/types/ContactStatus.java deleted file mode 100644 index 705de5726..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ContactStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ContactStatus.Deserializer.class) -public final class ContactStatus { - private final Object value; - - private final int type; - - private ContactStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((Status7D1Enum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactStatus && equalTo((ContactStatus) other); - } - - private boolean equalTo(ContactStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ContactStatus of(Status7D1Enum value) { - return new ContactStatus(value, 0); - } - - public static ContactStatus of(String value) { - return new ContactStatus(value, 1); - } - - public interface Visitor { - T visit(Status7D1Enum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ContactStatus.class); - } - - @java.lang.Override - public ContactStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status7D1Enum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CountryEnum.java b/src/main/java/com/merge/api/resources/accounting/types/CountryEnum.java deleted file mode 100644 index 5c79ec8ab..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CountryEnum.java +++ /dev/null @@ -1,518 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CountryEnum { - AF("AF"), - - AX("AX"), - - AL("AL"), - - DZ("DZ"), - - AS("AS"), - - AD("AD"), - - AO("AO"), - - AI("AI"), - - AQ("AQ"), - - AG("AG"), - - AR("AR"), - - AM("AM"), - - AW("AW"), - - AU("AU"), - - AT("AT"), - - AZ("AZ"), - - BS("BS"), - - BH("BH"), - - BD("BD"), - - BB("BB"), - - BY("BY"), - - BE("BE"), - - BZ("BZ"), - - BJ("BJ"), - - BM("BM"), - - BT("BT"), - - BO("BO"), - - BQ("BQ"), - - BA("BA"), - - BW("BW"), - - BV("BV"), - - BR("BR"), - - IO("IO"), - - BN("BN"), - - BG("BG"), - - BF("BF"), - - BI("BI"), - - CV("CV"), - - KH("KH"), - - CM("CM"), - - CA("CA"), - - KY("KY"), - - CF("CF"), - - TD("TD"), - - CL("CL"), - - CN("CN"), - - CX("CX"), - - CC("CC"), - - CO("CO"), - - KM("KM"), - - CG("CG"), - - CD("CD"), - - CK("CK"), - - CR("CR"), - - CI("CI"), - - HR("HR"), - - CU("CU"), - - CW("CW"), - - CY("CY"), - - CZ("CZ"), - - DK("DK"), - - DJ("DJ"), - - DM("DM"), - - DO("DO"), - - EC("EC"), - - EG("EG"), - - SV("SV"), - - GQ("GQ"), - - ER("ER"), - - EE("EE"), - - SZ("SZ"), - - ET("ET"), - - FK("FK"), - - FO("FO"), - - FJ("FJ"), - - FI("FI"), - - FR("FR"), - - GF("GF"), - - PF("PF"), - - TF("TF"), - - GA("GA"), - - GM("GM"), - - GE("GE"), - - DE("DE"), - - GH("GH"), - - GI("GI"), - - GR("GR"), - - GL("GL"), - - GD("GD"), - - GP("GP"), - - GU("GU"), - - GT("GT"), - - GG("GG"), - - GN("GN"), - - GW("GW"), - - GY("GY"), - - HT("HT"), - - HM("HM"), - - VA("VA"), - - HN("HN"), - - HK("HK"), - - HU("HU"), - - IS("IS"), - - IN("IN"), - - ID("ID"), - - IR("IR"), - - IQ("IQ"), - - IE("IE"), - - IM("IM"), - - IL("IL"), - - IT("IT"), - - JM("JM"), - - JP("JP"), - - JE("JE"), - - JO("JO"), - - KZ("KZ"), - - KE("KE"), - - KI("KI"), - - KW("KW"), - - KG("KG"), - - LA("LA"), - - LV("LV"), - - LB("LB"), - - LS("LS"), - - LR("LR"), - - LY("LY"), - - LI("LI"), - - LT("LT"), - - LU("LU"), - - MO("MO"), - - MG("MG"), - - MW("MW"), - - MY("MY"), - - MV("MV"), - - ML("ML"), - - MT("MT"), - - MH("MH"), - - MQ("MQ"), - - MR("MR"), - - MU("MU"), - - YT("YT"), - - MX("MX"), - - FM("FM"), - - MD("MD"), - - MC("MC"), - - MN("MN"), - - ME("ME"), - - MS("MS"), - - MA("MA"), - - MZ("MZ"), - - MM("MM"), - - NA("NA"), - - NR("NR"), - - NP("NP"), - - NL("NL"), - - NC("NC"), - - NZ("NZ"), - - NI("NI"), - - NE("NE"), - - NG("NG"), - - NU("NU"), - - NF("NF"), - - KP("KP"), - - MK("MK"), - - MP("MP"), - - NO("NO"), - - OM("OM"), - - PK("PK"), - - PW("PW"), - - PS("PS"), - - PA("PA"), - - PG("PG"), - - PY("PY"), - - PE("PE"), - - PH("PH"), - - PN("PN"), - - PL("PL"), - - PT("PT"), - - PR("PR"), - - QA("QA"), - - RE("RE"), - - RO("RO"), - - RU("RU"), - - RW("RW"), - - BL("BL"), - - SH("SH"), - - KN("KN"), - - LC("LC"), - - MF("MF"), - - PM("PM"), - - VC("VC"), - - WS("WS"), - - SM("SM"), - - ST("ST"), - - SA("SA"), - - SN("SN"), - - RS("RS"), - - SC("SC"), - - SL("SL"), - - SG("SG"), - - SX("SX"), - - SK("SK"), - - SI("SI"), - - SB("SB"), - - SO("SO"), - - ZA("ZA"), - - GS("GS"), - - KR("KR"), - - SS("SS"), - - ES("ES"), - - LK("LK"), - - SD("SD"), - - SR("SR"), - - SJ("SJ"), - - SE("SE"), - - CH("CH"), - - SY("SY"), - - TW("TW"), - - TJ("TJ"), - - TZ("TZ"), - - TH("TH"), - - TL("TL"), - - TG("TG"), - - TK("TK"), - - TO("TO"), - - TT("TT"), - - TN("TN"), - - TR("TR"), - - TM("TM"), - - TC("TC"), - - TV("TV"), - - UG("UG"), - - UA("UA"), - - AE("AE"), - - GB("GB"), - - UM("UM"), - - US("US"), - - UY("UY"), - - UZ("UZ"), - - VU("VU"), - - VE("VE"), - - VN("VN"), - - VG("VG"), - - VI("VI"), - - WF("WF"), - - EH("EH"), - - YE("YE"), - - ZM("ZM"), - - ZW("ZW"); - - private final String value; - - CountryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/CreditNoteCurrency.java deleted file mode 100644 index 0bceaea2f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CreditNoteCurrency.Deserializer.class) -public final class CreditNoteCurrency { - private final Object value; - - private final int type; - - private CreditNoteCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreditNoteCurrency && equalTo((CreditNoteCurrency) other); - } - - private boolean equalTo(CreditNoteCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CreditNoteCurrency of(TransactionCurrencyEnum value) { - return new CreditNoteCurrency(value, 0); - } - - public static CreditNoteCurrency of(String value) { - return new CreditNoteCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CreditNoteCurrency.class); - } - - @java.lang.Override - public CreditNoteCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestCurrency.java deleted file mode 100644 index f6e0d1b6e..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CreditNoteRequestCurrency.Deserializer.class) -public final class CreditNoteRequestCurrency { - private final Object value; - - private final int type; - - private CreditNoteRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreditNoteRequestCurrency && equalTo((CreditNoteRequestCurrency) other); - } - - private boolean equalTo(CreditNoteRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CreditNoteRequestCurrency of(TransactionCurrencyEnum value) { - return new CreditNoteRequestCurrency(value, 0); - } - - public static CreditNoteRequestCurrency of(String value) { - return new CreditNoteRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CreditNoteRequestCurrency.class); - } - - @java.lang.Override - public CreditNoteRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestStatus.java b/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestStatus.java deleted file mode 100644 index 33cd85020..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CreditNoteRequestStatus.Deserializer.class) -public final class CreditNoteRequestStatus { - private final Object value; - - private final int type; - - private CreditNoteRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CreditNoteStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreditNoteRequestStatus && equalTo((CreditNoteRequestStatus) other); - } - - private boolean equalTo(CreditNoteRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CreditNoteRequestStatus of(CreditNoteStatusEnum value) { - return new CreditNoteRequestStatus(value, 0); - } - - public static CreditNoteRequestStatus of(String value) { - return new CreditNoteRequestStatus(value, 1); - } - - public interface Visitor { - T visit(CreditNoteStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CreditNoteRequestStatus.class); - } - - @java.lang.Override - public CreditNoteRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreditNoteStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteStatus.java b/src/main/java/com/merge/api/resources/accounting/types/CreditNoteStatus.java deleted file mode 100644 index 6e5d00072..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/CreditNoteStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CreditNoteStatus.Deserializer.class) -public final class CreditNoteStatus { - private final Object value; - - private final int type; - - private CreditNoteStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CreditNoteStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreditNoteStatus && equalTo((CreditNoteStatus) other); - } - - private boolean equalTo(CreditNoteStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CreditNoteStatus of(CreditNoteStatusEnum value) { - return new CreditNoteStatus(value, 0); - } - - public static CreditNoteStatus of(String value) { - return new CreditNoteStatus(value, 1); - } - - public interface Visitor { - T visit(CreditNoteStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CreditNoteStatus.class); - } - - @java.lang.Override - public CreditNoteStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreditNoteStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/resources/accounting/types/DataPassthroughRequest.java deleted file mode 100644 index 42147674c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/DataPassthroughRequest.java +++ /dev/null @@ -1,371 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) -public final class DataPassthroughRequest { - private final MethodEnum method; - - private final String path; - - private final Optional baseUrlOverride; - - private final Optional data; - - private final Optional> multipartFormData; - - private final Optional> headers; - - private final Optional requestFormat; - - private final Optional normalizeResponse; - - private final Map additionalProperties; - - private DataPassthroughRequest( - MethodEnum method, - String path, - Optional baseUrlOverride, - Optional data, - Optional> multipartFormData, - Optional> headers, - Optional requestFormat, - Optional normalizeResponse, - Map additionalProperties) { - this.method = method; - this.path = path; - this.baseUrlOverride = baseUrlOverride; - this.data = data; - this.multipartFormData = multipartFormData; - this.headers = headers; - this.requestFormat = requestFormat; - this.normalizeResponse = normalizeResponse; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public MethodEnum getMethod() { - return method; - } - - /** - * @return The path of the request in the third party's platform. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - /** - * @return An optional override of the third party's base url for the request. - */ - @JsonProperty("base_url_override") - public Optional getBaseUrlOverride() { - return baseUrlOverride; - } - - /** - * @return The data with the request. You must include a request_format parameter matching the data's format - */ - @JsonProperty("data") - public Optional getData() { - return data; - } - - /** - * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. - */ - @JsonProperty("multipart_form_data") - public Optional> getMultipartFormData() { - return multipartFormData; - } - - /** - * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("request_format") - public Optional getRequestFormat() { - return requestFormat; - } - - /** - * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. - */ - @JsonProperty("normalize_response") - public Optional getNormalizeResponse() { - return normalizeResponse; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DataPassthroughRequest other) { - return method.equals(other.method) - && path.equals(other.path) - && baseUrlOverride.equals(other.baseUrlOverride) - && data.equals(other.data) - && multipartFormData.equals(other.multipartFormData) - && headers.equals(other.headers) - && requestFormat.equals(other.requestFormat) - && normalizeResponse.equals(other.normalizeResponse); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.baseUrlOverride, - this.data, - this.multipartFormData, - this.headers, - this.requestFormat, - this.normalizeResponse); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull MethodEnum method); - - Builder from(DataPassthroughRequest other); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - } - - public interface _FinalStage { - DataPassthroughRequest build(); - - _FinalStage baseUrlOverride(Optional baseUrlOverride); - - _FinalStage baseUrlOverride(String baseUrlOverride); - - _FinalStage data(Optional data); - - _FinalStage data(String data); - - _FinalStage multipartFormData(Optional> multipartFormData); - - _FinalStage multipartFormData(List multipartFormData); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - - _FinalStage requestFormat(Optional requestFormat); - - _FinalStage requestFormat(RequestFormatEnum requestFormat); - - _FinalStage normalizeResponse(Optional normalizeResponse); - - _FinalStage normalizeResponse(Boolean normalizeResponse); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, _FinalStage { - private MethodEnum method; - - private String path; - - private Optional normalizeResponse = Optional.empty(); - - private Optional requestFormat = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional> multipartFormData = Optional.empty(); - - private Optional data = Optional.empty(); - - private Optional baseUrlOverride = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DataPassthroughRequest other) { - method(other.getMethod()); - path(other.getPath()); - baseUrlOverride(other.getBaseUrlOverride()); - data(other.getData()); - multipartFormData(other.getMultipartFormData()); - headers(other.getHeaders()); - requestFormat(other.getRequestFormat()); - normalizeResponse(other.getNormalizeResponse()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull MethodEnum method) { - this.method = method; - return this; - } - - /** - *

The path of the request in the third party's platform.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - /** - *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage normalizeResponse(Boolean normalizeResponse) { - this.normalizeResponse = Optional.ofNullable(normalizeResponse); - return this; - } - - @java.lang.Override - @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) - public _FinalStage normalizeResponse(Optional normalizeResponse) { - this.normalizeResponse = normalizeResponse; - return this; - } - - @java.lang.Override - public _FinalStage requestFormat(RequestFormatEnum requestFormat) { - this.requestFormat = Optional.ofNullable(requestFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_format", nulls = Nulls.SKIP) - public _FinalStage requestFormat(Optional requestFormat) { - this.requestFormat = requestFormat; - return this; - } - - /** - *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - /** - *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage multipartFormData(List multipartFormData) { - this.multipartFormData = Optional.ofNullable(multipartFormData); - return this; - } - - @java.lang.Override - @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) - public _FinalStage multipartFormData(Optional> multipartFormData) { - this.multipartFormData = multipartFormData; - return this; - } - - /** - *

The data with the request. You must include a request_format parameter matching the data's format

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage data(String data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - /** - *

An optional override of the third party's base url for the request.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage baseUrlOverride(String baseUrlOverride) { - this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); - return this; - } - - @java.lang.Override - @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) - public _FinalStage baseUrlOverride(Optional baseUrlOverride) { - this.baseUrlOverride = baseUrlOverride; - return this; - } - - @java.lang.Override - public DataPassthroughRequest build() { - return new DataPassthroughRequest( - method, - path, - baseUrlOverride, - data, - multipartFormData, - headers, - requestFormat, - normalizeResponse, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/DebugModeLog.java b/src/main/java/com/merge/api/resources/accounting/types/DebugModeLog.java deleted file mode 100644 index f9592ece0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/DebugModeLog.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModeLog.Builder.class) -public final class DebugModeLog { - private final String logId; - - private final String dashboardView; - - private final DebugModelLogSummary logSummary; - - private final Map additionalProperties; - - private DebugModeLog( - String logId, - String dashboardView, - DebugModelLogSummary logSummary, - Map additionalProperties) { - this.logId = logId; - this.dashboardView = dashboardView; - this.logSummary = logSummary; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("log_id") - public String getLogId() { - return logId; - } - - @JsonProperty("dashboard_view") - public String getDashboardView() { - return dashboardView; - } - - @JsonProperty("log_summary") - public DebugModelLogSummary getLogSummary() { - return logSummary; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModeLog && equalTo((DebugModeLog) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModeLog other) { - return logId.equals(other.logId) - && dashboardView.equals(other.dashboardView) - && logSummary.equals(other.logSummary); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.logId, this.dashboardView, this.logSummary); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LogIdStage builder() { - return new Builder(); - } - - public interface LogIdStage { - DashboardViewStage logId(@NotNull String logId); - - Builder from(DebugModeLog other); - } - - public interface DashboardViewStage { - LogSummaryStage dashboardView(@NotNull String dashboardView); - } - - public interface LogSummaryStage { - _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); - } - - public interface _FinalStage { - DebugModeLog build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { - private String logId; - - private String dashboardView; - - private DebugModelLogSummary logSummary; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModeLog other) { - logId(other.getLogId()); - dashboardView(other.getDashboardView()); - logSummary(other.getLogSummary()); - return this; - } - - @java.lang.Override - @JsonSetter("log_id") - public DashboardViewStage logId(@NotNull String logId) { - this.logId = logId; - return this; - } - - @java.lang.Override - @JsonSetter("dashboard_view") - public LogSummaryStage dashboardView(@NotNull String dashboardView) { - this.dashboardView = dashboardView; - return this; - } - - @java.lang.Override - @JsonSetter("log_summary") - public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { - this.logSummary = logSummary; - return this; - } - - @java.lang.Override - public DebugModeLog build() { - return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/resources/accounting/types/DebugModelLogSummary.java deleted file mode 100644 index f3114d448..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/DebugModelLogSummary.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) -public final class DebugModelLogSummary { - private final String url; - - private final String method; - - private final int statusCode; - - private final Map additionalProperties; - - private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { - this.url = url; - this.method = method; - this.statusCode = statusCode; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("url") - public String getUrl() { - return url; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("status_code") - public int getStatusCode() { - return statusCode; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModelLogSummary other) { - return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.url, this.method, this.statusCode); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static UrlStage builder() { - return new Builder(); - } - - public interface UrlStage { - MethodStage url(@NotNull String url); - - Builder from(DebugModelLogSummary other); - } - - public interface MethodStage { - StatusCodeStage method(@NotNull String method); - } - - public interface StatusCodeStage { - _FinalStage statusCode(int statusCode); - } - - public interface _FinalStage { - DebugModelLogSummary build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { - private String url; - - private String method; - - private int statusCode; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModelLogSummary other) { - url(other.getUrl()); - method(other.getMethod()); - statusCode(other.getStatusCode()); - return this; - } - - @java.lang.Override - @JsonSetter("url") - public MethodStage url(@NotNull String url) { - this.url = url; - return this; - } - - @java.lang.Override - @JsonSetter("method") - public StatusCodeStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("status_code") - public _FinalStage statusCode(int statusCode) { - this.statusCode = statusCode; - return this; - } - - @java.lang.Override - public DebugModelLogSummary build() { - return new DebugModelLogSummary(url, method, statusCode, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Employee.java b/src/main/java/com/merge/api/resources/accounting/types/Employee.java deleted file mode 100644 index 07278a659..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/Employee.java +++ /dev/null @@ -1,613 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Employee.Builder.class) -public final class Employee { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional firstName; - - private final Optional lastName; - - private final Optional isContractor; - - private final Optional employeeNumber; - - private final Optional emailAddress; - - private final Optional company; - - private final EmployeeStatus status; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Employee( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional firstName, - Optional lastName, - Optional isContractor, - Optional employeeNumber, - Optional emailAddress, - Optional company, - EmployeeStatus status, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.firstName = firstName; - this.lastName = lastName; - this.isContractor = isContractor; - this.employeeNumber = employeeNumber; - this.emailAddress = emailAddress; - this.company = company; - this.status = status; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The employee's first name. - */ - @JsonProperty("first_name") - public Optional getFirstName() { - return firstName; - } - - /** - * @return The employee's last name. - */ - @JsonProperty("last_name") - public Optional getLastName() { - return lastName; - } - - /** - * @return True if the employee is a contractor, False if not. - */ - @JsonProperty("is_contractor") - public Optional getIsContractor() { - return isContractor; - } - - /** - * @return The employee's internal identification number. - */ - @JsonProperty("employee_number") - public Optional getEmployeeNumber() { - return employeeNumber; - } - - /** - * @return The employee's email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return The subsidiary that the employee belongs to. - */ - @JsonProperty("company") - public Optional getCompany() { - return company; - } - - /** - * @return The employee's status in the accounting system. - *
    - *
  • ACTIVE - ACTIVE
  • - *
  • INACTIVE - INACTIVE
  • - *
- */ - @JsonProperty("status") - public EmployeeStatus getStatus() { - return status; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Employee && equalTo((Employee) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Employee other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && firstName.equals(other.firstName) - && lastName.equals(other.lastName) - && isContractor.equals(other.isContractor) - && employeeNumber.equals(other.employeeNumber) - && emailAddress.equals(other.emailAddress) - && company.equals(other.company) - && status.equals(other.status) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.firstName, - this.lastName, - this.isContractor, - this.employeeNumber, - this.emailAddress, - this.company, - this.status, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static StatusStage builder() { - return new Builder(); - } - - public interface StatusStage { - _FinalStage status(@NotNull EmployeeStatus status); - - Builder from(Employee other); - } - - public interface _FinalStage { - Employee build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage remoteId(Optional remoteId); - - _FinalStage remoteId(String remoteId); - - _FinalStage createdAt(Optional createdAt); - - _FinalStage createdAt(OffsetDateTime createdAt); - - _FinalStage modifiedAt(Optional modifiedAt); - - _FinalStage modifiedAt(OffsetDateTime modifiedAt); - - _FinalStage firstName(Optional firstName); - - _FinalStage firstName(String firstName); - - _FinalStage lastName(Optional lastName); - - _FinalStage lastName(String lastName); - - _FinalStage isContractor(Optional isContractor); - - _FinalStage isContractor(Boolean isContractor); - - _FinalStage employeeNumber(Optional employeeNumber); - - _FinalStage employeeNumber(String employeeNumber); - - _FinalStage emailAddress(Optional emailAddress); - - _FinalStage emailAddress(String emailAddress); - - _FinalStage company(Optional company); - - _FinalStage company(EmployeeCompany company); - - _FinalStage remoteWasDeleted(Optional remoteWasDeleted); - - _FinalStage remoteWasDeleted(Boolean remoteWasDeleted); - - _FinalStage fieldMappings(Optional> fieldMappings); - - _FinalStage fieldMappings(Map fieldMappings); - - _FinalStage remoteData(Optional> remoteData); - - _FinalStage remoteData(List remoteData); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements StatusStage, _FinalStage { - private EmployeeStatus status; - - private Optional> remoteData = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional company = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional employeeNumber = Optional.empty(); - - private Optional isContractor = Optional.empty(); - - private Optional lastName = Optional.empty(); - - private Optional firstName = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Employee other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - firstName(other.getFirstName()); - lastName(other.getLastName()); - isContractor(other.getIsContractor()); - employeeNumber(other.getEmployeeNumber()); - emailAddress(other.getEmailAddress()); - company(other.getCompany()); - status(other.getStatus()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - /** - *

The employee's status in the accounting system.

- *
    - *
  • ACTIVE - ACTIVE
  • - *
  • INACTIVE - INACTIVE
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("status") - public _FinalStage status(@NotNull EmployeeStatus status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public _FinalStage remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - @java.lang.Override - public _FinalStage fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public _FinalStage fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - /** - *

Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public _FinalStage remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - /** - *

The subsidiary that the employee belongs to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage company(EmployeeCompany company) { - this.company = Optional.ofNullable(company); - return this; - } - - @java.lang.Override - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public _FinalStage company(Optional company) { - this.company = company; - return this; - } - - /** - *

The employee's email address.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @java.lang.Override - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public _FinalStage emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - *

The employee's internal identification number.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage employeeNumber(String employeeNumber) { - this.employeeNumber = Optional.ofNullable(employeeNumber); - return this; - } - - @java.lang.Override - @JsonSetter(value = "employee_number", nulls = Nulls.SKIP) - public _FinalStage employeeNumber(Optional employeeNumber) { - this.employeeNumber = employeeNumber; - return this; - } - - /** - *

True if the employee is a contractor, False if not.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage isContractor(Boolean isContractor) { - this.isContractor = Optional.ofNullable(isContractor); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_contractor", nulls = Nulls.SKIP) - public _FinalStage isContractor(Optional isContractor) { - this.isContractor = isContractor; - return this; - } - - /** - *

The employee's last name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage lastName(String lastName) { - this.lastName = Optional.ofNullable(lastName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_name", nulls = Nulls.SKIP) - public _FinalStage lastName(Optional lastName) { - this.lastName = lastName; - return this; - } - - /** - *

The employee's first name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage firstName(String firstName) { - this.firstName = Optional.ofNullable(firstName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "first_name", nulls = Nulls.SKIP) - public _FinalStage firstName(Optional firstName) { - this.firstName = firstName; - return this; - } - - /** - *

The datetime that this object was modified by Merge.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public _FinalStage modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - /** - *

The datetime that this object was created by Merge.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public _FinalStage createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The third-party API ID of the matching object.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public _FinalStage remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public Employee build() { - return new Employee( - id, - remoteId, - createdAt, - modifiedAt, - firstName, - lastName, - isContractor, - employeeNumber, - emailAddress, - company, - status, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/EmployeeCompany.java b/src/main/java/com/merge/api/resources/accounting/types/EmployeeCompany.java deleted file mode 100644 index 4682e5aa7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/EmployeeCompany.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeCompany.Deserializer.class) -public final class EmployeeCompany { - private final Object value; - - private final int type; - - private EmployeeCompany(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((JsonNode) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeCompany && equalTo((EmployeeCompany) other); - } - - private boolean equalTo(EmployeeCompany other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeCompany of(String value) { - return new EmployeeCompany(value, 0); - } - - public static EmployeeCompany of(JsonNode value) { - return new EmployeeCompany(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(JsonNode value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeCompany.class); - } - - @java.lang.Override - public EmployeeCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, JsonNode.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/EmployeeStatus.java b/src/main/java/com/merge/api/resources/accounting/types/EmployeeStatus.java deleted file mode 100644 index acc7f7206..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/EmployeeStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeStatus.Deserializer.class) -public final class EmployeeStatus { - private final Object value; - - private final int type; - - private EmployeeStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((Status895Enum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeStatus && equalTo((EmployeeStatus) other); - } - - private boolean equalTo(EmployeeStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeStatus of(Status895Enum value) { - return new EmployeeStatus(value, 0); - } - - public static EmployeeStatus of(String value) { - return new EmployeeStatus(value, 1); - } - - public interface Visitor { - T visit(Status895Enum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeStatus.class); - } - - @java.lang.Override - public EmployeeStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status895Enum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/resources/accounting/types/EnabledActionsEnum.java deleted file mode 100644 index 9e365b9ea..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/EnabledActionsEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EnabledActionsEnum { - READ("READ"), - - WRITE("WRITE"); - - private final String value; - - EnabledActionsEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/EncodingEnum.java b/src/main/java/com/merge/api/resources/accounting/types/EncodingEnum.java deleted file mode 100644 index aa2b77718..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/EncodingEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EncodingEnum { - RAW("RAW"), - - BASE_64("BASE64"), - - GZIP_BASE_64("GZIP_BASE64"); - - private final String value; - - EncodingEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/resources/accounting/types/ErrorValidationProblem.java deleted file mode 100644 index e4664e1ed..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ErrorValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) -public final class ErrorValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private ErrorValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ErrorValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(ErrorValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - ErrorValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ErrorValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public ErrorValidationProblem build() { - return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/EventTypeEnum.java b/src/main/java/com/merge/api/resources/accounting/types/EventTypeEnum.java deleted file mode 100644 index 974340713..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/EventTypeEnum.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EventTypeEnum { - CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), - - DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), - - CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), - - DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), - - REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), - - INVITED_USER("INVITED_USER"), - - TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), - - TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), - - DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), - - CREATED_DESTINATION("CREATED_DESTINATION"), - - DELETED_DESTINATION("DELETED_DESTINATION"), - - CHANGED_DESTINATION("CHANGED_DESTINATION"), - - CHANGED_SCOPES("CHANGED_SCOPES"), - - CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), - - CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), - - ENABLED_INTEGRATION("ENABLED_INTEGRATION"), - - DISABLED_INTEGRATION("DISABLED_INTEGRATION"), - - ENABLED_CATEGORY("ENABLED_CATEGORY"), - - DISABLED_CATEGORY("DISABLED_CATEGORY"), - - CHANGED_PASSWORD("CHANGED_PASSWORD"), - - RESET_PASSWORD("RESET_PASSWORD"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), - - MUTED_ISSUE("MUTED_ISSUE"), - - GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), - - ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), - - DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), - - MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), - - END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); - - private final String value; - - EventTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/ExpenseCurrency.java deleted file mode 100644 index cb524cfb5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ExpenseCurrency.Deserializer.class) -public final class ExpenseCurrency { - private final Object value; - - private final int type; - - private ExpenseCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExpenseCurrency && equalTo((ExpenseCurrency) other); - } - - private boolean equalTo(ExpenseCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ExpenseCurrency of(TransactionCurrencyEnum value) { - return new ExpenseCurrency(value, 0); - } - - public static ExpenseCurrency of(String value) { - return new ExpenseCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ExpenseCurrency.class); - } - - @java.lang.Override - public ExpenseCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineCurrency.java deleted file mode 100644 index 9af6a80f4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ExpenseLineCurrency.Deserializer.class) -public final class ExpenseLineCurrency { - private final Object value; - - private final int type; - - private ExpenseLineCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExpenseLineCurrency && equalTo((ExpenseLineCurrency) other); - } - - private boolean equalTo(ExpenseLineCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ExpenseLineCurrency of(TransactionCurrencyEnum value) { - return new ExpenseLineCurrency(value, 0); - } - - public static ExpenseLineCurrency of(String value) { - return new ExpenseLineCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ExpenseLineCurrency.class); - } - - @java.lang.Override - public ExpenseLineCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestCurrency.java deleted file mode 100644 index 0e224ec01..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseLineRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ExpenseLineRequestCurrency.Deserializer.class) -public final class ExpenseLineRequestCurrency { - private final Object value; - - private final int type; - - private ExpenseLineRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExpenseLineRequestCurrency && equalTo((ExpenseLineRequestCurrency) other); - } - - private boolean equalTo(ExpenseLineRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ExpenseLineRequestCurrency of(TransactionCurrencyEnum value) { - return new ExpenseLineRequestCurrency(value, 0); - } - - public static ExpenseLineRequestCurrency of(String value) { - return new ExpenseLineRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ExpenseLineRequestCurrency.class); - } - - @java.lang.Override - public ExpenseLineRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestCurrency.java deleted file mode 100644 index 9c6b78e18..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ExpenseRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ExpenseRequestCurrency.Deserializer.class) -public final class ExpenseRequestCurrency { - private final Object value; - - private final int type; - - private ExpenseRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExpenseRequestCurrency && equalTo((ExpenseRequestCurrency) other); - } - - private boolean equalTo(ExpenseRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ExpenseRequestCurrency of(TransactionCurrencyEnum value) { - return new ExpenseRequestCurrency(value, 0); - } - - public static ExpenseRequestCurrency of(String value) { - return new ExpenseRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ExpenseRequestCurrency.class); - } - - @java.lang.Override - public ExpenseRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/resources/accounting/types/ExternalTargetFieldApi.java deleted file mode 100644 index b6423eab8..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ExternalTargetFieldApi.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) -public final class ExternalTargetFieldApi { - private final Optional name; - - private final Optional description; - - private final Optional isMapped; - - private final Map additionalProperties; - - private ExternalTargetFieldApi( - Optional name, - Optional description, - Optional isMapped, - Map additionalProperties) { - this.name = name; - this.description = description; - this.isMapped = isMapped; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_mapped") - public Optional getIsMapped() { - return isMapped; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApi other) { - return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isMapped); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isMapped = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApi other) { - name(other.getName()); - description(other.getDescription()); - isMapped(other.getIsMapped()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) - public Builder isMapped(Optional isMapped) { - this.isMapped = isMapped; - return this; - } - - public Builder isMapped(String isMapped) { - this.isMapped = Optional.ofNullable(isMapped); - return this; - } - - public ExternalTargetFieldApi build() { - return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/resources/accounting/types/ExternalTargetFieldApiResponse.java deleted file mode 100644 index 462bd5f4c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ExternalTargetFieldApiResponse.java +++ /dev/null @@ -1,647 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) -public final class ExternalTargetFieldApiResponse { - private final Optional> account; - - private final Optional> accountingAttachment; - - private final Optional> balanceSheet; - - private final Optional> cashFlowStatement; - - private final Optional> companyInfo; - - private final Optional> contact; - - private final Optional> incomeStatement; - - private final Optional> creditNote; - - private final Optional> item; - - private final Optional> purchaseOrder; - - private final Optional> trackingCategory; - - private final Optional> journalEntry; - - private final Optional> taxRate; - - private final Optional> invoice; - - private final Optional> payment; - - private final Optional> expense; - - private final Optional> vendorCredit; - - private final Optional> transaction; - - private final Optional> accountingPeriod; - - private final Optional> generalLedgerTransaction; - - private final Optional> bankFeedAccount; - - private final Optional> employee; - - private final Map additionalProperties; - - private ExternalTargetFieldApiResponse( - Optional> account, - Optional> accountingAttachment, - Optional> balanceSheet, - Optional> cashFlowStatement, - Optional> companyInfo, - Optional> contact, - Optional> incomeStatement, - Optional> creditNote, - Optional> item, - Optional> purchaseOrder, - Optional> trackingCategory, - Optional> journalEntry, - Optional> taxRate, - Optional> invoice, - Optional> payment, - Optional> expense, - Optional> vendorCredit, - Optional> transaction, - Optional> accountingPeriod, - Optional> generalLedgerTransaction, - Optional> bankFeedAccount, - Optional> employee, - Map additionalProperties) { - this.account = account; - this.accountingAttachment = accountingAttachment; - this.balanceSheet = balanceSheet; - this.cashFlowStatement = cashFlowStatement; - this.companyInfo = companyInfo; - this.contact = contact; - this.incomeStatement = incomeStatement; - this.creditNote = creditNote; - this.item = item; - this.purchaseOrder = purchaseOrder; - this.trackingCategory = trackingCategory; - this.journalEntry = journalEntry; - this.taxRate = taxRate; - this.invoice = invoice; - this.payment = payment; - this.expense = expense; - this.vendorCredit = vendorCredit; - this.transaction = transaction; - this.accountingPeriod = accountingPeriod; - this.generalLedgerTransaction = generalLedgerTransaction; - this.bankFeedAccount = bankFeedAccount; - this.employee = employee; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("AccountingAttachment") - public Optional> getAccountingAttachment() { - return accountingAttachment; - } - - @JsonProperty("BalanceSheet") - public Optional> getBalanceSheet() { - return balanceSheet; - } - - @JsonProperty("CashFlowStatement") - public Optional> getCashFlowStatement() { - return cashFlowStatement; - } - - @JsonProperty("CompanyInfo") - public Optional> getCompanyInfo() { - return companyInfo; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @JsonProperty("IncomeStatement") - public Optional> getIncomeStatement() { - return incomeStatement; - } - - @JsonProperty("CreditNote") - public Optional> getCreditNote() { - return creditNote; - } - - @JsonProperty("Item") - public Optional> getItem() { - return item; - } - - @JsonProperty("PurchaseOrder") - public Optional> getPurchaseOrder() { - return purchaseOrder; - } - - @JsonProperty("TrackingCategory") - public Optional> getTrackingCategory() { - return trackingCategory; - } - - @JsonProperty("JournalEntry") - public Optional> getJournalEntry() { - return journalEntry; - } - - @JsonProperty("TaxRate") - public Optional> getTaxRate() { - return taxRate; - } - - @JsonProperty("Invoice") - public Optional> getInvoice() { - return invoice; - } - - @JsonProperty("Payment") - public Optional> getPayment() { - return payment; - } - - @JsonProperty("Expense") - public Optional> getExpense() { - return expense; - } - - @JsonProperty("VendorCredit") - public Optional> getVendorCredit() { - return vendorCredit; - } - - @JsonProperty("Transaction") - public Optional> getTransaction() { - return transaction; - } - - @JsonProperty("AccountingPeriod") - public Optional> getAccountingPeriod() { - return accountingPeriod; - } - - @JsonProperty("GeneralLedgerTransaction") - public Optional> getGeneralLedgerTransaction() { - return generalLedgerTransaction; - } - - @JsonProperty("BankFeedAccount") - public Optional> getBankFeedAccount() { - return bankFeedAccount; - } - - @JsonProperty("Employee") - public Optional> getEmployee() { - return employee; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApiResponse other) { - return account.equals(other.account) - && accountingAttachment.equals(other.accountingAttachment) - && balanceSheet.equals(other.balanceSheet) - && cashFlowStatement.equals(other.cashFlowStatement) - && companyInfo.equals(other.companyInfo) - && contact.equals(other.contact) - && incomeStatement.equals(other.incomeStatement) - && creditNote.equals(other.creditNote) - && item.equals(other.item) - && purchaseOrder.equals(other.purchaseOrder) - && trackingCategory.equals(other.trackingCategory) - && journalEntry.equals(other.journalEntry) - && taxRate.equals(other.taxRate) - && invoice.equals(other.invoice) - && payment.equals(other.payment) - && expense.equals(other.expense) - && vendorCredit.equals(other.vendorCredit) - && transaction.equals(other.transaction) - && accountingPeriod.equals(other.accountingPeriod) - && generalLedgerTransaction.equals(other.generalLedgerTransaction) - && bankFeedAccount.equals(other.bankFeedAccount) - && employee.equals(other.employee); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.account, - this.accountingAttachment, - this.balanceSheet, - this.cashFlowStatement, - this.companyInfo, - this.contact, - this.incomeStatement, - this.creditNote, - this.item, - this.purchaseOrder, - this.trackingCategory, - this.journalEntry, - this.taxRate, - this.invoice, - this.payment, - this.expense, - this.vendorCredit, - this.transaction, - this.accountingPeriod, - this.generalLedgerTransaction, - this.bankFeedAccount, - this.employee); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> account = Optional.empty(); - - private Optional> accountingAttachment = Optional.empty(); - - private Optional> balanceSheet = Optional.empty(); - - private Optional> cashFlowStatement = Optional.empty(); - - private Optional> companyInfo = Optional.empty(); - - private Optional> contact = Optional.empty(); - - private Optional> incomeStatement = Optional.empty(); - - private Optional> creditNote = Optional.empty(); - - private Optional> item = Optional.empty(); - - private Optional> purchaseOrder = Optional.empty(); - - private Optional> trackingCategory = Optional.empty(); - - private Optional> journalEntry = Optional.empty(); - - private Optional> taxRate = Optional.empty(); - - private Optional> invoice = Optional.empty(); - - private Optional> payment = Optional.empty(); - - private Optional> expense = Optional.empty(); - - private Optional> vendorCredit = Optional.empty(); - - private Optional> transaction = Optional.empty(); - - private Optional> accountingPeriod = Optional.empty(); - - private Optional> generalLedgerTransaction = Optional.empty(); - - private Optional> bankFeedAccount = Optional.empty(); - - private Optional> employee = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApiResponse other) { - account(other.getAccount()); - accountingAttachment(other.getAccountingAttachment()); - balanceSheet(other.getBalanceSheet()); - cashFlowStatement(other.getCashFlowStatement()); - companyInfo(other.getCompanyInfo()); - contact(other.getContact()); - incomeStatement(other.getIncomeStatement()); - creditNote(other.getCreditNote()); - item(other.getItem()); - purchaseOrder(other.getPurchaseOrder()); - trackingCategory(other.getTrackingCategory()); - journalEntry(other.getJournalEntry()); - taxRate(other.getTaxRate()); - invoice(other.getInvoice()); - payment(other.getPayment()); - expense(other.getExpense()); - vendorCredit(other.getVendorCredit()); - transaction(other.getTransaction()); - accountingPeriod(other.getAccountingPeriod()); - generalLedgerTransaction(other.getGeneralLedgerTransaction()); - bankFeedAccount(other.getBankFeedAccount()); - employee(other.getEmployee()); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "AccountingAttachment", nulls = Nulls.SKIP) - public Builder accountingAttachment(Optional> accountingAttachment) { - this.accountingAttachment = accountingAttachment; - return this; - } - - public Builder accountingAttachment(List accountingAttachment) { - this.accountingAttachment = Optional.ofNullable(accountingAttachment); - return this; - } - - @JsonSetter(value = "BalanceSheet", nulls = Nulls.SKIP) - public Builder balanceSheet(Optional> balanceSheet) { - this.balanceSheet = balanceSheet; - return this; - } - - public Builder balanceSheet(List balanceSheet) { - this.balanceSheet = Optional.ofNullable(balanceSheet); - return this; - } - - @JsonSetter(value = "CashFlowStatement", nulls = Nulls.SKIP) - public Builder cashFlowStatement(Optional> cashFlowStatement) { - this.cashFlowStatement = cashFlowStatement; - return this; - } - - public Builder cashFlowStatement(List cashFlowStatement) { - this.cashFlowStatement = Optional.ofNullable(cashFlowStatement); - return this; - } - - @JsonSetter(value = "CompanyInfo", nulls = Nulls.SKIP) - public Builder companyInfo(Optional> companyInfo) { - this.companyInfo = companyInfo; - return this; - } - - public Builder companyInfo(List companyInfo) { - this.companyInfo = Optional.ofNullable(companyInfo); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - @JsonSetter(value = "IncomeStatement", nulls = Nulls.SKIP) - public Builder incomeStatement(Optional> incomeStatement) { - this.incomeStatement = incomeStatement; - return this; - } - - public Builder incomeStatement(List incomeStatement) { - this.incomeStatement = Optional.ofNullable(incomeStatement); - return this; - } - - @JsonSetter(value = "CreditNote", nulls = Nulls.SKIP) - public Builder creditNote(Optional> creditNote) { - this.creditNote = creditNote; - return this; - } - - public Builder creditNote(List creditNote) { - this.creditNote = Optional.ofNullable(creditNote); - return this; - } - - @JsonSetter(value = "Item", nulls = Nulls.SKIP) - public Builder item(Optional> item) { - this.item = item; - return this; - } - - public Builder item(List item) { - this.item = Optional.ofNullable(item); - return this; - } - - @JsonSetter(value = "PurchaseOrder", nulls = Nulls.SKIP) - public Builder purchaseOrder(Optional> purchaseOrder) { - this.purchaseOrder = purchaseOrder; - return this; - } - - public Builder purchaseOrder(List purchaseOrder) { - this.purchaseOrder = Optional.ofNullable(purchaseOrder); - return this; - } - - @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) - public Builder trackingCategory(Optional> trackingCategory) { - this.trackingCategory = trackingCategory; - return this; - } - - public Builder trackingCategory(List trackingCategory) { - this.trackingCategory = Optional.ofNullable(trackingCategory); - return this; - } - - @JsonSetter(value = "JournalEntry", nulls = Nulls.SKIP) - public Builder journalEntry(Optional> journalEntry) { - this.journalEntry = journalEntry; - return this; - } - - public Builder journalEntry(List journalEntry) { - this.journalEntry = Optional.ofNullable(journalEntry); - return this; - } - - @JsonSetter(value = "TaxRate", nulls = Nulls.SKIP) - public Builder taxRate(Optional> taxRate) { - this.taxRate = taxRate; - return this; - } - - public Builder taxRate(List taxRate) { - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - @JsonSetter(value = "Invoice", nulls = Nulls.SKIP) - public Builder invoice(Optional> invoice) { - this.invoice = invoice; - return this; - } - - public Builder invoice(List invoice) { - this.invoice = Optional.ofNullable(invoice); - return this; - } - - @JsonSetter(value = "Payment", nulls = Nulls.SKIP) - public Builder payment(Optional> payment) { - this.payment = payment; - return this; - } - - public Builder payment(List payment) { - this.payment = Optional.ofNullable(payment); - return this; - } - - @JsonSetter(value = "Expense", nulls = Nulls.SKIP) - public Builder expense(Optional> expense) { - this.expense = expense; - return this; - } - - public Builder expense(List expense) { - this.expense = Optional.ofNullable(expense); - return this; - } - - @JsonSetter(value = "VendorCredit", nulls = Nulls.SKIP) - public Builder vendorCredit(Optional> vendorCredit) { - this.vendorCredit = vendorCredit; - return this; - } - - public Builder vendorCredit(List vendorCredit) { - this.vendorCredit = Optional.ofNullable(vendorCredit); - return this; - } - - @JsonSetter(value = "Transaction", nulls = Nulls.SKIP) - public Builder transaction(Optional> transaction) { - this.transaction = transaction; - return this; - } - - public Builder transaction(List transaction) { - this.transaction = Optional.ofNullable(transaction); - return this; - } - - @JsonSetter(value = "AccountingPeriod", nulls = Nulls.SKIP) - public Builder accountingPeriod(Optional> accountingPeriod) { - this.accountingPeriod = accountingPeriod; - return this; - } - - public Builder accountingPeriod(List accountingPeriod) { - this.accountingPeriod = Optional.ofNullable(accountingPeriod); - return this; - } - - @JsonSetter(value = "GeneralLedgerTransaction", nulls = Nulls.SKIP) - public Builder generalLedgerTransaction(Optional> generalLedgerTransaction) { - this.generalLedgerTransaction = generalLedgerTransaction; - return this; - } - - public Builder generalLedgerTransaction(List generalLedgerTransaction) { - this.generalLedgerTransaction = Optional.ofNullable(generalLedgerTransaction); - return this; - } - - @JsonSetter(value = "BankFeedAccount", nulls = Nulls.SKIP) - public Builder bankFeedAccount(Optional> bankFeedAccount) { - this.bankFeedAccount = bankFeedAccount; - return this; - } - - public Builder bankFeedAccount(List bankFeedAccount) { - this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); - return this; - } - - @JsonSetter(value = "Employee", nulls = Nulls.SKIP) - public Builder employee(Optional> employee) { - this.employee = employee; - return this; - } - - public Builder employee(List employee) { - this.employee = Optional.ofNullable(employee); - return this; - } - - public ExternalTargetFieldApiResponse build() { - return new ExternalTargetFieldApiResponse( - account, - accountingAttachment, - balanceSheet, - cashFlowStatement, - companyInfo, - contact, - incomeStatement, - creditNote, - item, - purchaseOrder, - trackingCategory, - journalEntry, - taxRate, - invoice, - payment, - expense, - vendorCredit, - transaction, - accountingPeriod, - generalLedgerTransaction, - bankFeedAccount, - employee, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldFormatEnum.java b/src/main/java/com/merge/api/resources/accounting/types/FieldFormatEnum.java deleted file mode 100644 index 3b3119877..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldFormatEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FieldFormatEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - FieldFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstance.java deleted file mode 100644 index 7d32300b4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstance.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) -public final class FieldMappingApiInstance { - private final Optional id; - - private final Optional isIntegrationWide; - - private final Optional targetField; - - private final Optional remoteField; - - private final Map additionalProperties; - - private FieldMappingApiInstance( - Optional id, - Optional isIntegrationWide, - Optional targetField, - Optional remoteField, - Map additionalProperties) { - this.id = id; - this.isIntegrationWide = isIntegrationWide; - this.targetField = targetField; - this.remoteField = remoteField; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("is_integration_wide") - public Optional getIsIntegrationWide() { - return isIntegrationWide; - } - - @JsonProperty("target_field") - public Optional getTargetField() { - return targetField; - } - - @JsonProperty("remote_field") - public Optional getRemoteField() { - return remoteField; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstance other) { - return id.equals(other.id) - && isIntegrationWide.equals(other.isIntegrationWide) - && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional isIntegrationWide = Optional.empty(); - - private Optional targetField = Optional.empty(); - - private Optional remoteField = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstance other) { - id(other.getId()); - isIntegrationWide(other.getIsIntegrationWide()); - targetField(other.getTargetField()); - remoteField(other.getRemoteField()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) - public Builder isIntegrationWide(Optional isIntegrationWide) { - this.isIntegrationWide = isIntegrationWide; - return this; - } - - public Builder isIntegrationWide(Boolean isIntegrationWide) { - this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); - return this; - } - - @JsonSetter(value = "target_field", nulls = Nulls.SKIP) - public Builder targetField(Optional targetField) { - this.targetField = targetField; - return this; - } - - public Builder targetField(FieldMappingApiInstanceTargetField targetField) { - this.targetField = Optional.ofNullable(targetField); - return this; - } - - @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) - public Builder remoteField(Optional remoteField) { - this.remoteField = remoteField; - return this; - } - - public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { - this.remoteField = Optional.ofNullable(remoteField); - return this; - } - - public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceRemoteField.java deleted file mode 100644 index 9ca9a5524..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceRemoteField.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) -public final class FieldMappingApiInstanceRemoteField { - private final Optional remoteKeyName; - - private final Optional> schema; - - private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteField( - Optional remoteKeyName, - Optional> schema, - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, - Map additionalProperties) { - this.remoteKeyName = remoteKeyName; - this.schema = schema; - this.remoteEndpointInfo = remoteEndpointInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("schema") - public Optional> getSchema() { - return schema; - } - - @JsonProperty("remote_endpoint_info") - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteField - && equalTo((FieldMappingApiInstanceRemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteField other) { - return remoteKeyName.equals(other.remoteKeyName) - && schema.equals(other.schema) - && remoteEndpointInfo.equals(other.remoteEndpointInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteEndpointInfoStage builder() { - return new Builder(); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); - - Builder from(FieldMappingApiInstanceRemoteField other); - } - - public interface _FinalStage { - FieldMappingApiInstanceRemoteField build(); - - _FinalStage remoteKeyName(Optional remoteKeyName); - - _FinalStage remoteKeyName(String remoteKeyName); - - _FinalStage schema(Optional> schema); - - _FinalStage schema(Map schema); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private Optional> schema = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceRemoteField other) { - remoteKeyName(other.getRemoteKeyName()); - schema(other.getSchema()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage schema(Map schema) { - this.schema = Optional.ofNullable(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Optional> schema) { - this.schema = schema; - return this; - } - - @java.lang.Override - public _FinalStage remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public _FinalStage remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceRemoteField build() { - return new FieldMappingApiInstanceRemoteField( - remoteKeyName, schema, remoteEndpointInfo, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java deleted file mode 100644 index d6b2d33d6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) -public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { - private final Optional method; - - private final Optional urlPath; - - private final Optional> fieldTraversalPath; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - Optional method, - Optional urlPath, - Optional> fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public Optional getMethod() { - return method; - } - - @JsonProperty("url_path") - public Optional getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public Optional> getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional method = Optional.empty(); - - private Optional urlPath = Optional.empty(); - - private Optional> fieldTraversalPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @JsonSetter(value = "method", nulls = Nulls.SKIP) - public Builder method(Optional method) { - this.method = method; - return this; - } - - public Builder method(String method) { - this.method = Optional.ofNullable(method); - return this; - } - - @JsonSetter(value = "url_path", nulls = Nulls.SKIP) - public Builder urlPath(Optional urlPath) { - this.urlPath = urlPath; - return this; - } - - public Builder urlPath(String urlPath) { - this.urlPath = Optional.ofNullable(urlPath); - return this; - } - - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public Builder fieldTraversalPath(Optional> fieldTraversalPath) { - this.fieldTraversalPath = fieldTraversalPath; - return this; - } - - public Builder fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); - return this; - } - - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { - return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceResponse.java deleted file mode 100644 index 2888091a9..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceResponse.java +++ /dev/null @@ -1,647 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) -public final class FieldMappingApiInstanceResponse { - private final Optional> account; - - private final Optional> accountingAttachment; - - private final Optional> balanceSheet; - - private final Optional> cashFlowStatement; - - private final Optional> companyInfo; - - private final Optional> contact; - - private final Optional> incomeStatement; - - private final Optional> creditNote; - - private final Optional> item; - - private final Optional> purchaseOrder; - - private final Optional> trackingCategory; - - private final Optional> journalEntry; - - private final Optional> taxRate; - - private final Optional> invoice; - - private final Optional> payment; - - private final Optional> expense; - - private final Optional> vendorCredit; - - private final Optional> transaction; - - private final Optional> accountingPeriod; - - private final Optional> generalLedgerTransaction; - - private final Optional> bankFeedAccount; - - private final Optional> employee; - - private final Map additionalProperties; - - private FieldMappingApiInstanceResponse( - Optional> account, - Optional> accountingAttachment, - Optional> balanceSheet, - Optional> cashFlowStatement, - Optional> companyInfo, - Optional> contact, - Optional> incomeStatement, - Optional> creditNote, - Optional> item, - Optional> purchaseOrder, - Optional> trackingCategory, - Optional> journalEntry, - Optional> taxRate, - Optional> invoice, - Optional> payment, - Optional> expense, - Optional> vendorCredit, - Optional> transaction, - Optional> accountingPeriod, - Optional> generalLedgerTransaction, - Optional> bankFeedAccount, - Optional> employee, - Map additionalProperties) { - this.account = account; - this.accountingAttachment = accountingAttachment; - this.balanceSheet = balanceSheet; - this.cashFlowStatement = cashFlowStatement; - this.companyInfo = companyInfo; - this.contact = contact; - this.incomeStatement = incomeStatement; - this.creditNote = creditNote; - this.item = item; - this.purchaseOrder = purchaseOrder; - this.trackingCategory = trackingCategory; - this.journalEntry = journalEntry; - this.taxRate = taxRate; - this.invoice = invoice; - this.payment = payment; - this.expense = expense; - this.vendorCredit = vendorCredit; - this.transaction = transaction; - this.accountingPeriod = accountingPeriod; - this.generalLedgerTransaction = generalLedgerTransaction; - this.bankFeedAccount = bankFeedAccount; - this.employee = employee; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("AccountingAttachment") - public Optional> getAccountingAttachment() { - return accountingAttachment; - } - - @JsonProperty("BalanceSheet") - public Optional> getBalanceSheet() { - return balanceSheet; - } - - @JsonProperty("CashFlowStatement") - public Optional> getCashFlowStatement() { - return cashFlowStatement; - } - - @JsonProperty("CompanyInfo") - public Optional> getCompanyInfo() { - return companyInfo; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @JsonProperty("IncomeStatement") - public Optional> getIncomeStatement() { - return incomeStatement; - } - - @JsonProperty("CreditNote") - public Optional> getCreditNote() { - return creditNote; - } - - @JsonProperty("Item") - public Optional> getItem() { - return item; - } - - @JsonProperty("PurchaseOrder") - public Optional> getPurchaseOrder() { - return purchaseOrder; - } - - @JsonProperty("TrackingCategory") - public Optional> getTrackingCategory() { - return trackingCategory; - } - - @JsonProperty("JournalEntry") - public Optional> getJournalEntry() { - return journalEntry; - } - - @JsonProperty("TaxRate") - public Optional> getTaxRate() { - return taxRate; - } - - @JsonProperty("Invoice") - public Optional> getInvoice() { - return invoice; - } - - @JsonProperty("Payment") - public Optional> getPayment() { - return payment; - } - - @JsonProperty("Expense") - public Optional> getExpense() { - return expense; - } - - @JsonProperty("VendorCredit") - public Optional> getVendorCredit() { - return vendorCredit; - } - - @JsonProperty("Transaction") - public Optional> getTransaction() { - return transaction; - } - - @JsonProperty("AccountingPeriod") - public Optional> getAccountingPeriod() { - return accountingPeriod; - } - - @JsonProperty("GeneralLedgerTransaction") - public Optional> getGeneralLedgerTransaction() { - return generalLedgerTransaction; - } - - @JsonProperty("BankFeedAccount") - public Optional> getBankFeedAccount() { - return bankFeedAccount; - } - - @JsonProperty("Employee") - public Optional> getEmployee() { - return employee; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceResponse other) { - return account.equals(other.account) - && accountingAttachment.equals(other.accountingAttachment) - && balanceSheet.equals(other.balanceSheet) - && cashFlowStatement.equals(other.cashFlowStatement) - && companyInfo.equals(other.companyInfo) - && contact.equals(other.contact) - && incomeStatement.equals(other.incomeStatement) - && creditNote.equals(other.creditNote) - && item.equals(other.item) - && purchaseOrder.equals(other.purchaseOrder) - && trackingCategory.equals(other.trackingCategory) - && journalEntry.equals(other.journalEntry) - && taxRate.equals(other.taxRate) - && invoice.equals(other.invoice) - && payment.equals(other.payment) - && expense.equals(other.expense) - && vendorCredit.equals(other.vendorCredit) - && transaction.equals(other.transaction) - && accountingPeriod.equals(other.accountingPeriod) - && generalLedgerTransaction.equals(other.generalLedgerTransaction) - && bankFeedAccount.equals(other.bankFeedAccount) - && employee.equals(other.employee); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.account, - this.accountingAttachment, - this.balanceSheet, - this.cashFlowStatement, - this.companyInfo, - this.contact, - this.incomeStatement, - this.creditNote, - this.item, - this.purchaseOrder, - this.trackingCategory, - this.journalEntry, - this.taxRate, - this.invoice, - this.payment, - this.expense, - this.vendorCredit, - this.transaction, - this.accountingPeriod, - this.generalLedgerTransaction, - this.bankFeedAccount, - this.employee); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> account = Optional.empty(); - - private Optional> accountingAttachment = Optional.empty(); - - private Optional> balanceSheet = Optional.empty(); - - private Optional> cashFlowStatement = Optional.empty(); - - private Optional> companyInfo = Optional.empty(); - - private Optional> contact = Optional.empty(); - - private Optional> incomeStatement = Optional.empty(); - - private Optional> creditNote = Optional.empty(); - - private Optional> item = Optional.empty(); - - private Optional> purchaseOrder = Optional.empty(); - - private Optional> trackingCategory = Optional.empty(); - - private Optional> journalEntry = Optional.empty(); - - private Optional> taxRate = Optional.empty(); - - private Optional> invoice = Optional.empty(); - - private Optional> payment = Optional.empty(); - - private Optional> expense = Optional.empty(); - - private Optional> vendorCredit = Optional.empty(); - - private Optional> transaction = Optional.empty(); - - private Optional> accountingPeriod = Optional.empty(); - - private Optional> generalLedgerTransaction = Optional.empty(); - - private Optional> bankFeedAccount = Optional.empty(); - - private Optional> employee = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceResponse other) { - account(other.getAccount()); - accountingAttachment(other.getAccountingAttachment()); - balanceSheet(other.getBalanceSheet()); - cashFlowStatement(other.getCashFlowStatement()); - companyInfo(other.getCompanyInfo()); - contact(other.getContact()); - incomeStatement(other.getIncomeStatement()); - creditNote(other.getCreditNote()); - item(other.getItem()); - purchaseOrder(other.getPurchaseOrder()); - trackingCategory(other.getTrackingCategory()); - journalEntry(other.getJournalEntry()); - taxRate(other.getTaxRate()); - invoice(other.getInvoice()); - payment(other.getPayment()); - expense(other.getExpense()); - vendorCredit(other.getVendorCredit()); - transaction(other.getTransaction()); - accountingPeriod(other.getAccountingPeriod()); - generalLedgerTransaction(other.getGeneralLedgerTransaction()); - bankFeedAccount(other.getBankFeedAccount()); - employee(other.getEmployee()); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "AccountingAttachment", nulls = Nulls.SKIP) - public Builder accountingAttachment(Optional> accountingAttachment) { - this.accountingAttachment = accountingAttachment; - return this; - } - - public Builder accountingAttachment(List accountingAttachment) { - this.accountingAttachment = Optional.ofNullable(accountingAttachment); - return this; - } - - @JsonSetter(value = "BalanceSheet", nulls = Nulls.SKIP) - public Builder balanceSheet(Optional> balanceSheet) { - this.balanceSheet = balanceSheet; - return this; - } - - public Builder balanceSheet(List balanceSheet) { - this.balanceSheet = Optional.ofNullable(balanceSheet); - return this; - } - - @JsonSetter(value = "CashFlowStatement", nulls = Nulls.SKIP) - public Builder cashFlowStatement(Optional> cashFlowStatement) { - this.cashFlowStatement = cashFlowStatement; - return this; - } - - public Builder cashFlowStatement(List cashFlowStatement) { - this.cashFlowStatement = Optional.ofNullable(cashFlowStatement); - return this; - } - - @JsonSetter(value = "CompanyInfo", nulls = Nulls.SKIP) - public Builder companyInfo(Optional> companyInfo) { - this.companyInfo = companyInfo; - return this; - } - - public Builder companyInfo(List companyInfo) { - this.companyInfo = Optional.ofNullable(companyInfo); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - @JsonSetter(value = "IncomeStatement", nulls = Nulls.SKIP) - public Builder incomeStatement(Optional> incomeStatement) { - this.incomeStatement = incomeStatement; - return this; - } - - public Builder incomeStatement(List incomeStatement) { - this.incomeStatement = Optional.ofNullable(incomeStatement); - return this; - } - - @JsonSetter(value = "CreditNote", nulls = Nulls.SKIP) - public Builder creditNote(Optional> creditNote) { - this.creditNote = creditNote; - return this; - } - - public Builder creditNote(List creditNote) { - this.creditNote = Optional.ofNullable(creditNote); - return this; - } - - @JsonSetter(value = "Item", nulls = Nulls.SKIP) - public Builder item(Optional> item) { - this.item = item; - return this; - } - - public Builder item(List item) { - this.item = Optional.ofNullable(item); - return this; - } - - @JsonSetter(value = "PurchaseOrder", nulls = Nulls.SKIP) - public Builder purchaseOrder(Optional> purchaseOrder) { - this.purchaseOrder = purchaseOrder; - return this; - } - - public Builder purchaseOrder(List purchaseOrder) { - this.purchaseOrder = Optional.ofNullable(purchaseOrder); - return this; - } - - @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) - public Builder trackingCategory(Optional> trackingCategory) { - this.trackingCategory = trackingCategory; - return this; - } - - public Builder trackingCategory(List trackingCategory) { - this.trackingCategory = Optional.ofNullable(trackingCategory); - return this; - } - - @JsonSetter(value = "JournalEntry", nulls = Nulls.SKIP) - public Builder journalEntry(Optional> journalEntry) { - this.journalEntry = journalEntry; - return this; - } - - public Builder journalEntry(List journalEntry) { - this.journalEntry = Optional.ofNullable(journalEntry); - return this; - } - - @JsonSetter(value = "TaxRate", nulls = Nulls.SKIP) - public Builder taxRate(Optional> taxRate) { - this.taxRate = taxRate; - return this; - } - - public Builder taxRate(List taxRate) { - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - @JsonSetter(value = "Invoice", nulls = Nulls.SKIP) - public Builder invoice(Optional> invoice) { - this.invoice = invoice; - return this; - } - - public Builder invoice(List invoice) { - this.invoice = Optional.ofNullable(invoice); - return this; - } - - @JsonSetter(value = "Payment", nulls = Nulls.SKIP) - public Builder payment(Optional> payment) { - this.payment = payment; - return this; - } - - public Builder payment(List payment) { - this.payment = Optional.ofNullable(payment); - return this; - } - - @JsonSetter(value = "Expense", nulls = Nulls.SKIP) - public Builder expense(Optional> expense) { - this.expense = expense; - return this; - } - - public Builder expense(List expense) { - this.expense = Optional.ofNullable(expense); - return this; - } - - @JsonSetter(value = "VendorCredit", nulls = Nulls.SKIP) - public Builder vendorCredit(Optional> vendorCredit) { - this.vendorCredit = vendorCredit; - return this; - } - - public Builder vendorCredit(List vendorCredit) { - this.vendorCredit = Optional.ofNullable(vendorCredit); - return this; - } - - @JsonSetter(value = "Transaction", nulls = Nulls.SKIP) - public Builder transaction(Optional> transaction) { - this.transaction = transaction; - return this; - } - - public Builder transaction(List transaction) { - this.transaction = Optional.ofNullable(transaction); - return this; - } - - @JsonSetter(value = "AccountingPeriod", nulls = Nulls.SKIP) - public Builder accountingPeriod(Optional> accountingPeriod) { - this.accountingPeriod = accountingPeriod; - return this; - } - - public Builder accountingPeriod(List accountingPeriod) { - this.accountingPeriod = Optional.ofNullable(accountingPeriod); - return this; - } - - @JsonSetter(value = "GeneralLedgerTransaction", nulls = Nulls.SKIP) - public Builder generalLedgerTransaction(Optional> generalLedgerTransaction) { - this.generalLedgerTransaction = generalLedgerTransaction; - return this; - } - - public Builder generalLedgerTransaction(List generalLedgerTransaction) { - this.generalLedgerTransaction = Optional.ofNullable(generalLedgerTransaction); - return this; - } - - @JsonSetter(value = "BankFeedAccount", nulls = Nulls.SKIP) - public Builder bankFeedAccount(Optional> bankFeedAccount) { - this.bankFeedAccount = bankFeedAccount; - return this; - } - - public Builder bankFeedAccount(List bankFeedAccount) { - this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); - return this; - } - - @JsonSetter(value = "Employee", nulls = Nulls.SKIP) - public Builder employee(Optional> employee) { - this.employee = employee; - return this; - } - - public Builder employee(List employee) { - this.employee = Optional.ofNullable(employee); - return this; - } - - public FieldMappingApiInstanceResponse build() { - return new FieldMappingApiInstanceResponse( - account, - accountingAttachment, - balanceSheet, - cashFlowStatement, - companyInfo, - contact, - incomeStatement, - creditNote, - item, - purchaseOrder, - trackingCategory, - journalEntry, - taxRate, - invoice, - payment, - expense, - vendorCredit, - transaction, - accountingPeriod, - generalLedgerTransaction, - bankFeedAccount, - employee, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceTargetField.java deleted file mode 100644 index 0a67aa14d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingApiInstanceTargetField.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) -public final class FieldMappingApiInstanceTargetField { - private final String name; - - private final String description; - - private final boolean isOrganizationWide; - - private final Map additionalProperties; - - private FieldMappingApiInstanceTargetField( - String name, String description, boolean isOrganizationWide, Map additionalProperties) { - this.name = name; - this.description = description; - this.isOrganizationWide = isOrganizationWide; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("is_organization_wide") - public boolean getIsOrganizationWide() { - return isOrganizationWide; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceTargetField - && equalTo((FieldMappingApiInstanceTargetField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceTargetField other) { - return name.equals(other.name) - && description.equals(other.description) - && isOrganizationWide == other.isOrganizationWide; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isOrganizationWide); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DescriptionStage name(@NotNull String name); - - Builder from(FieldMappingApiInstanceTargetField other); - } - - public interface DescriptionStage { - IsOrganizationWideStage description(@NotNull String description); - } - - public interface IsOrganizationWideStage { - _FinalStage isOrganizationWide(boolean isOrganizationWide); - } - - public interface _FinalStage { - FieldMappingApiInstanceTargetField build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { - private String name; - - private String description; - - private boolean isOrganizationWide; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceTargetField other) { - name(other.getName()); - description(other.getDescription()); - isOrganizationWide(other.getIsOrganizationWide()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public DescriptionStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("description") - public IsOrganizationWideStage description(@NotNull String description) { - this.description = description; - return this; - } - - @java.lang.Override - @JsonSetter("is_organization_wide") - public _FinalStage isOrganizationWide(boolean isOrganizationWide) { - this.isOrganizationWide = isOrganizationWide; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceTargetField build() { - return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/resources/accounting/types/FieldMappingInstanceResponse.java deleted file mode 100644 index baf5d0c5b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldMappingInstanceResponse.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) -public final class FieldMappingInstanceResponse { - private final FieldMappingApiInstance model; - - private final List warnings; - - private final List errors; - - private final Optional> logs; - - private final Map additionalProperties; - - private FieldMappingInstanceResponse( - FieldMappingApiInstance model, - List warnings, - List errors, - Optional> logs, - Map additionalProperties) { - this.model = model; - this.warnings = warnings; - this.errors = errors; - this.logs = logs; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model") - public FieldMappingApiInstance getModel() { - return model; - } - - @JsonProperty("warnings") - public List getWarnings() { - return warnings; - } - - @JsonProperty("errors") - public List getErrors() { - return errors; - } - - @JsonProperty("logs") - public Optional> getLogs() { - return logs; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingInstanceResponse other) { - return model.equals(other.model) - && warnings.equals(other.warnings) - && errors.equals(other.errors) - && logs.equals(other.logs); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.warnings, this.errors, this.logs); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelStage builder() { - return new Builder(); - } - - public interface ModelStage { - _FinalStage model(@NotNull FieldMappingApiInstance model); - - Builder from(FieldMappingInstanceResponse other); - } - - public interface _FinalStage { - FieldMappingInstanceResponse build(); - - _FinalStage warnings(List warnings); - - _FinalStage addWarnings(WarningValidationProblem warnings); - - _FinalStage addAllWarnings(List warnings); - - _FinalStage errors(List errors); - - _FinalStage addErrors(ErrorValidationProblem errors); - - _FinalStage addAllErrors(List errors); - - _FinalStage logs(Optional> logs); - - _FinalStage logs(List logs); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelStage, _FinalStage { - private FieldMappingApiInstance model; - - private Optional> logs = Optional.empty(); - - private List errors = new ArrayList<>(); - - private List warnings = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingInstanceResponse other) { - model(other.getModel()); - warnings(other.getWarnings()); - errors(other.getErrors()); - logs(other.getLogs()); - return this; - } - - @java.lang.Override - @JsonSetter("model") - public _FinalStage model(@NotNull FieldMappingApiInstance model) { - this.model = model; - return this; - } - - @java.lang.Override - public _FinalStage logs(List logs) { - this.logs = Optional.ofNullable(logs); - return this; - } - - @java.lang.Override - @JsonSetter(value = "logs", nulls = Nulls.SKIP) - public _FinalStage logs(Optional> logs) { - this.logs = logs; - return this; - } - - @java.lang.Override - public _FinalStage addAllErrors(List errors) { - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addErrors(ErrorValidationProblem errors) { - this.errors.add(errors); - return this; - } - - @java.lang.Override - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public _FinalStage errors(List errors) { - this.errors.clear(); - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addAllWarnings(List warnings) { - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public _FinalStage addWarnings(WarningValidationProblem warnings) { - this.warnings.add(warnings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public _FinalStage warnings(List warnings) { - this.warnings.clear(); - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public FieldMappingInstanceResponse build() { - return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/resources/accounting/types/FieldPermissionDeserializer.java deleted file mode 100644 index 205c7484c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldPermissionDeserializer.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) -public final class FieldPermissionDeserializer { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializer( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializer other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializer other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializer build() { - return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/accounting/types/FieldPermissionDeserializerRequest.java deleted file mode 100644 index 9adffd6e1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldPermissionDeserializerRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) -public final class FieldPermissionDeserializerRequest { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializerRequest( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializerRequest - && equalTo((FieldPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializerRequest other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializerRequest other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializerRequest build() { - return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/FieldTypeEnum.java b/src/main/java/com/merge/api/resources/accounting/types/FieldTypeEnum.java deleted file mode 100644 index f81ec4c2b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/FieldTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FieldTypeEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - FieldTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java deleted file mode 100644 index 5d0b2d658..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = GeneralLedgerTransactionLineBaseCurrency.Deserializer.class) -public final class GeneralLedgerTransactionLineBaseCurrency { - private final Object value; - - private final int type; - - private GeneralLedgerTransactionLineBaseCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GeneralLedgerTransactionLineBaseCurrency - && equalTo((GeneralLedgerTransactionLineBaseCurrency) other); - } - - private boolean equalTo(GeneralLedgerTransactionLineBaseCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static GeneralLedgerTransactionLineBaseCurrency of(TransactionCurrencyEnum value) { - return new GeneralLedgerTransactionLineBaseCurrency(value, 0); - } - - public static GeneralLedgerTransactionLineBaseCurrency of(String value) { - return new GeneralLedgerTransactionLineBaseCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(GeneralLedgerTransactionLineBaseCurrency.class); - } - - @java.lang.Override - public GeneralLedgerTransactionLineBaseCurrency deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineTransactionCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineTransactionCurrency.java deleted file mode 100644 index 087815b85..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionLineTransactionCurrency.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = GeneralLedgerTransactionLineTransactionCurrency.Deserializer.class) -public final class GeneralLedgerTransactionLineTransactionCurrency { - private final Object value; - - private final int type; - - private GeneralLedgerTransactionLineTransactionCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GeneralLedgerTransactionLineTransactionCurrency - && equalTo((GeneralLedgerTransactionLineTransactionCurrency) other); - } - - private boolean equalTo(GeneralLedgerTransactionLineTransactionCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static GeneralLedgerTransactionLineTransactionCurrency of(TransactionCurrencyEnum value) { - return new GeneralLedgerTransactionLineTransactionCurrency(value, 0); - } - - public static GeneralLedgerTransactionLineTransactionCurrency of(String value) { - return new GeneralLedgerTransactionLineTransactionCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(GeneralLedgerTransactionLineTransactionCurrency.class); - } - - @java.lang.Override - public GeneralLedgerTransactionLineTransactionCurrency deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionUnderlyingTransactionType.java b/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionUnderlyingTransactionType.java deleted file mode 100644 index 0e323322d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/GeneralLedgerTransactionUnderlyingTransactionType.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = GeneralLedgerTransactionUnderlyingTransactionType.Deserializer.class) -public final class GeneralLedgerTransactionUnderlyingTransactionType { - private final Object value; - - private final int type; - - private GeneralLedgerTransactionUnderlyingTransactionType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((UnderlyingTransactionTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GeneralLedgerTransactionUnderlyingTransactionType - && equalTo((GeneralLedgerTransactionUnderlyingTransactionType) other); - } - - private boolean equalTo(GeneralLedgerTransactionUnderlyingTransactionType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static GeneralLedgerTransactionUnderlyingTransactionType of(UnderlyingTransactionTypeEnum value) { - return new GeneralLedgerTransactionUnderlyingTransactionType(value, 0); - } - - public static GeneralLedgerTransactionUnderlyingTransactionType of(String value) { - return new GeneralLedgerTransactionUnderlyingTransactionType(value, 1); - } - - public interface Visitor { - T visit(UnderlyingTransactionTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(GeneralLedgerTransactionUnderlyingTransactionType.class); - } - - @java.lang.Override - public GeneralLedgerTransactionUnderlyingTransactionType deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, UnderlyingTransactionTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/IncomeStatementCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/IncomeStatementCurrency.java deleted file mode 100644 index 3abf574f9..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/IncomeStatementCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IncomeStatementCurrency.Deserializer.class) -public final class IncomeStatementCurrency { - private final Object value; - - private final int type; - - private IncomeStatementCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IncomeStatementCurrency && equalTo((IncomeStatementCurrency) other); - } - - private boolean equalTo(IncomeStatementCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IncomeStatementCurrency of(TransactionCurrencyEnum value) { - return new IncomeStatementCurrency(value, 0); - } - - public static IncomeStatementCurrency of(String value) { - return new IncomeStatementCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IncomeStatementCurrency.class); - } - - @java.lang.Override - public IncomeStatementCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/resources/accounting/types/IndividualCommonModelScopeDeserializer.java deleted file mode 100644 index 107c20ffe..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/IndividualCommonModelScopeDeserializer.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) -public final class IndividualCommonModelScopeDeserializer { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializer( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializer - && equalTo((IndividualCommonModelScopeDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializer other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializer other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializer build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializer other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions(Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializer build() { - return new IndividualCommonModelScopeDeserializer( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/accounting/types/IndividualCommonModelScopeDeserializerRequest.java deleted file mode 100644 index a7480a755..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/IndividualCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) -public final class IndividualCommonModelScopeDeserializerRequest { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializerRequest( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializerRequest - && equalTo((IndividualCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializerRequest other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializerRequest build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializerRequest other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions( - Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializerRequest build() { - return new IndividualCommonModelScopeDeserializerRequest( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceCurrency.java deleted file mode 100644 index fd3d7ba7f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceCurrency.Deserializer.class) -public final class InvoiceCurrency { - private final Object value; - - private final int type; - - private InvoiceCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceCurrency && equalTo((InvoiceCurrency) other); - } - - private boolean equalTo(InvoiceCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceCurrency of(TransactionCurrencyEnum value) { - return new InvoiceCurrency(value, 0); - } - - public static InvoiceCurrency of(String value) { - return new InvoiceCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceCurrency.class); - } - - @java.lang.Override - public InvoiceCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemCurrency.java deleted file mode 100644 index 8edef2e88..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceLineItemCurrency.Deserializer.class) -public final class InvoiceLineItemCurrency { - private final Object value; - - private final int type; - - private InvoiceLineItemCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceLineItemCurrency && equalTo((InvoiceLineItemCurrency) other); - } - - private boolean equalTo(InvoiceLineItemCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceLineItemCurrency of(TransactionCurrencyEnum value) { - return new InvoiceLineItemCurrency(value, 0); - } - - public static InvoiceLineItemCurrency of(String value) { - return new InvoiceLineItemCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceLineItemCurrency.class); - } - - @java.lang.Override - public InvoiceLineItemCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequestCurrency.java deleted file mode 100644 index 45d52bbc2..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceLineItemRequestCurrency.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceLineItemRequestCurrency.Deserializer.class) -public final class InvoiceLineItemRequestCurrency { - private final Object value; - - private final int type; - - private InvoiceLineItemRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceLineItemRequestCurrency && equalTo((InvoiceLineItemRequestCurrency) other); - } - - private boolean equalTo(InvoiceLineItemRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceLineItemRequestCurrency of(TransactionCurrencyEnum value) { - return new InvoiceLineItemRequestCurrency(value, 0); - } - - public static InvoiceLineItemRequestCurrency of(String value) { - return new InvoiceLineItemRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceLineItemRequestCurrency.class); - } - - @java.lang.Override - public InvoiceLineItemRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestCurrency.java deleted file mode 100644 index 8a6ceb853..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceRequestCurrency.Deserializer.class) -public final class InvoiceRequestCurrency { - private final Object value; - - private final int type; - - private InvoiceRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceRequestCurrency && equalTo((InvoiceRequestCurrency) other); - } - - private boolean equalTo(InvoiceRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceRequestCurrency of(TransactionCurrencyEnum value) { - return new InvoiceRequestCurrency(value, 0); - } - - public static InvoiceRequestCurrency of(String value) { - return new InvoiceRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceRequestCurrency.class); - } - - @java.lang.Override - public InvoiceRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestStatus.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestStatus.java deleted file mode 100644 index a127a4ae6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceRequestStatus.Deserializer.class) -public final class InvoiceRequestStatus { - private final Object value; - - private final int type; - - private InvoiceRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InvoiceStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceRequestStatus && equalTo((InvoiceRequestStatus) other); - } - - private boolean equalTo(InvoiceRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceRequestStatus of(InvoiceStatusEnum value) { - return new InvoiceRequestStatus(value, 0); - } - - public static InvoiceRequestStatus of(String value) { - return new InvoiceRequestStatus(value, 1); - } - - public interface Visitor { - T visit(InvoiceStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceRequestStatus.class); - } - - @java.lang.Override - public InvoiceRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InvoiceStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestType.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestType.java deleted file mode 100644 index 30ae09f64..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceRequestType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceRequestType.Deserializer.class) -public final class InvoiceRequestType { - private final Object value; - - private final int type; - - private InvoiceRequestType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InvoiceTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceRequestType && equalTo((InvoiceRequestType) other); - } - - private boolean equalTo(InvoiceRequestType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceRequestType of(InvoiceTypeEnum value) { - return new InvoiceRequestType(value, 0); - } - - public static InvoiceRequestType of(String value) { - return new InvoiceRequestType(value, 1); - } - - public interface Visitor { - T visit(InvoiceTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceRequestType.class); - } - - @java.lang.Override - public InvoiceRequestType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InvoiceTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceStatus.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceStatus.java deleted file mode 100644 index eedfe8107..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceStatus.Deserializer.class) -public final class InvoiceStatus { - private final Object value; - - private final int type; - - private InvoiceStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InvoiceStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceStatus && equalTo((InvoiceStatus) other); - } - - private boolean equalTo(InvoiceStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceStatus of(InvoiceStatusEnum value) { - return new InvoiceStatus(value, 0); - } - - public static InvoiceStatus of(String value) { - return new InvoiceStatus(value, 1); - } - - public interface Visitor { - T visit(InvoiceStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceStatus.class); - } - - @java.lang.Override - public InvoiceStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InvoiceStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/InvoiceType.java b/src/main/java/com/merge/api/resources/accounting/types/InvoiceType.java deleted file mode 100644 index 0f55e2d65..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/InvoiceType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InvoiceType.Deserializer.class) -public final class InvoiceType { - private final Object value; - - private final int type; - - private InvoiceType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InvoiceTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InvoiceType && equalTo((InvoiceType) other); - } - - private boolean equalTo(InvoiceType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InvoiceType of(InvoiceTypeEnum value) { - return new InvoiceType(value, 0); - } - - public static InvoiceType of(String value) { - return new InvoiceType(value, 1); - } - - public interface Visitor { - T visit(InvoiceTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InvoiceType.class); - } - - @java.lang.Override - public InvoiceType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InvoiceTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/Issue.java b/src/main/java/com/merge/api/resources/accounting/types/Issue.java deleted file mode 100644 index 380d42135..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/Issue.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Issue.Builder.class) -public final class Issue { - private final Optional id; - - private final Optional status; - - private final String errorDescription; - - private final Optional> endUser; - - private final Optional firstIncidentTime; - - private final Optional lastIncidentTime; - - private final Optional isMuted; - - private final Optional> errorDetails; - - private final Map additionalProperties; - - private Issue( - Optional id, - Optional status, - String errorDescription, - Optional> endUser, - Optional firstIncidentTime, - Optional lastIncidentTime, - Optional isMuted, - Optional> errorDetails, - Map additionalProperties) { - this.id = id; - this.status = status; - this.errorDescription = errorDescription; - this.endUser = endUser; - this.firstIncidentTime = firstIncidentTime; - this.lastIncidentTime = lastIncidentTime; - this.isMuted = isMuted; - this.errorDetails = errorDetails; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("error_description") - public String getErrorDescription() { - return errorDescription; - } - - @JsonProperty("end_user") - public Optional> getEndUser() { - return endUser; - } - - @JsonProperty("first_incident_time") - public Optional getFirstIncidentTime() { - return firstIncidentTime; - } - - @JsonProperty("last_incident_time") - public Optional getLastIncidentTime() { - return lastIncidentTime; - } - - @JsonProperty("is_muted") - public Optional getIsMuted() { - return isMuted; - } - - @JsonProperty("error_details") - public Optional> getErrorDetails() { - return errorDetails; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Issue && equalTo((Issue) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Issue other) { - return id.equals(other.id) - && status.equals(other.status) - && errorDescription.equals(other.errorDescription) - && endUser.equals(other.endUser) - && firstIncidentTime.equals(other.firstIncidentTime) - && lastIncidentTime.equals(other.lastIncidentTime) - && isMuted.equals(other.isMuted) - && errorDetails.equals(other.errorDetails); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.status, - this.errorDescription, - this.endUser, - this.firstIncidentTime, - this.lastIncidentTime, - this.isMuted, - this.errorDetails); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ErrorDescriptionStage builder() { - return new Builder(); - } - - public interface ErrorDescriptionStage { - _FinalStage errorDescription(@NotNull String errorDescription); - - Builder from(Issue other); - } - - public interface _FinalStage { - Issue build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage status(Optional status); - - _FinalStage status(IssueStatus status); - - _FinalStage endUser(Optional> endUser); - - _FinalStage endUser(Map endUser); - - _FinalStage firstIncidentTime(Optional firstIncidentTime); - - _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); - - _FinalStage lastIncidentTime(Optional lastIncidentTime); - - _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); - - _FinalStage isMuted(Optional isMuted); - - _FinalStage isMuted(Boolean isMuted); - - _FinalStage errorDetails(Optional> errorDetails); - - _FinalStage errorDetails(List errorDetails); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ErrorDescriptionStage, _FinalStage { - private String errorDescription; - - private Optional> errorDetails = Optional.empty(); - - private Optional isMuted = Optional.empty(); - - private Optional lastIncidentTime = Optional.empty(); - - private Optional firstIncidentTime = Optional.empty(); - - private Optional> endUser = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Issue other) { - id(other.getId()); - status(other.getStatus()); - errorDescription(other.getErrorDescription()); - endUser(other.getEndUser()); - firstIncidentTime(other.getFirstIncidentTime()); - lastIncidentTime(other.getLastIncidentTime()); - isMuted(other.getIsMuted()); - errorDetails(other.getErrorDetails()); - return this; - } - - @java.lang.Override - @JsonSetter("error_description") - public _FinalStage errorDescription(@NotNull String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - @java.lang.Override - public _FinalStage errorDetails(List errorDetails) { - this.errorDetails = Optional.ofNullable(errorDetails); - return this; - } - - @java.lang.Override - @JsonSetter(value = "error_details", nulls = Nulls.SKIP) - public _FinalStage errorDetails(Optional> errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - @java.lang.Override - public _FinalStage isMuted(Boolean isMuted) { - this.isMuted = Optional.ofNullable(isMuted); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) - public _FinalStage isMuted(Optional isMuted) { - this.isMuted = isMuted; - return this; - } - - @java.lang.Override - public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { - this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) - public _FinalStage lastIncidentTime(Optional lastIncidentTime) { - this.lastIncidentTime = lastIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { - this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) - public _FinalStage firstIncidentTime(Optional firstIncidentTime) { - this.firstIncidentTime = firstIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage endUser(Map endUser) { - this.endUser = Optional.ofNullable(endUser); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user", nulls = Nulls.SKIP) - public _FinalStage endUser(Optional> endUser) { - this.endUser = endUser; - return this; - } - - /** - *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

- *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage status(IssueStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public Issue build() { - return new Issue( - id, - status, - errorDescription, - endUser, - firstIncidentTime, - lastIncidentTime, - isMuted, - errorDetails, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/IssueStatus.java b/src/main/java/com/merge/api/resources/accounting/types/IssueStatus.java deleted file mode 100644 index bf658d0ad..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/IssueStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IssueStatus.Deserializer.class) -public final class IssueStatus { - private final Object value; - - private final int type; - - private IssueStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((IssueStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssueStatus && equalTo((IssueStatus) other); - } - - private boolean equalTo(IssueStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IssueStatus of(IssueStatusEnum value) { - return new IssueStatus(value, 0); - } - - public static IssueStatus of(String value) { - return new IssueStatus(value, 1); - } - - public interface Visitor { - T visit(IssueStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IssueStatus.class); - } - - @java.lang.Override - public IssueStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/IssueStatusEnum.java b/src/main/java/com/merge/api/resources/accounting/types/IssueStatusEnum.java deleted file mode 100644 index e04c1dda1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/IssueStatusEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssueStatusEnum { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssueStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemFormatEnum.java b/src/main/java/com/merge/api/resources/accounting/types/ItemFormatEnum.java deleted file mode 100644 index adb14fce6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemFormatEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemFormatEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - ItemFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemSchema.java b/src/main/java/com/merge/api/resources/accounting/types/ItemSchema.java deleted file mode 100644 index cc278b8a5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemSchema.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ItemSchema.Builder.class) -public final class ItemSchema { - private final Optional itemType; - - private final Optional itemFormat; - - private final Optional> itemChoices; - - private final Map additionalProperties; - - private ItemSchema( - Optional itemType, - Optional itemFormat, - Optional> itemChoices, - Map additionalProperties) { - this.itemType = itemType; - this.itemFormat = itemFormat; - this.itemChoices = itemChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("item_type") - public Optional getItemType() { - return itemType; - } - - @JsonProperty("item_format") - public Optional getItemFormat() { - return itemFormat; - } - - @JsonProperty("item_choices") - public Optional> getItemChoices() { - return itemChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ItemSchema && equalTo((ItemSchema) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ItemSchema other) { - return itemType.equals(other.itemType) - && itemFormat.equals(other.itemFormat) - && itemChoices.equals(other.itemChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional itemType = Optional.empty(); - - private Optional itemFormat = Optional.empty(); - - private Optional> itemChoices = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ItemSchema other) { - itemType(other.getItemType()); - itemFormat(other.getItemFormat()); - itemChoices(other.getItemChoices()); - return this; - } - - @JsonSetter(value = "item_type", nulls = Nulls.SKIP) - public Builder itemType(Optional itemType) { - this.itemType = itemType; - return this; - } - - public Builder itemType(ItemTypeEnum itemType) { - this.itemType = Optional.ofNullable(itemType); - return this; - } - - @JsonSetter(value = "item_format", nulls = Nulls.SKIP) - public Builder itemFormat(Optional itemFormat) { - this.itemFormat = itemFormat; - return this; - } - - public Builder itemFormat(ItemFormatEnum itemFormat) { - this.itemFormat = Optional.ofNullable(itemFormat); - return this; - } - - @JsonSetter(value = "item_choices", nulls = Nulls.SKIP) - public Builder itemChoices(Optional> itemChoices) { - this.itemChoices = itemChoices; - return this; - } - - public Builder itemChoices(List itemChoices) { - this.itemChoices = Optional.ofNullable(itemChoices); - return this; - } - - public ItemSchema build() { - return new ItemSchema(itemType, itemFormat, itemChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemStatus.java b/src/main/java/com/merge/api/resources/accounting/types/ItemStatus.java deleted file mode 100644 index e94f5d5a8..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ItemStatus.Deserializer.class) -public final class ItemStatus { - private final Object value; - - private final int type; - - private ItemStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((Status7D1Enum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ItemStatus && equalTo((ItemStatus) other); - } - - private boolean equalTo(ItemStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ItemStatus of(Status7D1Enum value) { - return new ItemStatus(value, 0); - } - - public static ItemStatus of(String value) { - return new ItemStatus(value, 1); - } - - public interface Visitor { - T visit(Status7D1Enum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ItemStatus.class); - } - - @java.lang.Override - public ItemStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status7D1Enum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ItemTypeEnum.java b/src/main/java/com/merge/api/resources/accounting/types/ItemTypeEnum.java deleted file mode 100644 index ea9327269..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ItemTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemTypeEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - ItemTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/JournalEntryCurrency.java deleted file mode 100644 index f3f6b6447..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = JournalEntryCurrency.Deserializer.class) -public final class JournalEntryCurrency { - private final Object value; - - private final int type; - - private JournalEntryCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JournalEntryCurrency && equalTo((JournalEntryCurrency) other); - } - - private boolean equalTo(JournalEntryCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static JournalEntryCurrency of(TransactionCurrencyEnum value) { - return new JournalEntryCurrency(value, 0); - } - - public static JournalEntryCurrency of(String value) { - return new JournalEntryCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(JournalEntryCurrency.class); - } - - @java.lang.Override - public JournalEntryCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryPostingStatus.java b/src/main/java/com/merge/api/resources/accounting/types/JournalEntryPostingStatus.java deleted file mode 100644 index 4c8376284..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryPostingStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = JournalEntryPostingStatus.Deserializer.class) -public final class JournalEntryPostingStatus { - private final Object value; - - private final int type; - - private JournalEntryPostingStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PostingStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JournalEntryPostingStatus && equalTo((JournalEntryPostingStatus) other); - } - - private boolean equalTo(JournalEntryPostingStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static JournalEntryPostingStatus of(PostingStatusEnum value) { - return new JournalEntryPostingStatus(value, 0); - } - - public static JournalEntryPostingStatus of(String value) { - return new JournalEntryPostingStatus(value, 1); - } - - public interface Visitor { - T visit(PostingStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(JournalEntryPostingStatus.class); - } - - @java.lang.Override - public JournalEntryPostingStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PostingStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestCurrency.java deleted file mode 100644 index eadb5c14d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = JournalEntryRequestCurrency.Deserializer.class) -public final class JournalEntryRequestCurrency { - private final Object value; - - private final int type; - - private JournalEntryRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JournalEntryRequestCurrency && equalTo((JournalEntryRequestCurrency) other); - } - - private boolean equalTo(JournalEntryRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static JournalEntryRequestCurrency of(TransactionCurrencyEnum value) { - return new JournalEntryRequestCurrency(value, 0); - } - - public static JournalEntryRequestCurrency of(String value) { - return new JournalEntryRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(JournalEntryRequestCurrency.class); - } - - @java.lang.Override - public JournalEntryRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestPostingStatus.java b/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestPostingStatus.java deleted file mode 100644 index bddad5bcd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalEntryRequestPostingStatus.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = JournalEntryRequestPostingStatus.Deserializer.class) -public final class JournalEntryRequestPostingStatus { - private final Object value; - - private final int type; - - private JournalEntryRequestPostingStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PostingStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JournalEntryRequestPostingStatus && equalTo((JournalEntryRequestPostingStatus) other); - } - - private boolean equalTo(JournalEntryRequestPostingStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static JournalEntryRequestPostingStatus of(PostingStatusEnum value) { - return new JournalEntryRequestPostingStatus(value, 0); - } - - public static JournalEntryRequestPostingStatus of(String value) { - return new JournalEntryRequestPostingStatus(value, 1); - } - - public interface Visitor { - T visit(PostingStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(JournalEntryRequestPostingStatus.class); - } - - @java.lang.Override - public JournalEntryRequestPostingStatus deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PostingStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalLineCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/JournalLineCurrency.java deleted file mode 100644 index 1e2b025c8..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalLineCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = JournalLineCurrency.Deserializer.class) -public final class JournalLineCurrency { - private final Object value; - - private final int type; - - private JournalLineCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JournalLineCurrency && equalTo((JournalLineCurrency) other); - } - - private boolean equalTo(JournalLineCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static JournalLineCurrency of(TransactionCurrencyEnum value) { - return new JournalLineCurrency(value, 0); - } - - public static JournalLineCurrency of(String value) { - return new JournalLineCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(JournalLineCurrency.class); - } - - @java.lang.Override - public JournalLineCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/JournalLineRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/JournalLineRequestCurrency.java deleted file mode 100644 index a01fd03d4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/JournalLineRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = JournalLineRequestCurrency.Deserializer.class) -public final class JournalLineRequestCurrency { - private final Object value; - - private final int type; - - private JournalLineRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JournalLineRequestCurrency && equalTo((JournalLineRequestCurrency) other); - } - - private boolean equalTo(JournalLineRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static JournalLineRequestCurrency of(TransactionCurrencyEnum value) { - return new JournalLineRequestCurrency(value, 0); - } - - public static JournalLineRequestCurrency of(String value) { - return new JournalLineRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(JournalLineRequestCurrency.class); - } - - @java.lang.Override - public JournalLineRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/LanguageEnum.java b/src/main/java/com/merge/api/resources/accounting/types/LanguageEnum.java deleted file mode 100644 index 3f567f246..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/LanguageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LanguageEnum { - EN("en"), - - DE("de"); - - private final String value; - - LanguageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/LinkToken.java b/src/main/java/com/merge/api/resources/accounting/types/LinkToken.java deleted file mode 100644 index 435eb572a..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/LinkToken.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkToken.Builder.class) -public final class LinkToken { - private final String linkToken; - - private final Optional integrationName; - - private final Optional magicLinkUrl; - - private final Map additionalProperties; - - private LinkToken( - String linkToken, - Optional integrationName, - Optional magicLinkUrl, - Map additionalProperties) { - this.linkToken = linkToken; - this.integrationName = integrationName; - this.magicLinkUrl = magicLinkUrl; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("link_token") - public String getLinkToken() { - return linkToken; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - @JsonProperty("magic_link_url") - public Optional getMagicLinkUrl() { - return magicLinkUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkToken && equalTo((LinkToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkToken other) { - return linkToken.equals(other.linkToken) - && integrationName.equals(other.integrationName) - && magicLinkUrl.equals(other.magicLinkUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkTokenStage builder() { - return new Builder(); - } - - public interface LinkTokenStage { - _FinalStage linkToken(@NotNull String linkToken); - - Builder from(LinkToken other); - } - - public interface _FinalStage { - LinkToken build(); - - _FinalStage integrationName(Optional integrationName); - - _FinalStage integrationName(String integrationName); - - _FinalStage magicLinkUrl(Optional magicLinkUrl); - - _FinalStage magicLinkUrl(String magicLinkUrl); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkTokenStage, _FinalStage { - private String linkToken; - - private Optional magicLinkUrl = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkToken other) { - linkToken(other.getLinkToken()); - integrationName(other.getIntegrationName()); - magicLinkUrl(other.getMagicLinkUrl()); - return this; - } - - @java.lang.Override - @JsonSetter("link_token") - public _FinalStage linkToken(@NotNull String linkToken) { - this.linkToken = linkToken; - return this; - } - - @java.lang.Override - public _FinalStage magicLinkUrl(String magicLinkUrl) { - this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) - public _FinalStage magicLinkUrl(Optional magicLinkUrl) { - this.magicLinkUrl = magicLinkUrl; - return this; - } - - @java.lang.Override - public _FinalStage integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public _FinalStage integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - @java.lang.Override - public LinkToken build() { - return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/resources/accounting/types/LinkedAccountStatus.java deleted file mode 100644 index a195bee17..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/LinkedAccountStatus.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) -public final class LinkedAccountStatus { - private final String linkedAccountStatus; - - private final boolean canMakeRequest; - - private final Map additionalProperties; - - private LinkedAccountStatus( - String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { - this.linkedAccountStatus = linkedAccountStatus; - this.canMakeRequest = canMakeRequest; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("linked_account_status") - public String getLinkedAccountStatus() { - return linkedAccountStatus; - } - - @JsonProperty("can_make_request") - public boolean getCanMakeRequest() { - return canMakeRequest; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountStatus other) { - return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkedAccountStatusStage builder() { - return new Builder(); - } - - public interface LinkedAccountStatusStage { - CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); - - Builder from(LinkedAccountStatus other); - } - - public interface CanMakeRequestStage { - _FinalStage canMakeRequest(boolean canMakeRequest); - } - - public interface _FinalStage { - LinkedAccountStatus build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { - private String linkedAccountStatus; - - private boolean canMakeRequest; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkedAccountStatus other) { - linkedAccountStatus(other.getLinkedAccountStatus()); - canMakeRequest(other.getCanMakeRequest()); - return this; - } - - @java.lang.Override - @JsonSetter("linked_account_status") - public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { - this.linkedAccountStatus = linkedAccountStatus; - return this; - } - - @java.lang.Override - @JsonSetter("can_make_request") - public _FinalStage canMakeRequest(boolean canMakeRequest) { - this.canMakeRequest = canMakeRequest; - return this; - } - - @java.lang.Override - public LinkedAccountStatus build() { - return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/MetaResponse.java b/src/main/java/com/merge/api/resources/accounting/types/MetaResponse.java deleted file mode 100644 index 9c93a961b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/MetaResponse.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MetaResponse.Builder.class) -public final class MetaResponse { - private final Map requestSchema; - - private final Optional> remoteFieldClasses; - - private final Optional status; - - private final boolean hasConditionalParams; - - private final boolean hasRequiredLinkedAccountParams; - - private final Map additionalProperties; - - private MetaResponse( - Map requestSchema, - Optional> remoteFieldClasses, - Optional status, - boolean hasConditionalParams, - boolean hasRequiredLinkedAccountParams, - Map additionalProperties) { - this.requestSchema = requestSchema; - this.remoteFieldClasses = remoteFieldClasses; - this.status = status; - this.hasConditionalParams = hasConditionalParams; - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("request_schema") - public Map getRequestSchema() { - return requestSchema; - } - - @JsonProperty("remote_field_classes") - public Optional> getRemoteFieldClasses() { - return remoteFieldClasses; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("has_conditional_params") - public boolean getHasConditionalParams() { - return hasConditionalParams; - } - - @JsonProperty("has_required_linked_account_params") - public boolean getHasRequiredLinkedAccountParams() { - return hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MetaResponse && equalTo((MetaResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MetaResponse other) { - return requestSchema.equals(other.requestSchema) - && remoteFieldClasses.equals(other.remoteFieldClasses) - && status.equals(other.status) - && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.requestSchema, - this.remoteFieldClasses, - this.status, - this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static HasConditionalParamsStage builder() { - return new Builder(); - } - - public interface HasConditionalParamsStage { - HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); - - Builder from(MetaResponse other); - } - - public interface HasRequiredLinkedAccountParamsStage { - _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); - } - - public interface _FinalStage { - MetaResponse build(); - - _FinalStage requestSchema(Map requestSchema); - - _FinalStage putAllRequestSchema(Map requestSchema); - - _FinalStage requestSchema(String key, JsonNode value); - - _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); - - _FinalStage remoteFieldClasses(Map remoteFieldClasses); - - _FinalStage status(Optional status); - - _FinalStage status(LinkedAccountStatus status); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { - private boolean hasConditionalParams; - - private boolean hasRequiredLinkedAccountParams; - - private Optional status = Optional.empty(); - - private Optional> remoteFieldClasses = Optional.empty(); - - private Map requestSchema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MetaResponse other) { - requestSchema(other.getRequestSchema()); - remoteFieldClasses(other.getRemoteFieldClasses()); - status(other.getStatus()); - hasConditionalParams(other.getHasConditionalParams()); - hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); - return this; - } - - @java.lang.Override - @JsonSetter("has_conditional_params") - public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { - this.hasConditionalParams = hasConditionalParams; - return this; - } - - @java.lang.Override - @JsonSetter("has_required_linked_account_params") - public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - return this; - } - - @java.lang.Override - public _FinalStage status(LinkedAccountStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { - this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) - public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { - this.remoteFieldClasses = remoteFieldClasses; - return this; - } - - @java.lang.Override - public _FinalStage requestSchema(String key, JsonNode value) { - this.requestSchema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllRequestSchema(Map requestSchema) { - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) - public _FinalStage requestSchema(Map requestSchema) { - this.requestSchema.clear(); - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - public MetaResponse build() { - return new MetaResponse( - requestSchema, - remoteFieldClasses, - status, - hasConditionalParams, - hasRequiredLinkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/MethodEnum.java b/src/main/java/com/merge/api/resources/accounting/types/MethodEnum.java deleted file mode 100644 index 8cb1872b1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/MethodEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum MethodEnum { - GET("GET"), - - OPTIONS("OPTIONS"), - - HEAD("HEAD"), - - POST("POST"), - - PUT("PUT"), - - PATCH("PATCH"), - - DELETE("DELETE"); - - private final String value; - - MethodEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ModelOperation.java b/src/main/java/com/merge/api/resources/accounting/types/ModelOperation.java deleted file mode 100644 index d9d3a6a36..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ModelOperation.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelOperation.Builder.class) -public final class ModelOperation { - private final String modelName; - - private final List availableOperations; - - private final List requiredPostParameters; - - private final List supportedFields; - - private final Map additionalProperties; - - private ModelOperation( - String modelName, - List availableOperations, - List requiredPostParameters, - List supportedFields, - Map additionalProperties) { - this.modelName = modelName; - this.availableOperations = availableOperations; - this.requiredPostParameters = requiredPostParameters; - this.supportedFields = supportedFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("available_operations") - public List getAvailableOperations() { - return availableOperations; - } - - @JsonProperty("required_post_parameters") - public List getRequiredPostParameters() { - return requiredPostParameters; - } - - @JsonProperty("supported_fields") - public List getSupportedFields() { - return supportedFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelOperation && equalTo((ModelOperation) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelOperation other) { - return modelName.equals(other.modelName) - && availableOperations.equals(other.availableOperations) - && requiredPostParameters.equals(other.requiredPostParameters) - && supportedFields.equals(other.supportedFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(ModelOperation other); - } - - public interface _FinalStage { - ModelOperation build(); - - _FinalStage availableOperations(List availableOperations); - - _FinalStage addAvailableOperations(String availableOperations); - - _FinalStage addAllAvailableOperations(List availableOperations); - - _FinalStage requiredPostParameters(List requiredPostParameters); - - _FinalStage addRequiredPostParameters(String requiredPostParameters); - - _FinalStage addAllRequiredPostParameters(List requiredPostParameters); - - _FinalStage supportedFields(List supportedFields); - - _FinalStage addSupportedFields(String supportedFields); - - _FinalStage addAllSupportedFields(List supportedFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private List supportedFields = new ArrayList<>(); - - private List requiredPostParameters = new ArrayList<>(); - - private List availableOperations = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ModelOperation other) { - modelName(other.getModelName()); - availableOperations(other.getAvailableOperations()); - requiredPostParameters(other.getRequiredPostParameters()); - supportedFields(other.getSupportedFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage addAllSupportedFields(List supportedFields) { - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addSupportedFields(String supportedFields) { - this.supportedFields.add(supportedFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) - public _FinalStage supportedFields(List supportedFields) { - this.supportedFields.clear(); - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addRequiredPostParameters(String requiredPostParameters) { - this.requiredPostParameters.add(requiredPostParameters); - return this; - } - - @java.lang.Override - @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) - public _FinalStage requiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.clear(); - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addAllAvailableOperations(List availableOperations) { - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public _FinalStage addAvailableOperations(String availableOperations) { - this.availableOperations.add(availableOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) - public _FinalStage availableOperations(List availableOperations) { - this.availableOperations.clear(); - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public ModelOperation build() { - return new ModelOperation( - modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/resources/accounting/types/ModelPermissionDeserializer.java deleted file mode 100644 index f4cde24c4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ModelPermissionDeserializer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) -public final class ModelPermissionDeserializer { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializer other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializer other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializer build() { - return new ModelPermissionDeserializer(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/accounting/types/ModelPermissionDeserializerRequest.java deleted file mode 100644 index b06e84942..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ModelPermissionDeserializerRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) -public final class ModelPermissionDeserializerRequest { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializerRequest - && equalTo((ModelPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializerRequest other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializerRequest other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializerRequest build() { - return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/resources/accounting/types/MultipartFormFieldRequest.java deleted file mode 100644 index 3d8afe414..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/MultipartFormFieldRequest.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) -public final class MultipartFormFieldRequest { - private final String name; - - private final String data; - - private final Optional encoding; - - private final Optional fileName; - - private final Optional contentType; - - private final Map additionalProperties; - - private MultipartFormFieldRequest( - String name, - String data, - Optional encoding, - Optional fileName, - Optional contentType, - Map additionalProperties) { - this.name = name; - this.data = data; - this.encoding = encoding; - this.fileName = fileName; - this.contentType = contentType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the form field - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The data for the form field. - */ - @JsonProperty("data") - public String getData() { - return data; - } - - /** - * @return The encoding of the value of data. Defaults to RAW if not defined. - *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- */ - @JsonProperty("encoding") - public Optional getEncoding() { - return encoding; - } - - /** - * @return The file name of the form field, if the field is for a file. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The MIME type of the file, if the field is for a file. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MultipartFormFieldRequest other) { - return name.equals(other.name) - && data.equals(other.data) - && encoding.equals(other.encoding) - && fileName.equals(other.fileName) - && contentType.equals(other.contentType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DataStage name(@NotNull String name); - - Builder from(MultipartFormFieldRequest other); - } - - public interface DataStage { - _FinalStage data(@NotNull String data); - } - - public interface _FinalStage { - MultipartFormFieldRequest build(); - - _FinalStage encoding(Optional encoding); - - _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); - - _FinalStage fileName(Optional fileName); - - _FinalStage fileName(String fileName); - - _FinalStage contentType(Optional contentType); - - _FinalStage contentType(String contentType); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DataStage, _FinalStage { - private String name; - - private String data; - - private Optional contentType = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional encoding = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MultipartFormFieldRequest other) { - name(other.getName()); - data(other.getData()); - encoding(other.getEncoding()); - fileName(other.getFileName()); - contentType(other.getContentType()); - return this; - } - - /** - *

The name of the form field

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public DataStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

The data for the form field.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull String data) { - this.data = data; - return this; - } - - /** - *

The MIME type of the file, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public _FinalStage contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - /** - *

The file name of the form field, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public _FinalStage fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - /** - *

The encoding of the value of data. Defaults to RAW if not defined.

- *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { - this.encoding = Optional.ofNullable(encoding); - return this; - } - - @java.lang.Override - @JsonSetter(value = "encoding", nulls = Nulls.SKIP) - public _FinalStage encoding(Optional encoding) { - this.encoding = encoding; - return this; - } - - @java.lang.Override - public MultipartFormFieldRequest build() { - return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/resources/accounting/types/MultipartFormFieldRequestEncoding.java deleted file mode 100644 index ed2dbaa06..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/MultipartFormFieldRequestEncoding.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) -public final class MultipartFormFieldRequestEncoding { - private final Object value; - - private final int type; - - private MultipartFormFieldRequestEncoding(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EncodingEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); - } - - private boolean equalTo(MultipartFormFieldRequestEncoding other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { - return new MultipartFormFieldRequestEncoding(value, 0); - } - - public static MultipartFormFieldRequestEncoding of(String value) { - return new MultipartFormFieldRequestEncoding(value, 1); - } - - public interface Visitor { - T visit(EncodingEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MultipartFormFieldRequestEncoding.class); - } - - @java.lang.Override - public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountDetailsAndActionsList.java deleted file mode 100644 index 4673137bf..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountDetailsAndActionsList.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) -public final class PaginatedAccountDetailsAndActionsList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountDetailsAndActionsList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountDetailsAndActionsList - && equalTo((PaginatedAccountDetailsAndActionsList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountDetailsAndActionsList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountDetailsAndActionsList build() { - return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountList.java deleted file mode 100644 index a40e25c77..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAccountList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountList.Builder.class) -public final class PaginatedAccountList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountList && equalTo((PaginatedAccountList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountList build() { - return new PaginatedAccountList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedAuditLogEventList.java deleted file mode 100644 index c253317ec..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedAuditLogEventList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) -public final class PaginatedAuditLogEventList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAuditLogEventList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAuditLogEventList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAuditLogEventList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAuditLogEventList build() { - return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedContactList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedContactList.java deleted file mode 100644 index a5334d7f5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedContactList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedContactList.Builder.class) -public final class PaginatedContactList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedContactList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedContactList && equalTo((PaginatedContactList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedContactList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedContactList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedContactList build() { - return new PaginatedContactList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedEmployeeList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedEmployeeList.java deleted file mode 100644 index 02bed49f9..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedEmployeeList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedEmployeeList.Builder.class) -public final class PaginatedEmployeeList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedEmployeeList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedEmployeeList && equalTo((PaginatedEmployeeList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedEmployeeList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedEmployeeList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedEmployeeList build() { - return new PaginatedEmployeeList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedIssueList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedIssueList.java deleted file mode 100644 index 23b4bc584..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedIssueList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedIssueList.Builder.class) -public final class PaginatedIssueList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedIssueList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedIssueList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedIssueList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedIssueList build() { - return new PaginatedIssueList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedRemoteFieldClassList.java deleted file mode 100644 index 92b6d9936..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedRemoteFieldClassList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedRemoteFieldClassList.Builder.class) -public final class PaginatedRemoteFieldClassList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedRemoteFieldClassList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedRemoteFieldClassList && equalTo((PaginatedRemoteFieldClassList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedRemoteFieldClassList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedRemoteFieldClassList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedRemoteFieldClassList build() { - return new PaginatedRemoteFieldClassList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/resources/accounting/types/PaginatedSyncStatusList.java deleted file mode 100644 index 9e4aaa526..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaginatedSyncStatusList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) -public final class PaginatedSyncStatusList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedSyncStatusList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedSyncStatusList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedSyncStatusList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedSyncStatusList build() { - return new PaginatedSyncStatusList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestCurrency.java deleted file mode 100644 index ef4df6118..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PatchedPaymentRequestCurrency.Deserializer.class) -public final class PatchedPaymentRequestCurrency { - private final Object value; - - private final int type; - - private PatchedPaymentRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedPaymentRequestCurrency && equalTo((PatchedPaymentRequestCurrency) other); - } - - private boolean equalTo(PatchedPaymentRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PatchedPaymentRequestCurrency of(TransactionCurrencyEnum value) { - return new PatchedPaymentRequestCurrency(value, 0); - } - - public static PatchedPaymentRequestCurrency of(String value) { - return new PatchedPaymentRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PatchedPaymentRequestCurrency.class); - } - - @java.lang.Override - public PatchedPaymentRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestType.java b/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestType.java deleted file mode 100644 index e0c747f13..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PatchedPaymentRequestType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PatchedPaymentRequestType.Deserializer.class) -public final class PatchedPaymentRequestType { - private final Object value; - - private final int type; - - private PatchedPaymentRequestType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PaymentTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedPaymentRequestType && equalTo((PatchedPaymentRequestType) other); - } - - private boolean equalTo(PatchedPaymentRequestType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PatchedPaymentRequestType of(PaymentTypeEnum value) { - return new PatchedPaymentRequestType(value, 0); - } - - public static PatchedPaymentRequestType of(String value) { - return new PatchedPaymentRequestType(value, 1); - } - - public interface Visitor { - T visit(PaymentTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PatchedPaymentRequestType.class); - } - - @java.lang.Override - public PatchedPaymentRequestType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/PaymentCurrency.java deleted file mode 100644 index 7b27616f3..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PaymentCurrency.Deserializer.class) -public final class PaymentCurrency { - private final Object value; - - private final int type; - - private PaymentCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaymentCurrency && equalTo((PaymentCurrency) other); - } - - private boolean equalTo(PaymentCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PaymentCurrency of(TransactionCurrencyEnum value) { - return new PaymentCurrency(value, 0); - } - - public static PaymentCurrency of(String value) { - return new PaymentCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PaymentCurrency.class); - } - - @java.lang.Override - public PaymentCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestCurrency.java deleted file mode 100644 index 285c0b69c..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PaymentRequestCurrency.Deserializer.class) -public final class PaymentRequestCurrency { - private final Object value; - - private final int type; - - private PaymentRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaymentRequestCurrency && equalTo((PaymentRequestCurrency) other); - } - - private boolean equalTo(PaymentRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PaymentRequestCurrency of(TransactionCurrencyEnum value) { - return new PaymentRequestCurrency(value, 0); - } - - public static PaymentRequestCurrency of(String value) { - return new PaymentRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PaymentRequestCurrency.class); - } - - @java.lang.Override - public PaymentRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestType.java b/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestType.java deleted file mode 100644 index e75d365e8..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentRequestType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PaymentRequestType.Deserializer.class) -public final class PaymentRequestType { - private final Object value; - - private final int type; - - private PaymentRequestType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PaymentTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaymentRequestType && equalTo((PaymentRequestType) other); - } - - private boolean equalTo(PaymentRequestType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PaymentRequestType of(PaymentTypeEnum value) { - return new PaymentRequestType(value, 0); - } - - public static PaymentRequestType of(String value) { - return new PaymentRequestType(value, 1); - } - - public interface Visitor { - T visit(PaymentTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PaymentRequestType.class); - } - - @java.lang.Override - public PaymentRequestType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PaymentType.java b/src/main/java/com/merge/api/resources/accounting/types/PaymentType.java deleted file mode 100644 index ae5ede01d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PaymentType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PaymentType.Deserializer.class) -public final class PaymentType { - private final Object value; - - private final int type; - - private PaymentType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PaymentTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaymentType && equalTo((PaymentType) other); - } - - private boolean equalTo(PaymentType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PaymentType of(PaymentTypeEnum value) { - return new PaymentType(value, 0); - } - - public static PaymentType of(String value) { - return new PaymentType(value, 1); - } - - public interface Visitor { - T visit(PaymentTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PaymentType.class); - } - - @java.lang.Override - public PaymentType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderCurrency.java deleted file mode 100644 index 86e23c616..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PurchaseOrderCurrency.Deserializer.class) -public final class PurchaseOrderCurrency { - private final Object value; - - private final int type; - - private PurchaseOrderCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PurchaseOrderCurrency && equalTo((PurchaseOrderCurrency) other); - } - - private boolean equalTo(PurchaseOrderCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PurchaseOrderCurrency of(TransactionCurrencyEnum value) { - return new PurchaseOrderCurrency(value, 0); - } - - public static PurchaseOrderCurrency of(String value) { - return new PurchaseOrderCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PurchaseOrderCurrency.class); - } - - @java.lang.Override - public PurchaseOrderCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemCurrency.java deleted file mode 100644 index d106d7b61..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PurchaseOrderLineItemCurrency.Deserializer.class) -public final class PurchaseOrderLineItemCurrency { - private final Object value; - - private final int type; - - private PurchaseOrderLineItemCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PurchaseOrderLineItemCurrency && equalTo((PurchaseOrderLineItemCurrency) other); - } - - private boolean equalTo(PurchaseOrderLineItemCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PurchaseOrderLineItemCurrency of(TransactionCurrencyEnum value) { - return new PurchaseOrderLineItemCurrency(value, 0); - } - - public static PurchaseOrderLineItemCurrency of(String value) { - return new PurchaseOrderLineItemCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PurchaseOrderLineItemCurrency.class); - } - - @java.lang.Override - public PurchaseOrderLineItemCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemRequestCurrency.java deleted file mode 100644 index 349fd39cb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderLineItemRequestCurrency.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PurchaseOrderLineItemRequestCurrency.Deserializer.class) -public final class PurchaseOrderLineItemRequestCurrency { - private final Object value; - - private final int type; - - private PurchaseOrderLineItemRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PurchaseOrderLineItemRequestCurrency - && equalTo((PurchaseOrderLineItemRequestCurrency) other); - } - - private boolean equalTo(PurchaseOrderLineItemRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PurchaseOrderLineItemRequestCurrency of(TransactionCurrencyEnum value) { - return new PurchaseOrderLineItemRequestCurrency(value, 0); - } - - public static PurchaseOrderLineItemRequestCurrency of(String value) { - return new PurchaseOrderLineItemRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PurchaseOrderLineItemRequestCurrency.class); - } - - @java.lang.Override - public PurchaseOrderLineItemRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestCurrency.java deleted file mode 100644 index 226c2f9e3..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PurchaseOrderRequestCurrency.Deserializer.class) -public final class PurchaseOrderRequestCurrency { - private final Object value; - - private final int type; - - private PurchaseOrderRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PurchaseOrderRequestCurrency && equalTo((PurchaseOrderRequestCurrency) other); - } - - private boolean equalTo(PurchaseOrderRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PurchaseOrderRequestCurrency of(TransactionCurrencyEnum value) { - return new PurchaseOrderRequestCurrency(value, 0); - } - - public static PurchaseOrderRequestCurrency of(String value) { - return new PurchaseOrderRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PurchaseOrderRequestCurrency.class); - } - - @java.lang.Override - public PurchaseOrderRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestStatus.java b/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestStatus.java deleted file mode 100644 index 30c494932..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PurchaseOrderRequestStatus.Deserializer.class) -public final class PurchaseOrderRequestStatus { - private final Object value; - - private final int type; - - private PurchaseOrderRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PurchaseOrderStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PurchaseOrderRequestStatus && equalTo((PurchaseOrderRequestStatus) other); - } - - private boolean equalTo(PurchaseOrderRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PurchaseOrderRequestStatus of(PurchaseOrderStatusEnum value) { - return new PurchaseOrderRequestStatus(value, 0); - } - - public static PurchaseOrderRequestStatus of(String value) { - return new PurchaseOrderRequestStatus(value, 1); - } - - public interface Visitor { - T visit(PurchaseOrderStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PurchaseOrderRequestStatus.class); - } - - @java.lang.Override - public PurchaseOrderRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PurchaseOrderStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderStatus.java b/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderStatus.java deleted file mode 100644 index fdd52ad6b..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/PurchaseOrderStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PurchaseOrderStatus.Deserializer.class) -public final class PurchaseOrderStatus { - private final Object value; - - private final int type; - - private PurchaseOrderStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PurchaseOrderStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PurchaseOrderStatus && equalTo((PurchaseOrderStatus) other); - } - - private boolean equalTo(PurchaseOrderStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PurchaseOrderStatus of(PurchaseOrderStatusEnum value) { - return new PurchaseOrderStatus(value, 0); - } - - public static PurchaseOrderStatus of(String value) { - return new PurchaseOrderStatus(value, 1); - } - - public interface Visitor { - T visit(PurchaseOrderStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PurchaseOrderStatus.class); - } - - @java.lang.Override - public PurchaseOrderStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PurchaseOrderStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteData.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteData.java deleted file mode 100644 index cea015def..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteData.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteData.Builder.class) -public final class RemoteData { - private final String path; - - private final Optional data; - - private final Map additionalProperties; - - private RemoteData(String path, Optional data, Map additionalProperties) { - this.path = path; - this.data = data; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API path that is being called. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("data") - public Optional getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteData && equalTo((RemoteData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteData other) { - return path.equals(other.path) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.path, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PathStage builder() { - return new Builder(); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - - Builder from(RemoteData other); - } - - public interface _FinalStage { - RemoteData build(); - - _FinalStage data(Optional data); - - _FinalStage data(JsonNode data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PathStage, _FinalStage { - private String path; - - private Optional data = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteData other) { - path(other.getPath()); - data(other.getData()); - return this; - } - - /** - *

The third-party API path that is being called.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - public _FinalStage data(JsonNode data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - @java.lang.Override - public RemoteData build() { - return new RemoteData(path, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteEndpointInfo.java deleted file mode 100644 index d74da50c4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteEndpointInfo.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) -public final class RemoteEndpointInfo { - private final String method; - - private final String urlPath; - - private final List fieldTraversalPath; - - private final Map additionalProperties; - - private RemoteEndpointInfo( - String method, - String urlPath, - List fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("url_path") - public String getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public List getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - UrlPathStage method(@NotNull String method); - - Builder from(RemoteEndpointInfo other); - } - - public interface UrlPathStage { - _FinalStage urlPath(@NotNull String urlPath); - } - - public interface _FinalStage { - RemoteEndpointInfo build(); - - _FinalStage fieldTraversalPath(List fieldTraversalPath); - - _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); - - _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { - private String method; - - private String urlPath; - - private List fieldTraversalPath = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public UrlPathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("url_path") - public _FinalStage urlPath(@NotNull String urlPath) { - this.urlPath = urlPath; - return this; - } - - @java.lang.Override - public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { - this.fieldTraversalPath.add(fieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.clear(); - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public RemoteEndpointInfo build() { - return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteField.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteField.java deleted file mode 100644 index eb532fd60..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteField.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteField.Builder.class) -public final class RemoteField { - private final RemoteFieldClass remoteFieldClass; - - private final Optional> value; - - private final Map additionalProperties; - - private RemoteField( - RemoteFieldClass remoteFieldClass, - Optional> value, - Map additionalProperties) { - this.remoteFieldClass = remoteFieldClass; - this.value = value; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_field_class") - public RemoteFieldClass getRemoteFieldClass() { - return remoteFieldClass; - } - - @JsonProperty("value") - public Optional> getValue() { - return value; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteField && equalTo((RemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteField other) { - return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldClass, this.value); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteFieldClassStage builder() { - return new Builder(); - } - - public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldClass remoteFieldClass); - - Builder from(RemoteField other); - } - - public interface _FinalStage { - RemoteField build(); - - _FinalStage value(Optional> value); - - _FinalStage value(Map value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldClass remoteFieldClass; - - private Optional> value = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteField other) { - remoteFieldClass(other.getRemoteFieldClass()); - value(other.getValue()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldClass remoteFieldClass) { - this.remoteFieldClass = remoteFieldClass; - return this; - } - - @java.lang.Override - public _FinalStage value(Map value) { - this.value = Optional.ofNullable(value); - return this; - } - - @java.lang.Override - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public _FinalStage value(Optional> value) { - this.value = value; - return this; - } - - @java.lang.Override - public RemoteField build() { - return new RemoteField(remoteFieldClass, value, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApi.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApi.java deleted file mode 100644 index cae2d9ed6..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApi.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApi.Builder.class) -public final class RemoteFieldApi { - private final Map schema; - - private final String remoteKeyName; - - private final RemoteEndpointInfo remoteEndpointInfo; - - private final Optional> exampleValues; - - private final Optional advancedMetadata; - - private final Optional coverage; - - private final Map additionalProperties; - - private RemoteFieldApi( - Map schema, - String remoteKeyName, - RemoteEndpointInfo remoteEndpointInfo, - Optional> exampleValues, - Optional advancedMetadata, - Optional coverage, - Map additionalProperties) { - this.schema = schema; - this.remoteKeyName = remoteKeyName; - this.remoteEndpointInfo = remoteEndpointInfo; - this.exampleValues = exampleValues; - this.advancedMetadata = advancedMetadata; - this.coverage = coverage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("schema") - public Map getSchema() { - return schema; - } - - @JsonProperty("remote_key_name") - public String getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("remote_endpoint_info") - public RemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @JsonProperty("example_values") - public Optional> getExampleValues() { - return exampleValues; - } - - @JsonProperty("advanced_metadata") - public Optional getAdvancedMetadata() { - return advancedMetadata; - } - - @JsonProperty("coverage") - public Optional getCoverage() { - return coverage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApi other) { - return schema.equals(other.schema) - && remoteKeyName.equals(other.remoteKeyName) - && remoteEndpointInfo.equals(other.remoteEndpointInfo) - && exampleValues.equals(other.exampleValues) - && advancedMetadata.equals(other.advancedMetadata) - && coverage.equals(other.coverage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.schema, - this.remoteKeyName, - this.remoteEndpointInfo, - this.exampleValues, - this.advancedMetadata, - this.coverage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteKeyNameStage builder() { - return new Builder(); - } - - public interface RemoteKeyNameStage { - RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); - - Builder from(RemoteFieldApi other); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); - } - - public interface _FinalStage { - RemoteFieldApi build(); - - _FinalStage schema(Map schema); - - _FinalStage putAllSchema(Map schema); - - _FinalStage schema(String key, JsonNode value); - - _FinalStage exampleValues(Optional> exampleValues); - - _FinalStage exampleValues(List exampleValues); - - _FinalStage advancedMetadata(Optional advancedMetadata); - - _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); - - _FinalStage coverage(Optional coverage); - - _FinalStage coverage(RemoteFieldApiCoverage coverage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { - private String remoteKeyName; - - private RemoteEndpointInfo remoteEndpointInfo; - - private Optional coverage = Optional.empty(); - - private Optional advancedMetadata = Optional.empty(); - - private Optional> exampleValues = Optional.empty(); - - private Map schema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldApi other) { - schema(other.getSchema()); - remoteKeyName(other.getRemoteKeyName()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - exampleValues(other.getExampleValues()); - advancedMetadata(other.getAdvancedMetadata()); - coverage(other.getCoverage()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_key_name") - public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage coverage(RemoteFieldApiCoverage coverage) { - this.coverage = Optional.ofNullable(coverage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "coverage", nulls = Nulls.SKIP) - public _FinalStage coverage(Optional coverage) { - this.coverage = coverage; - return this; - } - - @java.lang.Override - public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { - this.advancedMetadata = Optional.ofNullable(advancedMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) - public _FinalStage advancedMetadata(Optional advancedMetadata) { - this.advancedMetadata = advancedMetadata; - return this; - } - - @java.lang.Override - public _FinalStage exampleValues(List exampleValues) { - this.exampleValues = Optional.ofNullable(exampleValues); - return this; - } - - @java.lang.Override - @JsonSetter(value = "example_values", nulls = Nulls.SKIP) - public _FinalStage exampleValues(Optional> exampleValues) { - this.exampleValues = exampleValues; - return this; - } - - @java.lang.Override - public _FinalStage schema(String key, JsonNode value) { - this.schema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllSchema(Map schema) { - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Map schema) { - this.schema.clear(); - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - public RemoteFieldApi build() { - return new RemoteFieldApi( - schema, - remoteKeyName, - remoteEndpointInfo, - exampleValues, - advancedMetadata, - coverage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApiCoverage.java deleted file mode 100644 index f00aa6838..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApiCoverage.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) -public final class RemoteFieldApiCoverage { - private final Object value; - - private final int type; - - private RemoteFieldApiCoverage(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((int) this.value); - } else if (this.type == 1) { - return visitor.visit((double) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); - } - - private boolean equalTo(RemoteFieldApiCoverage other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldApiCoverage of(int value) { - return new RemoteFieldApiCoverage(value, 0); - } - - public static RemoteFieldApiCoverage of(double value) { - return new RemoteFieldApiCoverage(value, 1); - } - - public interface Visitor { - T visit(int value); - - T visit(double value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldApiCoverage.class); - } - - @java.lang.Override - public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - if (value instanceof Integer) { - return of((Integer) value); - } - if (value instanceof Double) { - return of((Double) value); - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApiResponse.java deleted file mode 100644 index 9cab949ae..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldApiResponse.java +++ /dev/null @@ -1,647 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) -public final class RemoteFieldApiResponse { - private final Optional> account; - - private final Optional> accountingAttachment; - - private final Optional> balanceSheet; - - private final Optional> cashFlowStatement; - - private final Optional> companyInfo; - - private final Optional> contact; - - private final Optional> incomeStatement; - - private final Optional> creditNote; - - private final Optional> item; - - private final Optional> purchaseOrder; - - private final Optional> trackingCategory; - - private final Optional> journalEntry; - - private final Optional> taxRate; - - private final Optional> invoice; - - private final Optional> payment; - - private final Optional> expense; - - private final Optional> vendorCredit; - - private final Optional> transaction; - - private final Optional> accountingPeriod; - - private final Optional> generalLedgerTransaction; - - private final Optional> bankFeedAccount; - - private final Optional> employee; - - private final Map additionalProperties; - - private RemoteFieldApiResponse( - Optional> account, - Optional> accountingAttachment, - Optional> balanceSheet, - Optional> cashFlowStatement, - Optional> companyInfo, - Optional> contact, - Optional> incomeStatement, - Optional> creditNote, - Optional> item, - Optional> purchaseOrder, - Optional> trackingCategory, - Optional> journalEntry, - Optional> taxRate, - Optional> invoice, - Optional> payment, - Optional> expense, - Optional> vendorCredit, - Optional> transaction, - Optional> accountingPeriod, - Optional> generalLedgerTransaction, - Optional> bankFeedAccount, - Optional> employee, - Map additionalProperties) { - this.account = account; - this.accountingAttachment = accountingAttachment; - this.balanceSheet = balanceSheet; - this.cashFlowStatement = cashFlowStatement; - this.companyInfo = companyInfo; - this.contact = contact; - this.incomeStatement = incomeStatement; - this.creditNote = creditNote; - this.item = item; - this.purchaseOrder = purchaseOrder; - this.trackingCategory = trackingCategory; - this.journalEntry = journalEntry; - this.taxRate = taxRate; - this.invoice = invoice; - this.payment = payment; - this.expense = expense; - this.vendorCredit = vendorCredit; - this.transaction = transaction; - this.accountingPeriod = accountingPeriod; - this.generalLedgerTransaction = generalLedgerTransaction; - this.bankFeedAccount = bankFeedAccount; - this.employee = employee; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("AccountingAttachment") - public Optional> getAccountingAttachment() { - return accountingAttachment; - } - - @JsonProperty("BalanceSheet") - public Optional> getBalanceSheet() { - return balanceSheet; - } - - @JsonProperty("CashFlowStatement") - public Optional> getCashFlowStatement() { - return cashFlowStatement; - } - - @JsonProperty("CompanyInfo") - public Optional> getCompanyInfo() { - return companyInfo; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @JsonProperty("IncomeStatement") - public Optional> getIncomeStatement() { - return incomeStatement; - } - - @JsonProperty("CreditNote") - public Optional> getCreditNote() { - return creditNote; - } - - @JsonProperty("Item") - public Optional> getItem() { - return item; - } - - @JsonProperty("PurchaseOrder") - public Optional> getPurchaseOrder() { - return purchaseOrder; - } - - @JsonProperty("TrackingCategory") - public Optional> getTrackingCategory() { - return trackingCategory; - } - - @JsonProperty("JournalEntry") - public Optional> getJournalEntry() { - return journalEntry; - } - - @JsonProperty("TaxRate") - public Optional> getTaxRate() { - return taxRate; - } - - @JsonProperty("Invoice") - public Optional> getInvoice() { - return invoice; - } - - @JsonProperty("Payment") - public Optional> getPayment() { - return payment; - } - - @JsonProperty("Expense") - public Optional> getExpense() { - return expense; - } - - @JsonProperty("VendorCredit") - public Optional> getVendorCredit() { - return vendorCredit; - } - - @JsonProperty("Transaction") - public Optional> getTransaction() { - return transaction; - } - - @JsonProperty("AccountingPeriod") - public Optional> getAccountingPeriod() { - return accountingPeriod; - } - - @JsonProperty("GeneralLedgerTransaction") - public Optional> getGeneralLedgerTransaction() { - return generalLedgerTransaction; - } - - @JsonProperty("BankFeedAccount") - public Optional> getBankFeedAccount() { - return bankFeedAccount; - } - - @JsonProperty("Employee") - public Optional> getEmployee() { - return employee; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApiResponse other) { - return account.equals(other.account) - && accountingAttachment.equals(other.accountingAttachment) - && balanceSheet.equals(other.balanceSheet) - && cashFlowStatement.equals(other.cashFlowStatement) - && companyInfo.equals(other.companyInfo) - && contact.equals(other.contact) - && incomeStatement.equals(other.incomeStatement) - && creditNote.equals(other.creditNote) - && item.equals(other.item) - && purchaseOrder.equals(other.purchaseOrder) - && trackingCategory.equals(other.trackingCategory) - && journalEntry.equals(other.journalEntry) - && taxRate.equals(other.taxRate) - && invoice.equals(other.invoice) - && payment.equals(other.payment) - && expense.equals(other.expense) - && vendorCredit.equals(other.vendorCredit) - && transaction.equals(other.transaction) - && accountingPeriod.equals(other.accountingPeriod) - && generalLedgerTransaction.equals(other.generalLedgerTransaction) - && bankFeedAccount.equals(other.bankFeedAccount) - && employee.equals(other.employee); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.account, - this.accountingAttachment, - this.balanceSheet, - this.cashFlowStatement, - this.companyInfo, - this.contact, - this.incomeStatement, - this.creditNote, - this.item, - this.purchaseOrder, - this.trackingCategory, - this.journalEntry, - this.taxRate, - this.invoice, - this.payment, - this.expense, - this.vendorCredit, - this.transaction, - this.accountingPeriod, - this.generalLedgerTransaction, - this.bankFeedAccount, - this.employee); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> account = Optional.empty(); - - private Optional> accountingAttachment = Optional.empty(); - - private Optional> balanceSheet = Optional.empty(); - - private Optional> cashFlowStatement = Optional.empty(); - - private Optional> companyInfo = Optional.empty(); - - private Optional> contact = Optional.empty(); - - private Optional> incomeStatement = Optional.empty(); - - private Optional> creditNote = Optional.empty(); - - private Optional> item = Optional.empty(); - - private Optional> purchaseOrder = Optional.empty(); - - private Optional> trackingCategory = Optional.empty(); - - private Optional> journalEntry = Optional.empty(); - - private Optional> taxRate = Optional.empty(); - - private Optional> invoice = Optional.empty(); - - private Optional> payment = Optional.empty(); - - private Optional> expense = Optional.empty(); - - private Optional> vendorCredit = Optional.empty(); - - private Optional> transaction = Optional.empty(); - - private Optional> accountingPeriod = Optional.empty(); - - private Optional> generalLedgerTransaction = Optional.empty(); - - private Optional> bankFeedAccount = Optional.empty(); - - private Optional> employee = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldApiResponse other) { - account(other.getAccount()); - accountingAttachment(other.getAccountingAttachment()); - balanceSheet(other.getBalanceSheet()); - cashFlowStatement(other.getCashFlowStatement()); - companyInfo(other.getCompanyInfo()); - contact(other.getContact()); - incomeStatement(other.getIncomeStatement()); - creditNote(other.getCreditNote()); - item(other.getItem()); - purchaseOrder(other.getPurchaseOrder()); - trackingCategory(other.getTrackingCategory()); - journalEntry(other.getJournalEntry()); - taxRate(other.getTaxRate()); - invoice(other.getInvoice()); - payment(other.getPayment()); - expense(other.getExpense()); - vendorCredit(other.getVendorCredit()); - transaction(other.getTransaction()); - accountingPeriod(other.getAccountingPeriod()); - generalLedgerTransaction(other.getGeneralLedgerTransaction()); - bankFeedAccount(other.getBankFeedAccount()); - employee(other.getEmployee()); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "AccountingAttachment", nulls = Nulls.SKIP) - public Builder accountingAttachment(Optional> accountingAttachment) { - this.accountingAttachment = accountingAttachment; - return this; - } - - public Builder accountingAttachment(List accountingAttachment) { - this.accountingAttachment = Optional.ofNullable(accountingAttachment); - return this; - } - - @JsonSetter(value = "BalanceSheet", nulls = Nulls.SKIP) - public Builder balanceSheet(Optional> balanceSheet) { - this.balanceSheet = balanceSheet; - return this; - } - - public Builder balanceSheet(List balanceSheet) { - this.balanceSheet = Optional.ofNullable(balanceSheet); - return this; - } - - @JsonSetter(value = "CashFlowStatement", nulls = Nulls.SKIP) - public Builder cashFlowStatement(Optional> cashFlowStatement) { - this.cashFlowStatement = cashFlowStatement; - return this; - } - - public Builder cashFlowStatement(List cashFlowStatement) { - this.cashFlowStatement = Optional.ofNullable(cashFlowStatement); - return this; - } - - @JsonSetter(value = "CompanyInfo", nulls = Nulls.SKIP) - public Builder companyInfo(Optional> companyInfo) { - this.companyInfo = companyInfo; - return this; - } - - public Builder companyInfo(List companyInfo) { - this.companyInfo = Optional.ofNullable(companyInfo); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - @JsonSetter(value = "IncomeStatement", nulls = Nulls.SKIP) - public Builder incomeStatement(Optional> incomeStatement) { - this.incomeStatement = incomeStatement; - return this; - } - - public Builder incomeStatement(List incomeStatement) { - this.incomeStatement = Optional.ofNullable(incomeStatement); - return this; - } - - @JsonSetter(value = "CreditNote", nulls = Nulls.SKIP) - public Builder creditNote(Optional> creditNote) { - this.creditNote = creditNote; - return this; - } - - public Builder creditNote(List creditNote) { - this.creditNote = Optional.ofNullable(creditNote); - return this; - } - - @JsonSetter(value = "Item", nulls = Nulls.SKIP) - public Builder item(Optional> item) { - this.item = item; - return this; - } - - public Builder item(List item) { - this.item = Optional.ofNullable(item); - return this; - } - - @JsonSetter(value = "PurchaseOrder", nulls = Nulls.SKIP) - public Builder purchaseOrder(Optional> purchaseOrder) { - this.purchaseOrder = purchaseOrder; - return this; - } - - public Builder purchaseOrder(List purchaseOrder) { - this.purchaseOrder = Optional.ofNullable(purchaseOrder); - return this; - } - - @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) - public Builder trackingCategory(Optional> trackingCategory) { - this.trackingCategory = trackingCategory; - return this; - } - - public Builder trackingCategory(List trackingCategory) { - this.trackingCategory = Optional.ofNullable(trackingCategory); - return this; - } - - @JsonSetter(value = "JournalEntry", nulls = Nulls.SKIP) - public Builder journalEntry(Optional> journalEntry) { - this.journalEntry = journalEntry; - return this; - } - - public Builder journalEntry(List journalEntry) { - this.journalEntry = Optional.ofNullable(journalEntry); - return this; - } - - @JsonSetter(value = "TaxRate", nulls = Nulls.SKIP) - public Builder taxRate(Optional> taxRate) { - this.taxRate = taxRate; - return this; - } - - public Builder taxRate(List taxRate) { - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - @JsonSetter(value = "Invoice", nulls = Nulls.SKIP) - public Builder invoice(Optional> invoice) { - this.invoice = invoice; - return this; - } - - public Builder invoice(List invoice) { - this.invoice = Optional.ofNullable(invoice); - return this; - } - - @JsonSetter(value = "Payment", nulls = Nulls.SKIP) - public Builder payment(Optional> payment) { - this.payment = payment; - return this; - } - - public Builder payment(List payment) { - this.payment = Optional.ofNullable(payment); - return this; - } - - @JsonSetter(value = "Expense", nulls = Nulls.SKIP) - public Builder expense(Optional> expense) { - this.expense = expense; - return this; - } - - public Builder expense(List expense) { - this.expense = Optional.ofNullable(expense); - return this; - } - - @JsonSetter(value = "VendorCredit", nulls = Nulls.SKIP) - public Builder vendorCredit(Optional> vendorCredit) { - this.vendorCredit = vendorCredit; - return this; - } - - public Builder vendorCredit(List vendorCredit) { - this.vendorCredit = Optional.ofNullable(vendorCredit); - return this; - } - - @JsonSetter(value = "Transaction", nulls = Nulls.SKIP) - public Builder transaction(Optional> transaction) { - this.transaction = transaction; - return this; - } - - public Builder transaction(List transaction) { - this.transaction = Optional.ofNullable(transaction); - return this; - } - - @JsonSetter(value = "AccountingPeriod", nulls = Nulls.SKIP) - public Builder accountingPeriod(Optional> accountingPeriod) { - this.accountingPeriod = accountingPeriod; - return this; - } - - public Builder accountingPeriod(List accountingPeriod) { - this.accountingPeriod = Optional.ofNullable(accountingPeriod); - return this; - } - - @JsonSetter(value = "GeneralLedgerTransaction", nulls = Nulls.SKIP) - public Builder generalLedgerTransaction(Optional> generalLedgerTransaction) { - this.generalLedgerTransaction = generalLedgerTransaction; - return this; - } - - public Builder generalLedgerTransaction(List generalLedgerTransaction) { - this.generalLedgerTransaction = Optional.ofNullable(generalLedgerTransaction); - return this; - } - - @JsonSetter(value = "BankFeedAccount", nulls = Nulls.SKIP) - public Builder bankFeedAccount(Optional> bankFeedAccount) { - this.bankFeedAccount = bankFeedAccount; - return this; - } - - public Builder bankFeedAccount(List bankFeedAccount) { - this.bankFeedAccount = Optional.ofNullable(bankFeedAccount); - return this; - } - - @JsonSetter(value = "Employee", nulls = Nulls.SKIP) - public Builder employee(Optional> employee) { - this.employee = employee; - return this; - } - - public Builder employee(List employee) { - this.employee = Optional.ofNullable(employee); - return this; - } - - public RemoteFieldApiResponse build() { - return new RemoteFieldApiResponse( - account, - accountingAttachment, - balanceSheet, - cashFlowStatement, - companyInfo, - contact, - incomeStatement, - creditNote, - item, - purchaseOrder, - trackingCategory, - journalEntry, - taxRate, - invoice, - payment, - expense, - vendorCredit, - transaction, - accountingPeriod, - generalLedgerTransaction, - bankFeedAccount, - employee, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldClass.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldClass.java deleted file mode 100644 index d065290ef..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldClass.java +++ /dev/null @@ -1,335 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldClass.Builder.class) -public final class RemoteFieldClass { - private final Optional id; - - private final Optional displayName; - - private final Optional remoteKeyName; - - private final Optional description; - - private final Optional isCustom; - - private final Optional isRequired; - - private final Optional fieldType; - - private final Optional fieldFormat; - - private final Optional> fieldChoices; - - private final Optional itemSchema; - - private final Map additionalProperties; - - private RemoteFieldClass( - Optional id, - Optional displayName, - Optional remoteKeyName, - Optional description, - Optional isCustom, - Optional isRequired, - Optional fieldType, - Optional fieldFormat, - Optional> fieldChoices, - Optional itemSchema, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.remoteKeyName = remoteKeyName; - this.description = description; - this.isCustom = isCustom; - this.isRequired = isRequired; - this.fieldType = fieldType; - this.fieldFormat = fieldFormat; - this.fieldChoices = fieldChoices; - this.itemSchema = itemSchema; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("field_type") - public Optional getFieldType() { - return fieldType; - } - - @JsonProperty("field_format") - public Optional getFieldFormat() { - return fieldFormat; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @JsonProperty("item_schema") - public Optional getItemSchema() { - return itemSchema; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClass && equalTo((RemoteFieldClass) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldClass other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && remoteKeyName.equals(other.remoteKeyName) - && description.equals(other.description) - && isCustom.equals(other.isCustom) - && isRequired.equals(other.isRequired) - && fieldType.equals(other.fieldType) - && fieldFormat.equals(other.fieldFormat) - && fieldChoices.equals(other.fieldChoices) - && itemSchema.equals(other.itemSchema); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.displayName, - this.remoteKeyName, - this.description, - this.isCustom, - this.isRequired, - this.fieldType, - this.fieldFormat, - this.fieldChoices, - this.itemSchema); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional displayName = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional fieldType = Optional.empty(); - - private Optional fieldFormat = Optional.empty(); - - private Optional> fieldChoices = Optional.empty(); - - private Optional itemSchema = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldClass other) { - id(other.getId()); - displayName(other.getDisplayName()); - remoteKeyName(other.getRemoteKeyName()); - description(other.getDescription()); - isCustom(other.getIsCustom()); - isRequired(other.getIsRequired()); - fieldType(other.getFieldType()); - fieldFormat(other.getFieldFormat()); - fieldChoices(other.getFieldChoices()); - itemSchema(other.getItemSchema()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public Builder displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - public Builder displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public Builder remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - public Builder remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public Builder isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - public Builder isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public Builder isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - public Builder isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @JsonSetter(value = "field_type", nulls = Nulls.SKIP) - public Builder fieldType(Optional fieldType) { - this.fieldType = fieldType; - return this; - } - - public Builder fieldType(FieldTypeEnum fieldType) { - this.fieldType = Optional.ofNullable(fieldType); - return this; - } - - @JsonSetter(value = "field_format", nulls = Nulls.SKIP) - public Builder fieldFormat(Optional fieldFormat) { - this.fieldFormat = fieldFormat; - return this; - } - - public Builder fieldFormat(FieldFormatEnum fieldFormat) { - this.fieldFormat = Optional.ofNullable(fieldFormat); - return this; - } - - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public Builder fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - public Builder fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) - public Builder itemSchema(Optional itemSchema) { - this.itemSchema = itemSchema; - return this; - } - - public Builder itemSchema(ItemSchema itemSchema) { - this.itemSchema = Optional.ofNullable(itemSchema); - return this; - } - - public RemoteFieldClass build() { - return new RemoteFieldClass( - id, - displayName, - remoteKeyName, - description, - isCustom, - isRequired, - fieldType, - fieldFormat, - fieldChoices, - itemSchema, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldRequest.java deleted file mode 100644 index fe2e8f4da..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldRequest.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldRequest.Builder.class) -public final class RemoteFieldRequest { - private final RemoteFieldRequestRemoteFieldClass remoteFieldClass; - - private final Optional value; - - private final Map additionalProperties; - - private RemoteFieldRequest( - RemoteFieldRequestRemoteFieldClass remoteFieldClass, - Optional value, - Map additionalProperties) { - this.remoteFieldClass = remoteFieldClass; - this.value = value; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_field_class") - public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { - return remoteFieldClass; - } - - @JsonProperty("value") - public Optional getValue() { - return value; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRequest && equalTo((RemoteFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldRequest other) { - return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldClass, this.value); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteFieldClassStage builder() { - return new Builder(); - } - - public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass); - - Builder from(RemoteFieldRequest other); - } - - public interface _FinalStage { - RemoteFieldRequest build(); - - _FinalStage value(Optional value); - - _FinalStage value(JsonNode value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldRequestRemoteFieldClass remoteFieldClass; - - private Optional value = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldRequest other) { - remoteFieldClass(other.getRemoteFieldClass()); - value(other.getValue()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { - this.remoteFieldClass = remoteFieldClass; - return this; - } - - @java.lang.Override - public _FinalStage value(JsonNode value) { - this.value = Optional.ofNullable(value); - return this; - } - - @java.lang.Override - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public _FinalStage value(Optional value) { - this.value = value; - return this; - } - - @java.lang.Override - public RemoteFieldRequest build() { - return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldRequestRemoteFieldClass.java deleted file mode 100644 index b3ed43207..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteFieldRequestRemoteFieldClass.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldRequestRemoteFieldClass.Deserializer.class) -public final class RemoteFieldRequestRemoteFieldClass { - private final Object value; - - private final int type; - - private RemoteFieldRequestRemoteFieldClass(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((RemoteFieldClass) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRequestRemoteFieldClass - && equalTo((RemoteFieldRequestRemoteFieldClass) other); - } - - private boolean equalTo(RemoteFieldRequestRemoteFieldClass other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldRequestRemoteFieldClass of(String value) { - return new RemoteFieldRequestRemoteFieldClass(value, 0); - } - - public static RemoteFieldRequestRemoteFieldClass of(RemoteFieldClass value) { - return new RemoteFieldRequestRemoteFieldClass(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(RemoteFieldClass value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldRequestRemoteFieldClass.class); - } - - @java.lang.Override - public RemoteFieldRequestRemoteFieldClass deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteKey.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteKey.java deleted file mode 100644 index 2d84f1ec3..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteKey.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKey.Builder.class) -public final class RemoteKey { - private final String name; - - private final String key; - - private final Map additionalProperties; - - private RemoteKey(String name, String key, Map additionalProperties) { - this.name = name; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("key") - public String getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKey && equalTo((RemoteKey) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKey other) { - return name.equals(other.name) && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - KeyStage name(@NotNull String name); - - Builder from(RemoteKey other); - } - - public interface KeyStage { - _FinalStage key(@NotNull String key); - } - - public interface _FinalStage { - RemoteKey build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, KeyStage, _FinalStage { - private String name; - - private String key; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKey other) { - name(other.getName()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public KeyStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("key") - public _FinalStage key(@NotNull String key) { - this.key = key; - return this; - } - - @java.lang.Override - public RemoteKey build() { - return new RemoteKey(name, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RemoteResponse.java b/src/main/java/com/merge/api/resources/accounting/types/RemoteResponse.java deleted file mode 100644 index 7e137405e..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RemoteResponse.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteResponse.Builder.class) -public final class RemoteResponse { - private final String method; - - private final String path; - - private final int status; - - private final JsonNode response; - - private final Optional> responseHeaders; - - private final Optional responseType; - - private final Optional> headers; - - private final Map additionalProperties; - - private RemoteResponse( - String method, - String path, - int status, - JsonNode response, - Optional> responseHeaders, - Optional responseType, - Optional> headers, - Map additionalProperties) { - this.method = method; - this.path = path; - this.status = status; - this.response = response; - this.responseHeaders = responseHeaders; - this.responseType = responseType; - this.headers = headers; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("status") - public int getStatus() { - return status; - } - - @JsonProperty("response") - public JsonNode getResponse() { - return response; - } - - @JsonProperty("response_headers") - public Optional> getResponseHeaders() { - return responseHeaders; - } - - @JsonProperty("response_type") - public Optional getResponseType() { - return responseType; - } - - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponse && equalTo((RemoteResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteResponse other) { - return method.equals(other.method) - && path.equals(other.path) - && status == other.status - && response.equals(other.response) - && responseHeaders.equals(other.responseHeaders) - && responseType.equals(other.responseType) - && headers.equals(other.headers); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.status, - this.response, - this.responseHeaders, - this.responseType, - this.headers); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull String method); - - Builder from(RemoteResponse other); - } - - public interface PathStage { - StatusStage path(@NotNull String path); - } - - public interface StatusStage { - ResponseStage status(int status); - } - - public interface ResponseStage { - _FinalStage response(@NotNull JsonNode response); - } - - public interface _FinalStage { - RemoteResponse build(); - - _FinalStage responseHeaders(Optional> responseHeaders); - - _FinalStage responseHeaders(Map responseHeaders); - - _FinalStage responseType(Optional responseType); - - _FinalStage responseType(ResponseTypeEnum responseType); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { - private String method; - - private String path; - - private int status; - - private JsonNode response; - - private Optional> headers = Optional.empty(); - - private Optional responseType = Optional.empty(); - - private Optional> responseHeaders = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteResponse other) { - method(other.getMethod()); - path(other.getPath()); - status(other.getStatus()); - response(other.getResponse()); - responseHeaders(other.getResponseHeaders()); - responseType(other.getResponseType()); - headers(other.getHeaders()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("path") - public StatusStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public ResponseStage status(int status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("response") - public _FinalStage response(@NotNull JsonNode response) { - this.response = response; - return this; - } - - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - @java.lang.Override - public _FinalStage responseType(ResponseTypeEnum responseType) { - this.responseType = Optional.ofNullable(responseType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_type", nulls = Nulls.SKIP) - public _FinalStage responseType(Optional responseType) { - this.responseType = responseType; - return this; - } - - @java.lang.Override - public _FinalStage responseHeaders(Map responseHeaders) { - this.responseHeaders = Optional.ofNullable(responseHeaders); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) - public _FinalStage responseHeaders(Optional> responseHeaders) { - this.responseHeaders = responseHeaders; - return this; - } - - @java.lang.Override - public RemoteResponse build() { - return new RemoteResponse( - method, path, status, response, responseHeaders, responseType, headers, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RequestFormatEnum.java b/src/main/java/com/merge/api/resources/accounting/types/RequestFormatEnum.java deleted file mode 100644 index e81f562ba..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RequestFormatEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RequestFormatEnum { - JSON("JSON"), - - XML("XML"), - - MULTIPART("MULTIPART"); - - private final String value; - - RequestFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/resources/accounting/types/ResponseTypeEnum.java deleted file mode 100644 index 4a8c386b5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ResponseTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ResponseTypeEnum { - JSON("JSON"), - - BASE_64_GZIP("BASE64_GZIP"); - - private final String value; - - ResponseTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/RoleEnum.java b/src/main/java/com/merge/api/resources/accounting/types/RoleEnum.java deleted file mode 100644 index adac0a8bb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/RoleEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RoleEnum { - ADMIN("ADMIN"), - - DEVELOPER("DEVELOPER"), - - MEMBER("MEMBER"), - - API("API"), - - SYSTEM("SYSTEM"), - - MERGE_TEAM("MERGE_TEAM"); - - private final String value; - - RoleEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/resources/accounting/types/SelectiveSyncConfigurationsUsageEnum.java deleted file mode 100644 index 04b8523e7..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/SelectiveSyncConfigurationsUsageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SelectiveSyncConfigurationsUsageEnum { - IN_NEXT_SYNC("IN_NEXT_SYNC"), - - IN_LAST_SYNC("IN_LAST_SYNC"); - - private final String value; - - SelectiveSyncConfigurationsUsageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/SyncStatus.java b/src/main/java/com/merge/api/resources/accounting/types/SyncStatus.java deleted file mode 100644 index df51b5798..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/SyncStatus.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatus.Builder.class) -public final class SyncStatus { - private final String modelName; - - private final String modelId; - - private final Optional lastSyncStart; - - private final Optional nextSyncStart; - - private final SyncStatusStatusEnum status; - - private final boolean isInitialSync; - - private final Optional selectiveSyncConfigurationsUsage; - - private final Map additionalProperties; - - private SyncStatus( - String modelName, - String modelId, - Optional lastSyncStart, - Optional nextSyncStart, - SyncStatusStatusEnum status, - boolean isInitialSync, - Optional selectiveSyncConfigurationsUsage, - Map additionalProperties) { - this.modelName = modelName; - this.modelId = modelId; - this.lastSyncStart = lastSyncStart; - this.nextSyncStart = nextSyncStart; - this.status = status; - this.isInitialSync = isInitialSync; - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("last_sync_start") - public Optional getLastSyncStart() { - return lastSyncStart; - } - - @JsonProperty("next_sync_start") - public Optional getNextSyncStart() { - return nextSyncStart; - } - - @JsonProperty("status") - public SyncStatusStatusEnum getStatus() { - return status; - } - - @JsonProperty("is_initial_sync") - public boolean getIsInitialSync() { - return isInitialSync; - } - - @JsonProperty("selective_sync_configurations_usage") - public Optional getSelectiveSyncConfigurationsUsage() { - return selectiveSyncConfigurationsUsage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatus && equalTo((SyncStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatus other) { - return modelName.equals(other.modelName) - && modelId.equals(other.modelId) - && lastSyncStart.equals(other.lastSyncStart) - && nextSyncStart.equals(other.nextSyncStart) - && status.equals(other.status) - && isInitialSync == other.isInitialSync - && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, - this.modelId, - this.lastSyncStart, - this.nextSyncStart, - this.status, - this.isInitialSync, - this.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - ModelIdStage modelName(@NotNull String modelName); - - Builder from(SyncStatus other); - } - - public interface ModelIdStage { - StatusStage modelId(@NotNull String modelId); - } - - public interface StatusStage { - IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status); - } - - public interface IsInitialSyncStage { - _FinalStage isInitialSync(boolean isInitialSync); - } - - public interface _FinalStage { - SyncStatus build(); - - _FinalStage lastSyncStart(Optional lastSyncStart); - - _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); - - _FinalStage nextSyncStart(Optional nextSyncStart); - - _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); - - _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage); - - _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { - private String modelName; - - private String modelId; - - private SyncStatusStatusEnum status; - - private boolean isInitialSync; - - private Optional selectiveSyncConfigurationsUsage = Optional.empty(); - - private Optional nextSyncStart = Optional.empty(); - - private Optional lastSyncStart = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(SyncStatus other) { - modelName(other.getModelName()); - modelId(other.getModelId()); - lastSyncStart(other.getLastSyncStart()); - nextSyncStart(other.getNextSyncStart()); - status(other.getStatus()); - isInitialSync(other.getIsInitialSync()); - selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public ModelIdStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public StatusStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("is_initial_sync") - public _FinalStage isInitialSync(boolean isInitialSync) { - this.isInitialSync = isInitialSync; - return this; - } - - @java.lang.Override - public _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) - public _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - return this; - } - - @java.lang.Override - public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { - this.nextSyncStart = Optional.ofNullable(nextSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) - public _FinalStage nextSyncStart(Optional nextSyncStart) { - this.nextSyncStart = nextSyncStart; - return this; - } - - @java.lang.Override - public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { - this.lastSyncStart = Optional.ofNullable(lastSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) - public _FinalStage lastSyncStart(Optional lastSyncStart) { - this.lastSyncStart = lastSyncStart; - return this; - } - - @java.lang.Override - public SyncStatus build() { - return new SyncStatus( - modelName, - modelId, - lastSyncStart, - nextSyncStart, - status, - isInitialSync, - selectiveSyncConfigurationsUsage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/api/resources/accounting/types/SyncStatusStatusEnum.java deleted file mode 100644 index e8dc76f71..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/SyncStatusStatusEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SyncStatusStatusEnum { - SYNCING("SYNCING"), - - DONE("DONE"), - - FAILED("FAILED"), - - DISABLED("DISABLED"), - - PAUSED("PAUSED"), - - PARTIALLY_SYNCED("PARTIALLY_SYNCED"); - - private final String value; - - SyncStatusStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/TaxComponentComponentType.java b/src/main/java/com/merge/api/resources/accounting/types/TaxComponentComponentType.java deleted file mode 100644 index 33e3f273d..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/TaxComponentComponentType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TaxComponentComponentType.Deserializer.class) -public final class TaxComponentComponentType { - private final Object value; - - private final int type; - - private TaxComponentComponentType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ComponentTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TaxComponentComponentType && equalTo((TaxComponentComponentType) other); - } - - private boolean equalTo(TaxComponentComponentType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TaxComponentComponentType of(ComponentTypeEnum value) { - return new TaxComponentComponentType(value, 0); - } - - public static TaxComponentComponentType of(String value) { - return new TaxComponentComponentType(value, 1); - } - - public interface Visitor { - T visit(ComponentTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TaxComponentComponentType.class); - } - - @java.lang.Override - public TaxComponentComponentType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ComponentTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/TaxRateStatus.java b/src/main/java/com/merge/api/resources/accounting/types/TaxRateStatus.java deleted file mode 100644 index 8f83fc9fd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/TaxRateStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TaxRateStatus.Deserializer.class) -public final class TaxRateStatus { - private final Object value; - - private final int type; - - private TaxRateStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((Status7D1Enum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TaxRateStatus && equalTo((TaxRateStatus) other); - } - - private boolean equalTo(TaxRateStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TaxRateStatus of(Status7D1Enum value) { - return new TaxRateStatus(value, 0); - } - - public static TaxRateStatus of(String value) { - return new TaxRateStatus(value, 1); - } - - public interface Visitor { - T visit(Status7D1Enum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TaxRateStatus.class); - } - - @java.lang.Override - public TaxRateStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status7D1Enum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryCategoryType.java b/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryCategoryType.java deleted file mode 100644 index a0a4c63b4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryCategoryType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TrackingCategoryCategoryType.Deserializer.class) -public final class TrackingCategoryCategoryType { - private final Object value; - - private final int type; - - private TrackingCategoryCategoryType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CategoryTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TrackingCategoryCategoryType && equalTo((TrackingCategoryCategoryType) other); - } - - private boolean equalTo(TrackingCategoryCategoryType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TrackingCategoryCategoryType of(CategoryTypeEnum value) { - return new TrackingCategoryCategoryType(value, 0); - } - - public static TrackingCategoryCategoryType of(String value) { - return new TrackingCategoryCategoryType(value, 1); - } - - public interface Visitor { - T visit(CategoryTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TrackingCategoryCategoryType.class); - } - - @java.lang.Override - public TrackingCategoryCategoryType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CategoryTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryStatus.java b/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryStatus.java deleted file mode 100644 index 4665e92c1..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/TrackingCategoryStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TrackingCategoryStatus.Deserializer.class) -public final class TrackingCategoryStatus { - private final Object value; - - private final int type; - - private TrackingCategoryStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((Status7D1Enum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TrackingCategoryStatus && equalTo((TrackingCategoryStatus) other); - } - - private boolean equalTo(TrackingCategoryStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TrackingCategoryStatus of(Status7D1Enum value) { - return new TrackingCategoryStatus(value, 0); - } - - public static TrackingCategoryStatus of(String value) { - return new TrackingCategoryStatus(value, 1); - } - - public interface Visitor { - T visit(Status7D1Enum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TrackingCategoryStatus.class); - } - - @java.lang.Override - public TrackingCategoryStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status7D1Enum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/TransactionCurrency.java deleted file mode 100644 index d006f83bd..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TransactionCurrency.Deserializer.class) -public final class TransactionCurrency { - private final Object value; - - private final int type; - - private TransactionCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TransactionCurrency && equalTo((TransactionCurrency) other); - } - - private boolean equalTo(TransactionCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TransactionCurrency of(TransactionCurrencyEnum value) { - return new TransactionCurrency(value, 0); - } - - public static TransactionCurrency of(String value) { - return new TransactionCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TransactionCurrency.class); - } - - @java.lang.Override - public TransactionCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/TransactionLineItemCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/TransactionLineItemCurrency.java deleted file mode 100644 index f2a01c301..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/TransactionLineItemCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TransactionLineItemCurrency.Deserializer.class) -public final class TransactionLineItemCurrency { - private final Object value; - - private final int type; - - private TransactionLineItemCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TransactionLineItemCurrency && equalTo((TransactionLineItemCurrency) other); - } - - private boolean equalTo(TransactionLineItemCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TransactionLineItemCurrency of(TransactionCurrencyEnum value) { - return new TransactionLineItemCurrency(value, 0); - } - - public static TransactionLineItemCurrency of(String value) { - return new TransactionLineItemCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TransactionLineItemCurrency.class); - } - - @java.lang.Override - public TransactionLineItemCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/ValidationProblemSource.java b/src/main/java/com/merge/api/resources/accounting/types/ValidationProblemSource.java deleted file mode 100644 index 76b0a1ab0..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/ValidationProblemSource.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ValidationProblemSource.Builder.class) -public final class ValidationProblemSource { - private final String pointer; - - private final Map additionalProperties; - - private ValidationProblemSource(String pointer, Map additionalProperties) { - this.pointer = pointer; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("pointer") - public String getPointer() { - return pointer; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidationProblemSource other) { - return pointer.equals(other.pointer); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.pointer); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PointerStage builder() { - return new Builder(); - } - - public interface PointerStage { - _FinalStage pointer(@NotNull String pointer); - - Builder from(ValidationProblemSource other); - } - - public interface _FinalStage { - ValidationProblemSource build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PointerStage, _FinalStage { - private String pointer; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ValidationProblemSource other) { - pointer(other.getPointer()); - return this; - } - - @java.lang.Override - @JsonSetter("pointer") - public _FinalStage pointer(@NotNull String pointer) { - this.pointer = pointer; - return this; - } - - @java.lang.Override - public ValidationProblemSource build() { - return new ValidationProblemSource(pointer, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/VendorCreditCurrency.java deleted file mode 100644 index 418568614..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = VendorCreditCurrency.Deserializer.class) -public final class VendorCreditCurrency { - private final Object value; - - private final int type; - - private VendorCreditCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof VendorCreditCurrency && equalTo((VendorCreditCurrency) other); - } - - private boolean equalTo(VendorCreditCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static VendorCreditCurrency of(TransactionCurrencyEnum value) { - return new VendorCreditCurrency(value, 0); - } - - public static VendorCreditCurrency of(String value) { - return new VendorCreditCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(VendorCreditCurrency.class); - } - - @java.lang.Override - public VendorCreditCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditRequestCurrency.java b/src/main/java/com/merge/api/resources/accounting/types/VendorCreditRequestCurrency.java deleted file mode 100644 index 1457d0a2e..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/VendorCreditRequestCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = VendorCreditRequestCurrency.Deserializer.class) -public final class VendorCreditRequestCurrency { - private final Object value; - - private final int type; - - private VendorCreditRequestCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TransactionCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof VendorCreditRequestCurrency && equalTo((VendorCreditRequestCurrency) other); - } - - private boolean equalTo(VendorCreditRequestCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static VendorCreditRequestCurrency of(TransactionCurrencyEnum value) { - return new VendorCreditRequestCurrency(value, 0); - } - - public static VendorCreditRequestCurrency of(String value) { - return new VendorCreditRequestCurrency(value, 1); - } - - public interface Visitor { - T visit(TransactionCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(VendorCreditRequestCurrency.class); - } - - @java.lang.Override - public VendorCreditRequestCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/WarningValidationProblem.java b/src/main/java/com/merge/api/resources/accounting/types/WarningValidationProblem.java deleted file mode 100644 index 6d4fdc6cc..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/WarningValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WarningValidationProblem.Builder.class) -public final class WarningValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private WarningValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WarningValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(WarningValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - WarningValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WarningValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public WarningValidationProblem build() { - return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/types/WebhookReceiver.java b/src/main/java/com/merge/api/resources/accounting/types/WebhookReceiver.java deleted file mode 100644 index 3c39345bb..000000000 --- a/src/main/java/com/merge/api/resources/accounting/types/WebhookReceiver.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiver.Builder.class) -public final class WebhookReceiver { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiver( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiver other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiver other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiver build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiver other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiver build() { - return new WebhookReceiver(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/vendorcredits/VendorCreditsClient.java b/src/main/java/com/merge/api/resources/accounting/vendorcredits/VendorCreditsClient.java deleted file mode 100644 index 0da694ae4..000000000 --- a/src/main/java/com/merge/api/resources/accounting/vendorcredits/VendorCreditsClient.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.vendorcredits; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -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.MetaResponse; -import com.merge.api.resources.accounting.types.PaginatedVendorCreditList; -import com.merge.api.resources.accounting.types.VendorCredit; -import com.merge.api.resources.accounting.types.VendorCreditResponse; -import com.merge.api.resources.accounting.vendorcredits.requests.VendorCreditEndpointRequest; -import com.merge.api.resources.accounting.vendorcredits.requests.VendorCreditsListRequest; -import com.merge.api.resources.accounting.vendorcredits.requests.VendorCreditsRetrieveRequest; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class VendorCreditsClient { - protected final ClientOptions clientOptions; - - public VendorCreditsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of VendorCredit objects. - */ - public PaginatedVendorCreditList list() { - return list(VendorCreditsListRequest.builder().build()); - } - - /** - * Returns a list of VendorCredit objects. - */ - public PaginatedVendorCreditList list(VendorCreditsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of VendorCredit objects. - */ - public PaginatedVendorCreditList list(VendorCreditsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/vendor-credits"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTransactionDateAfter().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_after", - request.getTransactionDateAfter().get().toString()); - } - if (request.getTransactionDateBefore().isPresent()) { - httpUrl.addQueryParameter( - "transaction_date_before", - request.getTransactionDateBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedVendorCreditList.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); - } - } - - /** - * Creates a VendorCredit object with the given values. - */ - public VendorCreditResponse create(VendorCreditEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a VendorCredit object with the given values. - */ - public VendorCreditResponse create(VendorCreditEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/vendor-credits"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), VendorCreditResponse.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); - } - } - - /** - * Returns a VendorCredit object with the given id. - */ - public VendorCredit retrieve(String id) { - return retrieve(id, VendorCreditsRetrieveRequest.builder().build()); - } - - /** - * Returns a VendorCredit object with the given id. - */ - public VendorCredit retrieve(String id, VendorCreditsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a VendorCredit object with the given id. - */ - public VendorCredit retrieve(String id, VendorCreditsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/vendor-credits") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), VendorCredit.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); - } - } - - /** - * Returns metadata for VendorCredit POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for VendorCredit POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/vendor-credits/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditsRetrieveRequest.java b/src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditsRetrieveRequest.java deleted file mode 100644 index 8354c2885..000000000 --- a/src/main/java/com/merge/api/resources/accounting/vendorcredits/requests/VendorCreditsRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.vendorcredits.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.accounting.vendorcredits.types.VendorCreditsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = VendorCreditsRetrieveRequest.Builder.class) -public final class VendorCreditsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private VendorCreditsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof VendorCreditsRetrieveRequest && equalTo((VendorCreditsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(VendorCreditsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(VendorCreditsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(VendorCreditsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public VendorCreditsRetrieveRequest build() { - return new VendorCreditsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/vendorcredits/types/VendorCreditsListRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/vendorcredits/types/VendorCreditsListRequestExpand.java deleted file mode 100644 index dac8c0e6f..000000000 --- a/src/main/java/com/merge/api/resources/accounting/vendorcredits/types/VendorCreditsListRequestExpand.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.vendorcredits.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum VendorCreditsListRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - LINES("lines"), - - LINES_ACCOUNTING_PERIOD("lines,accounting_period"), - - LINES_COMPANY("lines,company"), - - LINES_COMPANY_ACCOUNTING_PERIOD("lines,company,accounting_period"), - - LINES_TRACKING_CATEGORIES("lines,tracking_categories"), - - LINES_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("lines,tracking_categories,accounting_period"), - - LINES_TRACKING_CATEGORIES_COMPANY("lines,tracking_categories,company"), - - LINES_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("lines,tracking_categories,company,accounting_period"), - - LINES_TRACKING_CATEGORIES_VENDOR("lines,tracking_categories,vendor"), - - LINES_TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("lines,tracking_categories,vendor,accounting_period"), - - LINES_TRACKING_CATEGORIES_VENDOR_COMPANY("lines,tracking_categories,vendor,company"), - - LINES_TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "lines,tracking_categories,vendor,company,accounting_period"), - - LINES_VENDOR("lines,vendor"), - - LINES_VENDOR_ACCOUNTING_PERIOD("lines,vendor,accounting_period"), - - LINES_VENDOR_COMPANY("lines,vendor,company"), - - LINES_VENDOR_COMPANY_ACCOUNTING_PERIOD("lines,vendor,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_VENDOR("tracking_categories,vendor"), - - TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("tracking_categories,vendor,accounting_period"), - - TRACKING_CATEGORIES_VENDOR_COMPANY("tracking_categories,vendor,company"), - - TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD("tracking_categories,vendor,company,accounting_period"), - - VENDOR("vendor"), - - VENDOR_ACCOUNTING_PERIOD("vendor,accounting_period"), - - VENDOR_COMPANY("vendor,company"), - - VENDOR_COMPANY_ACCOUNTING_PERIOD("vendor,company,accounting_period"); - - private final String value; - - VendorCreditsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/vendorcredits/types/VendorCreditsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/accounting/vendorcredits/types/VendorCreditsRetrieveRequestExpand.java deleted file mode 100644 index 601d58ef5..000000000 --- a/src/main/java/com/merge/api/resources/accounting/vendorcredits/types/VendorCreditsRetrieveRequestExpand.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.vendorcredits.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum VendorCreditsRetrieveRequestExpand { - ACCOUNTING_PERIOD("accounting_period"), - - COMPANY("company"), - - COMPANY_ACCOUNTING_PERIOD("company,accounting_period"), - - LINES("lines"), - - LINES_ACCOUNTING_PERIOD("lines,accounting_period"), - - LINES_COMPANY("lines,company"), - - LINES_COMPANY_ACCOUNTING_PERIOD("lines,company,accounting_period"), - - LINES_TRACKING_CATEGORIES("lines,tracking_categories"), - - LINES_TRACKING_CATEGORIES_ACCOUNTING_PERIOD("lines,tracking_categories,accounting_period"), - - LINES_TRACKING_CATEGORIES_COMPANY("lines,tracking_categories,company"), - - LINES_TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("lines,tracking_categories,company,accounting_period"), - - LINES_TRACKING_CATEGORIES_VENDOR("lines,tracking_categories,vendor"), - - LINES_TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("lines,tracking_categories,vendor,accounting_period"), - - LINES_TRACKING_CATEGORIES_VENDOR_COMPANY("lines,tracking_categories,vendor,company"), - - LINES_TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD( - "lines,tracking_categories,vendor,company,accounting_period"), - - LINES_VENDOR("lines,vendor"), - - LINES_VENDOR_ACCOUNTING_PERIOD("lines,vendor,accounting_period"), - - LINES_VENDOR_COMPANY("lines,vendor,company"), - - LINES_VENDOR_COMPANY_ACCOUNTING_PERIOD("lines,vendor,company,accounting_period"), - - TRACKING_CATEGORIES("tracking_categories"), - - TRACKING_CATEGORIES_ACCOUNTING_PERIOD("tracking_categories,accounting_period"), - - TRACKING_CATEGORIES_COMPANY("tracking_categories,company"), - - TRACKING_CATEGORIES_COMPANY_ACCOUNTING_PERIOD("tracking_categories,company,accounting_period"), - - TRACKING_CATEGORIES_VENDOR("tracking_categories,vendor"), - - TRACKING_CATEGORIES_VENDOR_ACCOUNTING_PERIOD("tracking_categories,vendor,accounting_period"), - - TRACKING_CATEGORIES_VENDOR_COMPANY("tracking_categories,vendor,company"), - - TRACKING_CATEGORIES_VENDOR_COMPANY_ACCOUNTING_PERIOD("tracking_categories,vendor,company,accounting_period"), - - VENDOR("vendor"), - - VENDOR_ACCOUNTING_PERIOD("vendor,accounting_period"), - - VENDOR_COMPANY("vendor,company"), - - VENDOR_COMPANY_ACCOUNTING_PERIOD("vendor,company,accounting_period"); - - private final String value; - - VendorCreditsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/api/resources/accounting/webhookreceivers/WebhookReceiversClient.java deleted file mode 100644 index 565302c25..000000000 --- a/src/main/java/com/merge/api/resources/accounting/webhookreceivers/WebhookReceiversClient.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.webhookreceivers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -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.WebhookReceiver; -import com.merge.api.resources.accounting.webhookreceivers.requests.WebhookReceiverRequest; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class WebhookReceiversClient { - protected final ClientOptions clientOptions; - - public WebhookReceiversClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list() { - return list(null); - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/webhook-receivers") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request) { - return create(request, null); - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("accounting/v1/webhook-receivers") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), WebhookReceiver.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/accounting/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/api/resources/accounting/webhookreceivers/requests/WebhookReceiverRequest.java deleted file mode 100644 index 870b709db..000000000 --- a/src/main/java/com/merge/api/resources/accounting/webhookreceivers/requests/WebhookReceiverRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.accounting.webhookreceivers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) -public final class WebhookReceiverRequest { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiverRequest( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiverRequest other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiverRequest other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiverRequest build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiverRequest other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiverRequest build() { - return new WebhookReceiverRequest(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/api/resources/ats/accountdetails/AccountDetailsClient.java deleted file mode 100644 index 7def09db5..000000000 --- a/src/main/java/com/merge/api/resources/ats/accountdetails/AccountDetailsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.accountdetails; - -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.ats.types.AccountDetails; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountDetailsClient { - protected final ClientOptions clientOptions; - - public AccountDetailsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve() { - return retrieve(null); - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/account-details") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountDetails.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/api/resources/ats/accounttoken/AccountTokenClient.java deleted file mode 100644 index 742d78a6c..000000000 --- a/src/main/java/com/merge/api/resources/ats/accounttoken/AccountTokenClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.accounttoken; - -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.ats.types.AccountToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountTokenClient { - protected final ClientOptions clientOptions; - - public AccountTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken) { - return retrieve(publicToken, null); - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/account-token") - .addPathSegment(publicToken) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/activities/ActivitiesClient.java b/src/main/java/com/merge/api/resources/ats/activities/ActivitiesClient.java deleted file mode 100644 index 1bf2a51e8..000000000 --- a/src/main/java/com/merge/api/resources/ats/activities/ActivitiesClient.java +++ /dev/null @@ -1,296 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.activities; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.activities.requests.ActivitiesListRequest; -import com.merge.api.resources.ats.activities.requests.ActivitiesRetrieveRequest; -import com.merge.api.resources.ats.activities.requests.ActivityEndpointRequest; -import com.merge.api.resources.ats.types.Activity; -import com.merge.api.resources.ats.types.ActivityResponse; -import com.merge.api.resources.ats.types.MetaResponse; -import com.merge.api.resources.ats.types.PaginatedActivityList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ActivitiesClient { - protected final ClientOptions clientOptions; - - public ActivitiesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Activity objects. - */ - public PaginatedActivityList list() { - return list(ActivitiesListRequest.builder().build()); - } - - /** - * Returns a list of Activity objects. - */ - public PaginatedActivityList list(ActivitiesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Activity objects. - */ - public PaginatedActivityList list(ActivitiesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/activities"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - if (request.getUserId().isPresent()) { - httpUrl.addQueryParameter("user_id", request.getUserId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedActivityList.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); - } - } - - /** - * Creates an Activity object with the given values. - */ - public ActivityResponse create(ActivityEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Activity object with the given values. - */ - public ActivityResponse create(ActivityEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/activities"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), ActivityResponse.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); - } - } - - /** - * Returns an Activity object with the given id. - */ - public Activity retrieve(String id) { - return retrieve(id, ActivitiesRetrieveRequest.builder().build()); - } - - /** - * Returns an Activity object with the given id. - */ - public Activity retrieve(String id, ActivitiesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Activity object with the given id. - */ - public Activity retrieve(String id, ActivitiesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/activities") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Activity.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); - } - } - - /** - * Returns metadata for Activity POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Activity POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/activities/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/applications/ApplicationsClient.java b/src/main/java/com/merge/api/resources/ats/applications/ApplicationsClient.java deleted file mode 100644 index d9399ff64..000000000 --- a/src/main/java/com/merge/api/resources/ats/applications/ApplicationsClient.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.applications; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.applications.requests.ApplicationEndpointRequest; -import com.merge.api.resources.ats.applications.requests.ApplicationsListRequest; -import com.merge.api.resources.ats.applications.requests.ApplicationsMetaPostRetrieveRequest; -import com.merge.api.resources.ats.applications.requests.ApplicationsRetrieveRequest; -import com.merge.api.resources.ats.applications.requests.UpdateApplicationStageRequest; -import com.merge.api.resources.ats.types.Application; -import com.merge.api.resources.ats.types.ApplicationResponse; -import com.merge.api.resources.ats.types.MetaResponse; -import com.merge.api.resources.ats.types.PaginatedApplicationList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ApplicationsClient { - protected final ClientOptions clientOptions; - - public ApplicationsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Application objects. - */ - public PaginatedApplicationList list() { - return list(ApplicationsListRequest.builder().build()); - } - - /** - * Returns a list of Application objects. - */ - public PaginatedApplicationList list(ApplicationsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Application objects. - */ - public PaginatedApplicationList list(ApplicationsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/applications"); - if (request.getCandidateId().isPresent()) { - httpUrl.addQueryParameter("candidate_id", request.getCandidateId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCreditedToId().isPresent()) { - httpUrl.addQueryParameter( - "credited_to_id", request.getCreditedToId().get()); - } - if (request.getCurrentStageId().isPresent()) { - httpUrl.addQueryParameter( - "current_stage_id", request.getCurrentStageId().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getJobId().isPresent()) { - httpUrl.addQueryParameter("job_id", request.getJobId().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRejectReasonId().isPresent()) { - httpUrl.addQueryParameter( - "reject_reason_id", request.getRejectReasonId().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getSource().isPresent()) { - httpUrl.addQueryParameter("source", request.getSource().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedApplicationList.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); - } - } - - /** - * Creates an Application object with the given values. - * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. - *

See our Help Center article for detailed support per integration.

- */ - public ApplicationResponse create(ApplicationEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Application object with the given values. - * For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. - *

See our Help Center article for detailed support per integration.

- */ - public ApplicationResponse create(ApplicationEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/applications"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), ApplicationResponse.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); - } - } - - /** - * Returns an Application object with the given id. - */ - public Application retrieve(String id) { - return retrieve(id, ApplicationsRetrieveRequest.builder().build()); - } - - /** - * Returns an Application object with the given id. - */ - public Application retrieve(String id, ApplicationsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Application object with the given id. - */ - public Application retrieve(String id, ApplicationsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/applications") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Application.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); - } - } - - /** - * Updates the current_stage field of an Application object - */ - public ApplicationResponse changeStageCreate(String id) { - return changeStageCreate(id, UpdateApplicationStageRequest.builder().build()); - } - - /** - * Updates the current_stage field of an Application object - */ - public ApplicationResponse changeStageCreate(String id, UpdateApplicationStageRequest request) { - return changeStageCreate(id, request, null); - } - - /** - * Updates the current_stage field of an Application object - */ - public ApplicationResponse changeStageCreate( - String id, UpdateApplicationStageRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/applications") - .addPathSegment(id) - .addPathSegments("change-stage"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - if (request.getJobInterviewStage().isPresent()) { - properties.put("job_interview_stage", request.getJobInterviewStage()); - } - if (request.getRemoteUserId().isPresent()) { - properties.put("remote_user_id", request.getRemoteUserId()); - } - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), ApplicationResponse.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); - } - } - - /** - * Returns metadata for Application POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(ApplicationsMetaPostRetrieveRequest.builder().build()); - } - - /** - * Returns metadata for Application POSTs. - */ - public MetaResponse metaPostRetrieve(ApplicationsMetaPostRetrieveRequest request) { - return metaPostRetrieve(request, null); - } - - /** - * Returns metadata for Application POSTs. - */ - public MetaResponse metaPostRetrieve(ApplicationsMetaPostRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/applications/meta/post"); - if (request.getApplicationRemoteTemplateId().isPresent()) { - httpUrl.addQueryParameter( - "application_remote_template_id", - request.getApplicationRemoteTemplateId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationsRetrieveRequest.java deleted file mode 100644 index 835565218..000000000 --- a/src/main/java/com/merge/api/resources/ats/applications/requests/ApplicationsRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.applications.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.applications.types.ApplicationsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ApplicationsRetrieveRequest.Builder.class) -public final class ApplicationsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private ApplicationsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ApplicationsRetrieveRequest && equalTo((ApplicationsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ApplicationsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ApplicationsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ApplicationsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public ApplicationsRetrieveRequest build() { - return new ApplicationsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/applications/types/ApplicationsListRequestExpand.java b/src/main/java/com/merge/api/resources/ats/applications/types/ApplicationsListRequestExpand.java deleted file mode 100644 index 8c8e1e8fe..000000000 --- a/src/main/java/com/merge/api/resources/ats/applications/types/ApplicationsListRequestExpand.java +++ /dev/null @@ -1,680 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.applications.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ApplicationsListRequestExpand { - CANDIDATE("candidate"), - - CANDIDATE_CREDITED_TO("candidate,credited_to"), - - CANDIDATE_CREDITED_TO_CURRENT_STAGE("candidate,credited_to,current_stage"), - - CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("candidate,credited_to,current_stage,reject_reason"), - - CANDIDATE_CREDITED_TO_REJECT_REASON("candidate,credited_to,reject_reason"), - - CANDIDATE_CURRENT_STAGE("candidate,current_stage"), - - CANDIDATE_CURRENT_STAGE_REJECT_REASON("candidate,current_stage,reject_reason"), - - CANDIDATE_JOB("candidate,job"), - - CANDIDATE_JOB_CREDITED_TO("candidate,job,credited_to"), - - CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE("candidate,job,credited_to,current_stage"), - - CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("candidate,job,credited_to,current_stage,reject_reason"), - - CANDIDATE_JOB_CREDITED_TO_REJECT_REASON("candidate,job,credited_to,reject_reason"), - - CANDIDATE_JOB_CURRENT_STAGE("candidate,job,current_stage"), - - CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON("candidate,job,current_stage,reject_reason"), - - CANDIDATE_JOB_REJECT_REASON("candidate,job,reject_reason"), - - CANDIDATE_REJECT_REASON("candidate,reject_reason"), - - CREDITED_TO("credited_to"), - - CREDITED_TO_CURRENT_STAGE("credited_to,current_stage"), - - CREDITED_TO_CURRENT_STAGE_REJECT_REASON("credited_to,current_stage,reject_reason"), - - CREDITED_TO_REJECT_REASON("credited_to,reject_reason"), - - CURRENT_STAGE("current_stage"), - - CURRENT_STAGE_REJECT_REASON("current_stage,reject_reason"), - - JOB("job"), - - JOB_CREDITED_TO("job,credited_to"), - - JOB_CREDITED_TO_CURRENT_STAGE("job,credited_to,current_stage"), - - JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("job,credited_to,current_stage,reject_reason"), - - JOB_CREDITED_TO_REJECT_REASON("job,credited_to,reject_reason"), - - JOB_CURRENT_STAGE("job,current_stage"), - - JOB_CURRENT_STAGE_REJECT_REASON("job,current_stage,reject_reason"), - - JOB_REJECT_REASON("job,reject_reason"), - - OFFERS("offers"), - - OFFERS_CANDIDATE("offers,candidate"), - - OFFERS_CANDIDATE_CREDITED_TO("offers,candidate,credited_to"), - - OFFERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE("offers,candidate,credited_to,current_stage"), - - OFFERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_CANDIDATE_CREDITED_TO_REJECT_REASON("offers,candidate,credited_to,reject_reason"), - - OFFERS_CANDIDATE_CURRENT_STAGE("offers,candidate,current_stage"), - - OFFERS_CANDIDATE_CURRENT_STAGE_REJECT_REASON("offers,candidate,current_stage,reject_reason"), - - OFFERS_CANDIDATE_JOB("offers,candidate,job"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO("offers,candidate,job,credited_to"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE("offers,candidate,job,credited_to,current_stage"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON("offers,candidate,job,credited_to,reject_reason"), - - OFFERS_CANDIDATE_JOB_CURRENT_STAGE("offers,candidate,job,current_stage"), - - OFFERS_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON("offers,candidate,job,current_stage,reject_reason"), - - OFFERS_CANDIDATE_JOB_REJECT_REASON("offers,candidate,job,reject_reason"), - - OFFERS_CANDIDATE_REJECT_REASON("offers,candidate,reject_reason"), - - OFFERS_CREDITED_TO("offers,credited_to"), - - OFFERS_CREDITED_TO_CURRENT_STAGE("offers,credited_to,current_stage"), - - OFFERS_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("offers,credited_to,current_stage,reject_reason"), - - OFFERS_CREDITED_TO_REJECT_REASON("offers,credited_to,reject_reason"), - - OFFERS_CURRENT_STAGE("offers,current_stage"), - - OFFERS_CURRENT_STAGE_REJECT_REASON("offers,current_stage,reject_reason"), - - OFFERS_JOB("offers,job"), - - OFFERS_JOB_CREDITED_TO("offers,job,credited_to"), - - OFFERS_JOB_CREDITED_TO_CURRENT_STAGE("offers,job,credited_to,current_stage"), - - OFFERS_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("offers,job,credited_to,current_stage,reject_reason"), - - OFFERS_JOB_CREDITED_TO_REJECT_REASON("offers,job,credited_to,reject_reason"), - - OFFERS_JOB_CURRENT_STAGE("offers,job,current_stage"), - - OFFERS_JOB_CURRENT_STAGE_REJECT_REASON("offers,job,current_stage,reject_reason"), - - OFFERS_JOB_REJECT_REASON("offers,job,reject_reason"), - - OFFERS_REJECT_REASON("offers,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS("offers,screening_question_answers"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE("offers,screening_question_answers,candidate"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO("offers,screening_question_answers,candidate,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,candidate,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,candidate,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE( - "offers,screening_question_answers,candidate,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB("offers,screening_question_answers,candidate,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO( - "offers,screening_question_answers,candidate,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,candidate,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,candidate,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE( - "offers,screening_question_answers,candidate,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_REJECT_REASON( - "offers,screening_question_answers,candidate,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_REJECT_REASON( - "offers,screening_question_answers,candidate,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO("offers,screening_question_answers,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CURRENT_STAGE("offers,screening_question_answers,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB("offers,screening_question_answers,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO("offers,screening_question_answers,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE("offers,screening_question_answers,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_REJECT_REASON("offers,screening_question_answers,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_REJECT_REASON("offers,screening_question_answers,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION( - "offers,screening_question_answers,screening_question_answers.question"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE( - "offers,screening_question_answers,screening_question_answers.question,candidate"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB( - "offers,screening_question_answers,screening_question_answers.question,candidate,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB( - "offers,screening_question_answers,screening_question_answers.question,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION("offers,screening_question_answers.question"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE("offers,screening_question_answers.question,candidate"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "offers,screening_question_answers.question,candidate,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,candidate,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB( - "offers,screening_question_answers.question,candidate,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "offers,screening_question_answers.question,candidate,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO("offers,screening_question_answers.question,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE( - "offers,screening_question_answers.question,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB("offers,screening_question_answers.question,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO( - "offers,screening_question_answers.question,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE( - "offers,screening_question_answers.question,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON( - "offers,screening_question_answers.question,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON( - "offers,screening_question_answers.question,reject_reason"), - - REJECT_REASON("reject_reason"), - - SCREENING_QUESTION_ANSWERS("screening_question_answers"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE("screening_question_answers,candidate"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO("screening_question_answers,candidate,credited_to"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,candidate,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_REJECT_REASON( - "screening_question_answers,candidate,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE("screening_question_answers,candidate,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB("screening_question_answers,candidate,job"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO("screening_question_answers,candidate,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,candidate,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,candidate,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE("screening_question_answers,candidate,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_REJECT_REASON("screening_question_answers,candidate,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_REJECT_REASON("screening_question_answers,candidate,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO("screening_question_answers,credited_to"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE("screening_question_answers,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO_REJECT_REASON("screening_question_answers,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CURRENT_STAGE("screening_question_answers,current_stage"), - - SCREENING_QUESTION_ANSWERS_CURRENT_STAGE_REJECT_REASON("screening_question_answers,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB("screening_question_answers,job"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO("screening_question_answers,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE("screening_question_answers,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB_REJECT_REASON("screening_question_answers,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_REJECT_REASON("screening_question_answers,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION( - "screening_question_answers,screening_question_answers.question"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE( - "screening_question_answers,screening_question_answers.question,candidate"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,candidate,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB( - "screening_question_answers,screening_question_answers.question,candidate,job"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB( - "screening_question_answers,screening_question_answers.question,job"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION("screening_question_answers.question"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE("screening_question_answers.question,candidate"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "screening_question_answers.question,candidate,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,candidate,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,candidate,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "screening_question_answers.question,candidate,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB("screening_question_answers.question,candidate,job"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "screening_question_answers.question,candidate,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,candidate,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "screening_question_answers.question,candidate,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "screening_question_answers.question,candidate,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "screening_question_answers.question,candidate,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO("screening_question_answers.question,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE("screening_question_answers.question,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB("screening_question_answers.question,job"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO("screening_question_answers.question,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE("screening_question_answers.question,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON("screening_question_answers.question,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON("screening_question_answers.question,reject_reason"); - - private final String value; - - ApplicationsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/applications/types/ApplicationsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ats/applications/types/ApplicationsRetrieveRequestExpand.java deleted file mode 100644 index 6a71bb5f0..000000000 --- a/src/main/java/com/merge/api/resources/ats/applications/types/ApplicationsRetrieveRequestExpand.java +++ /dev/null @@ -1,680 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.applications.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ApplicationsRetrieveRequestExpand { - CANDIDATE("candidate"), - - CANDIDATE_CREDITED_TO("candidate,credited_to"), - - CANDIDATE_CREDITED_TO_CURRENT_STAGE("candidate,credited_to,current_stage"), - - CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("candidate,credited_to,current_stage,reject_reason"), - - CANDIDATE_CREDITED_TO_REJECT_REASON("candidate,credited_to,reject_reason"), - - CANDIDATE_CURRENT_STAGE("candidate,current_stage"), - - CANDIDATE_CURRENT_STAGE_REJECT_REASON("candidate,current_stage,reject_reason"), - - CANDIDATE_JOB("candidate,job"), - - CANDIDATE_JOB_CREDITED_TO("candidate,job,credited_to"), - - CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE("candidate,job,credited_to,current_stage"), - - CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("candidate,job,credited_to,current_stage,reject_reason"), - - CANDIDATE_JOB_CREDITED_TO_REJECT_REASON("candidate,job,credited_to,reject_reason"), - - CANDIDATE_JOB_CURRENT_STAGE("candidate,job,current_stage"), - - CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON("candidate,job,current_stage,reject_reason"), - - CANDIDATE_JOB_REJECT_REASON("candidate,job,reject_reason"), - - CANDIDATE_REJECT_REASON("candidate,reject_reason"), - - CREDITED_TO("credited_to"), - - CREDITED_TO_CURRENT_STAGE("credited_to,current_stage"), - - CREDITED_TO_CURRENT_STAGE_REJECT_REASON("credited_to,current_stage,reject_reason"), - - CREDITED_TO_REJECT_REASON("credited_to,reject_reason"), - - CURRENT_STAGE("current_stage"), - - CURRENT_STAGE_REJECT_REASON("current_stage,reject_reason"), - - JOB("job"), - - JOB_CREDITED_TO("job,credited_to"), - - JOB_CREDITED_TO_CURRENT_STAGE("job,credited_to,current_stage"), - - JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("job,credited_to,current_stage,reject_reason"), - - JOB_CREDITED_TO_REJECT_REASON("job,credited_to,reject_reason"), - - JOB_CURRENT_STAGE("job,current_stage"), - - JOB_CURRENT_STAGE_REJECT_REASON("job,current_stage,reject_reason"), - - JOB_REJECT_REASON("job,reject_reason"), - - OFFERS("offers"), - - OFFERS_CANDIDATE("offers,candidate"), - - OFFERS_CANDIDATE_CREDITED_TO("offers,candidate,credited_to"), - - OFFERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE("offers,candidate,credited_to,current_stage"), - - OFFERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_CANDIDATE_CREDITED_TO_REJECT_REASON("offers,candidate,credited_to,reject_reason"), - - OFFERS_CANDIDATE_CURRENT_STAGE("offers,candidate,current_stage"), - - OFFERS_CANDIDATE_CURRENT_STAGE_REJECT_REASON("offers,candidate,current_stage,reject_reason"), - - OFFERS_CANDIDATE_JOB("offers,candidate,job"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO("offers,candidate,job,credited_to"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE("offers,candidate,job,credited_to,current_stage"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON("offers,candidate,job,credited_to,reject_reason"), - - OFFERS_CANDIDATE_JOB_CURRENT_STAGE("offers,candidate,job,current_stage"), - - OFFERS_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON("offers,candidate,job,current_stage,reject_reason"), - - OFFERS_CANDIDATE_JOB_REJECT_REASON("offers,candidate,job,reject_reason"), - - OFFERS_CANDIDATE_REJECT_REASON("offers,candidate,reject_reason"), - - OFFERS_CREDITED_TO("offers,credited_to"), - - OFFERS_CREDITED_TO_CURRENT_STAGE("offers,credited_to,current_stage"), - - OFFERS_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("offers,credited_to,current_stage,reject_reason"), - - OFFERS_CREDITED_TO_REJECT_REASON("offers,credited_to,reject_reason"), - - OFFERS_CURRENT_STAGE("offers,current_stage"), - - OFFERS_CURRENT_STAGE_REJECT_REASON("offers,current_stage,reject_reason"), - - OFFERS_JOB("offers,job"), - - OFFERS_JOB_CREDITED_TO("offers,job,credited_to"), - - OFFERS_JOB_CREDITED_TO_CURRENT_STAGE("offers,job,credited_to,current_stage"), - - OFFERS_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON("offers,job,credited_to,current_stage,reject_reason"), - - OFFERS_JOB_CREDITED_TO_REJECT_REASON("offers,job,credited_to,reject_reason"), - - OFFERS_JOB_CURRENT_STAGE("offers,job,current_stage"), - - OFFERS_JOB_CURRENT_STAGE_REJECT_REASON("offers,job,current_stage,reject_reason"), - - OFFERS_JOB_REJECT_REASON("offers,job,reject_reason"), - - OFFERS_REJECT_REASON("offers,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS("offers,screening_question_answers"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE("offers,screening_question_answers,candidate"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO("offers,screening_question_answers,candidate,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,candidate,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,candidate,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE( - "offers,screening_question_answers,candidate,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB("offers,screening_question_answers,candidate,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO( - "offers,screening_question_answers,candidate,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,candidate,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,candidate,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE( - "offers,screening_question_answers,candidate,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,candidate,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_REJECT_REASON( - "offers,screening_question_answers,candidate,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CANDIDATE_REJECT_REASON( - "offers,screening_question_answers,candidate,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO("offers,screening_question_answers,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CURRENT_STAGE("offers,screening_question_answers,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB("offers,screening_question_answers,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO("offers,screening_question_answers,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE("offers,screening_question_answers,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_JOB_REJECT_REASON("offers,screening_question_answers,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_REJECT_REASON("offers,screening_question_answers,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION( - "offers,screening_question_answers,screening_question_answers.question"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE( - "offers,screening_question_answers,screening_question_answers.question,candidate"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB( - "offers,screening_question_answers,screening_question_answers.question,candidate,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,candidate,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB( - "offers,screening_question_answers,screening_question_answers.question,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE( - "offers,screening_question_answers,screening_question_answers.question,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON( - "offers,screening_question_answers,screening_question_answers.question,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION("offers,screening_question_answers.question"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE("offers,screening_question_answers.question,candidate"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "offers,screening_question_answers.question,candidate,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,candidate,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB( - "offers,screening_question_answers.question,candidate,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "offers,screening_question_answers.question,candidate,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "offers,screening_question_answers.question,candidate,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "offers,screening_question_answers.question,candidate,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "offers,screening_question_answers.question,candidate,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO("offers,screening_question_answers.question,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE( - "offers,screening_question_answers.question,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB("offers,screening_question_answers.question,job"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO( - "offers,screening_question_answers.question,job,credited_to"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "offers,screening_question_answers.question,job,credited_to,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "offers,screening_question_answers.question,job,credited_to,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE( - "offers,screening_question_answers.question,job,current_stage"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "offers,screening_question_answers.question,job,current_stage,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON( - "offers,screening_question_answers.question,job,reject_reason"), - - OFFERS_SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON( - "offers,screening_question_answers.question,reject_reason"), - - REJECT_REASON("reject_reason"), - - SCREENING_QUESTION_ANSWERS("screening_question_answers"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE("screening_question_answers,candidate"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO("screening_question_answers,candidate,credited_to"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,candidate,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CREDITED_TO_REJECT_REASON( - "screening_question_answers,candidate,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE("screening_question_answers,candidate,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB("screening_question_answers,candidate,job"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO("screening_question_answers,candidate,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,candidate,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,candidate,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE("screening_question_answers,candidate,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,candidate,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_JOB_REJECT_REASON("screening_question_answers,candidate,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CANDIDATE_REJECT_REASON("screening_question_answers,candidate,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO("screening_question_answers,credited_to"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE("screening_question_answers,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CREDITED_TO_REJECT_REASON("screening_question_answers,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_CURRENT_STAGE("screening_question_answers,current_stage"), - - SCREENING_QUESTION_ANSWERS_CURRENT_STAGE_REJECT_REASON("screening_question_answers,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB("screening_question_answers,job"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO("screening_question_answers,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE("screening_question_answers,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_JOB_REJECT_REASON("screening_question_answers,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_REJECT_REASON("screening_question_answers,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION( - "screening_question_answers,screening_question_answers.question"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE( - "screening_question_answers,screening_question_answers.question,candidate"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,candidate,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB( - "screening_question_answers,screening_question_answers.question,candidate,job"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,candidate,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,candidate,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB( - "screening_question_answers,screening_question_answers.question,job"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO( - "screening_question_answers,screening_question_answers.question,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE( - "screening_question_answers,screening_question_answers.question,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON( - "screening_question_answers,screening_question_answers.question,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION("screening_question_answers.question"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE("screening_question_answers.question,candidate"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO( - "screening_question_answers.question,candidate,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,candidate,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,candidate,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE( - "screening_question_answers.question,candidate,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB("screening_question_answers.question,candidate,job"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO( - "screening_question_answers.question,candidate,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,candidate,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,candidate,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE( - "screening_question_answers.question,candidate,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,candidate,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_JOB_REJECT_REASON( - "screening_question_answers.question,candidate,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CANDIDATE_REJECT_REASON( - "screening_question_answers.question,candidate,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO("screening_question_answers.question,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE("screening_question_answers.question,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB("screening_question_answers.question,job"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO("screening_question_answers.question,job,credited_to"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE( - "screening_question_answers.question,job,credited_to,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,job,credited_to,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CREDITED_TO_REJECT_REASON( - "screening_question_answers.question,job,credited_to,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE("screening_question_answers.question,job,current_stage"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_CURRENT_STAGE_REJECT_REASON( - "screening_question_answers.question,job,current_stage,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_JOB_REJECT_REASON("screening_question_answers.question,job,reject_reason"), - - SCREENING_QUESTION_ANSWERS_QUESTION_REJECT_REASON("screening_question_answers.question,reject_reason"); - - private final String value; - - ApplicationsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/api/resources/ats/asyncpassthrough/AsyncPassthroughClient.java deleted file mode 100644 index 30fb918fc..000000000 --- a/src/main/java/com/merge/api/resources/ats/asyncpassthrough/AsyncPassthroughClient.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.asyncpassthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; -import com.merge.api.resources.ats.types.AsyncPassthroughReciept; -import com.merge.api.resources.ats.types.DataPassthroughRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AsyncPassthroughClient { - protected final ClientOptions clientOptions; - - public AsyncPassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/async-passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), AsyncPassthroughReciept.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); - } - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/async-passthrough") - .addPathSegment(asyncPassthroughReceiptId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AsyncPassthroughRetrieveResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/resources/ats/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java deleted file mode 100644 index ff6e725d8..000000000 --- a/src/main/java/com/merge/api/resources/ats/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.asyncpassthrough.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.RemoteResponse; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) -public final class AsyncPassthroughRetrieveResponse { - private final Object value; - - private final int type; - - private AsyncPassthroughRetrieveResponse(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RemoteResponse) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); - } - - private boolean equalTo(AsyncPassthroughRetrieveResponse other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { - return new AsyncPassthroughRetrieveResponse(value, 0); - } - - public static AsyncPassthroughRetrieveResponse of(String value) { - return new AsyncPassthroughRetrieveResponse(value, 1); - } - - public interface Visitor { - T visit(RemoteResponse value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AsyncPassthroughRetrieveResponse.class); - } - - @java.lang.Override - public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/attachments/AttachmentsClient.java b/src/main/java/com/merge/api/resources/ats/attachments/AttachmentsClient.java deleted file mode 100644 index 6460df6fd..000000000 --- a/src/main/java/com/merge/api/resources/ats/attachments/AttachmentsClient.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.attachments; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.attachments.requests.AttachmentEndpointRequest; -import com.merge.api.resources.ats.attachments.requests.AttachmentsListRequest; -import com.merge.api.resources.ats.attachments.requests.AttachmentsRetrieveRequest; -import com.merge.api.resources.ats.types.Attachment; -import com.merge.api.resources.ats.types.AttachmentResponse; -import com.merge.api.resources.ats.types.MetaResponse; -import com.merge.api.resources.ats.types.PaginatedAttachmentList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AttachmentsClient { - protected final ClientOptions clientOptions; - - public AttachmentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Attachment objects. - */ - public PaginatedAttachmentList list() { - return list(AttachmentsListRequest.builder().build()); - } - - /** - * Returns a list of Attachment objects. - */ - public PaginatedAttachmentList list(AttachmentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Attachment objects. - */ - public PaginatedAttachmentList list(AttachmentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/attachments"); - if (request.getCandidateId().isPresent()) { - httpUrl.addQueryParameter("candidate_id", request.getCandidateId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAttachmentList.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); - } - } - - /** - * Creates an Attachment object with the given values. - */ - public AttachmentResponse create(AttachmentEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Attachment object with the given values. - */ - public AttachmentResponse create(AttachmentEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/attachments"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), AttachmentResponse.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); - } - } - - /** - * Returns an Attachment object with the given id. - */ - public Attachment retrieve(String id) { - return retrieve(id, AttachmentsRetrieveRequest.builder().build()); - } - - /** - * Returns an Attachment object with the given id. - */ - public Attachment retrieve(String id, AttachmentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Attachment object with the given id. - */ - public Attachment retrieve(String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/attachments") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Attachment.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); - } - } - - /** - * Returns metadata for Attachment POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Attachment POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/attachments/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentsListRequest.java b/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentsListRequest.java deleted file mode 100644 index 25a4158d6..000000000 --- a/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentsListRequest.java +++ /dev/null @@ -1,481 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.attachments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentsListRequest.Builder.class) -public final class AttachmentsListRequest { - private final Optional candidateId; - - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteFields; - - private final Optional remoteId; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private AttachmentsListRequest( - Optional candidateId, - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteFields, - Optional remoteId, - Optional showEnumOrigins, - Map additionalProperties) { - this.candidateId = candidateId; - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteFields = remoteFields; - this.remoteId = remoteId; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return attachments for this candidate. - */ - @JsonProperty("candidate_id") - public Optional getCandidateId() { - return candidateId; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentsListRequest && equalTo((AttachmentsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentsListRequest other) { - return candidateId.equals(other.candidateId) - && createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteFields.equals(other.remoteFields) - && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.candidateId, - this.createdAfter, - this.createdBefore, - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteFields, - this.remoteId, - this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional candidateId = Optional.empty(); - - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentsListRequest other) { - candidateId(other.getCandidateId()); - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteFields(other.getRemoteFields()); - remoteId(other.getRemoteId()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "candidate_id", nulls = Nulls.SKIP) - public Builder candidateId(Optional candidateId) { - this.candidateId = candidateId; - return this; - } - - public Builder candidateId(String candidateId) { - this.candidateId = Optional.ofNullable(candidateId); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public AttachmentsListRequest build() { - return new AttachmentsListRequest( - candidateId, - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteFields, - remoteId, - showEnumOrigins, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentsRetrieveRequest.java deleted file mode 100644 index d4c64ee9d..000000000 --- a/src/main/java/com/merge/api/resources/ats/attachments/requests/AttachmentsRetrieveRequest.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.attachments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) -public final class AttachmentsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private AttachmentsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentsRetrieveRequest && equalTo((AttachmentsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public AttachmentsRetrieveRequest build() { - return new AttachmentsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/audittrail/AuditTrailClient.java b/src/main/java/com/merge/api/resources/ats/audittrail/AuditTrailClient.java deleted file mode 100644 index f664bcb86..000000000 --- a/src/main/java/com/merge/api/resources/ats/audittrail/AuditTrailClient.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.audittrail; - -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.ats.audittrail.requests.AuditTrailListRequest; -import com.merge.api.resources.ats.types.PaginatedAuditLogEventList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AuditTrailClient { - protected final ClientOptions clientOptions; - - public AuditTrailClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list() { - return list(AuditTrailListRequest.builder().build()); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request) { - return list(request, null); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/audit-trail"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEventType().isPresent()) { - httpUrl.addQueryParameter("event_type", request.getEventType().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getUserEmail().isPresent()) { - httpUrl.addQueryParameter("user_email", request.getUserEmail().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAuditLogEventList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/api/resources/ats/audittrail/requests/AuditTrailListRequest.java deleted file mode 100644 index 930558b93..000000000 --- a/src/main/java/com/merge/api/resources/ats/audittrail/requests/AuditTrailListRequest.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.audittrail.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) -public final class AuditTrailListRequest { - private final Optional cursor; - - private final Optional endDate; - - private final Optional eventType; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional userEmail; - - private final Map additionalProperties; - - private AuditTrailListRequest( - Optional cursor, - Optional endDate, - Optional eventType, - Optional pageSize, - Optional startDate, - Optional userEmail, - Map additionalProperties) { - this.cursor = cursor; - this.endDate = endDate; - this.eventType = eventType; - this.pageSize = pageSize; - this.startDate = startDate; - this.userEmail = userEmail; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include audit trail events that occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - /** - * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED - */ - @JsonProperty("event_type") - public Optional getEventType() { - return eventType; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include audit trail events that occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditTrailListRequest other) { - return cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && eventType.equals(other.eventType) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && userEmail.equals(other.userEmail); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional eventType = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AuditTrailListRequest other) { - cursor(other.getCursor()); - endDate(other.getEndDate()); - eventType(other.getEventType()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - userEmail(other.getUserEmail()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "event_type", nulls = Nulls.SKIP) - public Builder eventType(Optional eventType) { - this.eventType = eventType; - return this; - } - - public Builder eventType(String eventType) { - this.eventType = Optional.ofNullable(eventType); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public Builder userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - public Builder userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - public AuditTrailListRequest build() { - return new AuditTrailListRequest( - cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/api/resources/ats/availableactions/AvailableActionsClient.java deleted file mode 100644 index f8daac9b3..000000000 --- a/src/main/java/com/merge/api/resources/ats/availableactions/AvailableActionsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.availableactions; - -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.ats.types.AvailableActions; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AvailableActionsClient { - protected final ClientOptions clientOptions; - - public AvailableActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve() { - return retrieve(null); - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/available-actions") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AvailableActions.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/candidates/CandidatesClient.java b/src/main/java/com/merge/api/resources/ats/candidates/CandidatesClient.java deleted file mode 100644 index 09f378046..000000000 --- a/src/main/java/com/merge/api/resources/ats/candidates/CandidatesClient.java +++ /dev/null @@ -1,442 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.candidates; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.candidates.requests.CandidateEndpointRequest; -import com.merge.api.resources.ats.candidates.requests.CandidatesListRequest; -import com.merge.api.resources.ats.candidates.requests.CandidatesRetrieveRequest; -import com.merge.api.resources.ats.candidates.requests.IgnoreCommonModelRequest; -import com.merge.api.resources.ats.candidates.requests.PatchedCandidateEndpointRequest; -import com.merge.api.resources.ats.types.Candidate; -import com.merge.api.resources.ats.types.CandidateResponse; -import com.merge.api.resources.ats.types.MetaResponse; -import com.merge.api.resources.ats.types.PaginatedCandidateList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CandidatesClient { - protected final ClientOptions clientOptions; - - public CandidatesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Candidate objects. - */ - public PaginatedCandidateList list() { - return list(CandidatesListRequest.builder().build()); - } - - /** - * Returns a list of Candidate objects. - */ - public PaginatedCandidateList list(CandidatesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Candidate objects. - */ - public PaginatedCandidateList list(CandidatesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/candidates"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmailAddresses().isPresent()) { - httpUrl.addQueryParameter( - "email_addresses", request.getEmailAddresses().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getFirstName().isPresent()) { - httpUrl.addQueryParameter("first_name", request.getFirstName().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getLastName().isPresent()) { - httpUrl.addQueryParameter("last_name", request.getLastName().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTags().isPresent()) { - httpUrl.addQueryParameter("tags", request.getTags().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCandidateList.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); - } - } - - /** - * Creates a Candidate object with the given values. - */ - public CandidateResponse create(CandidateEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Candidate object with the given values. - */ - public CandidateResponse create(CandidateEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/candidates"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CandidateResponse.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); - } - } - - /** - * Returns a Candidate object with the given id. - */ - public Candidate retrieve(String id) { - return retrieve(id, CandidatesRetrieveRequest.builder().build()); - } - - /** - * Returns a Candidate object with the given id. - */ - public Candidate retrieve(String id, CandidatesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Candidate object with the given id. - */ - public Candidate retrieve(String id, CandidatesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/candidates") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Candidate.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); - } - } - - /** - * Updates a Candidate object with the given id. - */ - public CandidateResponse partialUpdate(String id, PatchedCandidateEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates a Candidate object with the given id. - */ - public CandidateResponse partialUpdate( - String id, PatchedCandidateEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/candidates") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CandidateResponse.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); - } - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { - ignoreCreate(modelId, request, null); - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/candidates/ignore") - .addPathSegment(modelId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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; - } - 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); - } - } - - /** - * Returns metadata for Candidate PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for Candidate PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/candidates/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for Candidate POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Candidate POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/candidates/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/candidates/requests/CandidatesRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/candidates/requests/CandidatesRetrieveRequest.java deleted file mode 100644 index a4c19131a..000000000 --- a/src/main/java/com/merge/api/resources/ats/candidates/requests/CandidatesRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.candidates.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.candidates.types.CandidatesRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CandidatesRetrieveRequest.Builder.class) -public final class CandidatesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private CandidatesRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CandidatesRetrieveRequest && equalTo((CandidatesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CandidatesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CandidatesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CandidatesRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public CandidatesRetrieveRequest build() { - return new CandidatesRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/candidates/requests/IgnoreCommonModelRequest.java b/src/main/java/com/merge/api/resources/ats/candidates/requests/IgnoreCommonModelRequest.java deleted file mode 100644 index 43579cecc..000000000 --- a/src/main/java/com/merge/api/resources/ats/candidates/requests/IgnoreCommonModelRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.candidates.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.ReasonEnum; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IgnoreCommonModelRequest.Builder.class) -public final class IgnoreCommonModelRequest { - private final ReasonEnum reason; - - private final Optional message; - - private final Map additionalProperties; - - private IgnoreCommonModelRequest( - ReasonEnum reason, Optional message, Map additionalProperties) { - this.reason = reason; - this.message = message; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("reason") - public ReasonEnum getReason() { - return reason; - } - - @JsonProperty("message") - public Optional getMessage() { - return message; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IgnoreCommonModelRequest && equalTo((IgnoreCommonModelRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IgnoreCommonModelRequest other) { - return reason.equals(other.reason) && message.equals(other.message); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.reason, this.message); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ReasonStage builder() { - return new Builder(); - } - - public interface ReasonStage { - _FinalStage reason(@NotNull ReasonEnum reason); - - Builder from(IgnoreCommonModelRequest other); - } - - public interface _FinalStage { - IgnoreCommonModelRequest build(); - - _FinalStage message(Optional message); - - _FinalStage message(String message); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ReasonStage, _FinalStage { - private ReasonEnum reason; - - private Optional message = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IgnoreCommonModelRequest other) { - reason(other.getReason()); - message(other.getMessage()); - return this; - } - - @java.lang.Override - @JsonSetter("reason") - public _FinalStage reason(@NotNull ReasonEnum reason) { - this.reason = reason; - return this; - } - - @java.lang.Override - public _FinalStage message(String message) { - this.message = Optional.ofNullable(message); - return this; - } - - @java.lang.Override - @JsonSetter(value = "message", nulls = Nulls.SKIP) - public _FinalStage message(Optional message) { - this.message = message; - return this; - } - - @java.lang.Override - public IgnoreCommonModelRequest build() { - return new IgnoreCommonModelRequest(reason, message, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/candidates/types/CandidatesListRequestExpand.java b/src/main/java/com/merge/api/resources/ats/candidates/types/CandidatesListRequestExpand.java deleted file mode 100644 index 887b8b516..000000000 --- a/src/main/java/com/merge/api/resources/ats/candidates/types/CandidatesListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.candidates.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CandidatesListRequestExpand { - APPLICATIONS("applications"), - - APPLICATIONS_ATTACHMENTS("applications,attachments"), - - ATTACHMENTS("attachments"); - - private final String value; - - CandidatesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/candidates/types/CandidatesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ats/candidates/types/CandidatesRetrieveRequestExpand.java deleted file mode 100644 index 210e8fc4a..000000000 --- a/src/main/java/com/merge/api/resources/ats/candidates/types/CandidatesRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.candidates.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CandidatesRetrieveRequestExpand { - APPLICATIONS("applications"), - - APPLICATIONS_ATTACHMENTS("applications,attachments"), - - ATTACHMENTS("attachments"); - - private final String value; - - CandidatesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/api/resources/ats/deleteaccount/DeleteAccountClient.java deleted file mode 100644 index ffa66f1ce..000000000 --- a/src/main/java/com/merge/api/resources/ats/deleteaccount/DeleteAccountClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.deleteaccount; - -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 java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DeleteAccountClient { - protected final ClientOptions clientOptions; - - public DeleteAccountClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Delete a linked account. - */ - public void delete() { - delete(null); - } - - /** - * Delete a linked account. - */ - public void delete(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/delete-account") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .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; - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/departments/DepartmentsClient.java b/src/main/java/com/merge/api/resources/ats/departments/DepartmentsClient.java deleted file mode 100644 index 100dae2e1..000000000 --- a/src/main/java/com/merge/api/resources/ats/departments/DepartmentsClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.departments; - -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.ats.departments.requests.DepartmentsListRequest; -import com.merge.api.resources.ats.departments.requests.DepartmentsRetrieveRequest; -import com.merge.api.resources.ats.types.Department; -import com.merge.api.resources.ats.types.PaginatedDepartmentList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DepartmentsClient { - protected final ClientOptions clientOptions; - - public DepartmentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Department objects. - */ - public PaginatedDepartmentList list() { - return list(DepartmentsListRequest.builder().build()); - } - - /** - * Returns a list of Department objects. - */ - public PaginatedDepartmentList list(DepartmentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Department objects. - */ - public PaginatedDepartmentList list(DepartmentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/departments"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedDepartmentList.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); - } - } - - /** - * Returns a Department object with the given id. - */ - public Department retrieve(String id) { - return retrieve(id, DepartmentsRetrieveRequest.builder().build()); - } - - /** - * Returns a Department object with the given id. - */ - public Department retrieve(String id, DepartmentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Department object with the given id. - */ - public Department retrieve(String id, DepartmentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/departments") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Department.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/departments/requests/DepartmentsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/departments/requests/DepartmentsRetrieveRequest.java deleted file mode 100644 index 4d6e12a29..000000000 --- a/src/main/java/com/merge/api/resources/ats/departments/requests/DepartmentsRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.departments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DepartmentsRetrieveRequest.Builder.class) -public final class DepartmentsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private DepartmentsRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DepartmentsRetrieveRequest && equalTo((DepartmentsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DepartmentsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(DepartmentsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public DepartmentsRetrieveRequest build() { - return new DepartmentsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/eeocs/EeocsClient.java b/src/main/java/com/merge/api/resources/ats/eeocs/EeocsClient.java deleted file mode 100644 index 7d5366907..000000000 --- a/src/main/java/com/merge/api/resources/ats/eeocs/EeocsClient.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.eeocs; - -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.ats.eeocs.requests.EeocsListRequest; -import com.merge.api.resources.ats.eeocs.requests.EeocsRetrieveRequest; -import com.merge.api.resources.ats.types.Eeoc; -import com.merge.api.resources.ats.types.PaginatedEeocList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EeocsClient { - protected final ClientOptions clientOptions; - - public EeocsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of EEOC objects. - */ - public PaginatedEeocList list() { - return list(EeocsListRequest.builder().build()); - } - - /** - * Returns a list of EEOC objects. - */ - public PaginatedEeocList list(EeocsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of EEOC objects. - */ - public PaginatedEeocList list(EeocsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/eeocs"); - if (request.getCandidateId().isPresent()) { - httpUrl.addQueryParameter("candidate_id", request.getCandidateId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEeocList.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); - } - } - - /** - * Returns an EEOC object with the given id. - */ - public Eeoc retrieve(String id) { - return retrieve(id, EeocsRetrieveRequest.builder().build()); - } - - /** - * Returns an EEOC object with the given id. - */ - public Eeoc retrieve(String id, EeocsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an EEOC object with the given id. - */ - public Eeoc retrieve(String id, EeocsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/eeocs") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Eeoc.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/api/resources/ats/fieldmapping/FieldMappingClient.java deleted file mode 100644 index ab6e172f0..000000000 --- a/src/main/java/com/merge/api/resources/ats/fieldmapping/FieldMappingClient.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.fieldmapping; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.fieldmapping.requests.CreateFieldMappingRequest; -import com.merge.api.resources.ats.fieldmapping.requests.FieldMappingsRetrieveRequest; -import com.merge.api.resources.ats.fieldmapping.requests.PatchedEditFieldMappingRequest; -import com.merge.api.resources.ats.fieldmapping.requests.RemoteFieldsRetrieveRequest; -import com.merge.api.resources.ats.types.ExternalTargetFieldApiResponse; -import com.merge.api.resources.ats.types.FieldMappingApiInstanceResponse; -import com.merge.api.resources.ats.types.FieldMappingInstanceResponse; -import com.merge.api.resources.ats.types.RemoteFieldApiResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FieldMappingClient { - protected final ClientOptions clientOptions; - - public FieldMappingClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { - return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { - return fieldMappingsRetrieve(request, null); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve( - FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingApiInstanceResponse.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); - } - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { - return fieldMappingsCreate(request, null); - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate( - CreateFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { - return fieldMappingsPartialUpdate( - fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request) { - return fieldMappingsPartialUpdate(fieldMappingId, request, null); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve() { - return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { - return remoteFieldsRetrieve(request, null); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve( - RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/remote-fields"); - if (request.getCommonModels().isPresent()) { - httpUrl.addQueryParameter("common_models", request.getCommonModels().get()); - } - if (request.getIncludeExampleValues().isPresent()) { - httpUrl.addQueryParameter( - "include_example_values", request.getIncludeExampleValues().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RemoteFieldApiResponse.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); - } - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve() { - return targetFieldsRetrieve(null); - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/target-fields") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), ExternalTargetFieldApiResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/CreateFieldMappingRequest.java deleted file mode 100644 index a5e3a97da..000000000 --- a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/CreateFieldMappingRequest.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) -public final class CreateFieldMappingRequest { - private final Optional excludeRemoteFieldMetadata; - - private final String targetFieldName; - - private final String targetFieldDescription; - - private final List remoteFieldTraversalPath; - - private final String remoteMethod; - - private final String remoteUrlPath; - - private final String commonModelName; - - private final Map additionalProperties; - - private CreateFieldMappingRequest( - Optional excludeRemoteFieldMetadata, - String targetFieldName, - String targetFieldDescription, - List remoteFieldTraversalPath, - String remoteMethod, - String remoteUrlPath, - String commonModelName, - Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.targetFieldName = targetFieldName; - this.targetFieldDescription = targetFieldDescription; - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.commonModelName = commonModelName; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - /** - * @return The name of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_name") - public String getTargetFieldName() { - return targetFieldName; - } - - /** - * @return The description of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_description") - public String getTargetFieldDescription() { - return targetFieldDescription; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public List getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public String getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public String getRemoteUrlPath() { - return remoteUrlPath; - } - - /** - * @return The name of the Common Model that the remote field corresponds to in a given category. - */ - @JsonProperty("common_model_name") - public String getCommonModelName() { - return commonModelName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateFieldMappingRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) - && targetFieldName.equals(other.targetFieldName) - && targetFieldDescription.equals(other.targetFieldDescription) - && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.excludeRemoteFieldMetadata, - this.targetFieldName, - this.targetFieldDescription, - this.remoteFieldTraversalPath, - this.remoteMethod, - this.remoteUrlPath, - this.commonModelName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TargetFieldNameStage builder() { - return new Builder(); - } - - public interface TargetFieldNameStage { - TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); - - Builder from(CreateFieldMappingRequest other); - } - - public interface TargetFieldDescriptionStage { - RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); - } - - public interface RemoteMethodStage { - RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); - } - - public interface RemoteUrlPathStage { - CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); - } - - public interface CommonModelNameStage { - _FinalStage commonModelName(@NotNull String commonModelName); - } - - public interface _FinalStage { - CreateFieldMappingRequest build(); - - _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); - - _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); - - _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); - - _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); - - _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements TargetFieldNameStage, - TargetFieldDescriptionStage, - RemoteMethodStage, - RemoteUrlPathStage, - CommonModelNameStage, - _FinalStage { - private String targetFieldName; - - private String targetFieldDescription; - - private String remoteMethod; - - private String remoteUrlPath; - - private String commonModelName; - - private List remoteFieldTraversalPath = new ArrayList<>(); - - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateFieldMappingRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - targetFieldName(other.getTargetFieldName()); - targetFieldDescription(other.getTargetFieldDescription()); - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - commonModelName(other.getCommonModelName()); - return this; - } - - /** - *

The name of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_name") - public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { - this.targetFieldName = targetFieldName; - return this; - } - - /** - *

The description of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_description") - public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { - this.targetFieldDescription = targetFieldDescription; - return this; - } - - /** - *

The method of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_method") - public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - /** - *

The path of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_url_path") - public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - /** - *

The name of the Common Model that the remote field corresponds to in a given category.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("common_model_name") - public _FinalStage commonModelName(@NotNull String commonModelName) { - this.commonModelName = commonModelName; - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.clear(); - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - @java.lang.Override - public CreateFieldMappingRequest build() { - return new CreateFieldMappingRequest( - excludeRemoteFieldMetadata, - targetFieldName, - targetFieldDescription, - remoteFieldTraversalPath, - remoteMethod, - remoteUrlPath, - commonModelName, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/FieldMappingsRetrieveRequest.java deleted file mode 100644 index 01ea35d88..000000000 --- a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/FieldMappingsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) -public final class FieldMappingsRetrieveRequest { - private final Optional excludeRemoteFieldMetadata; - - private final Map additionalProperties; - - private FieldMappingsRetrieveRequest( - Optional excludeRemoteFieldMetadata, Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingsRetrieveRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingsRetrieveRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - return this; - } - - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - public FieldMappingsRetrieveRequest build() { - return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/PatchedEditFieldMappingRequest.java deleted file mode 100644 index 59a653d7e..000000000 --- a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/PatchedEditFieldMappingRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) -public final class PatchedEditFieldMappingRequest { - private final Optional> remoteFieldTraversalPath; - - private final Optional remoteMethod; - - private final Optional remoteUrlPath; - - private final Map additionalProperties; - - private PatchedEditFieldMappingRequest( - Optional> remoteFieldTraversalPath, - Optional remoteMethod, - Optional remoteUrlPath, - Map additionalProperties) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.additionalProperties = additionalProperties; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public Optional> getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public Optional getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public Optional getRemoteUrlPath() { - return remoteUrlPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> remoteFieldTraversalPath = Optional.empty(); - - private Optional remoteMethod = Optional.empty(); - - private Optional remoteUrlPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PatchedEditFieldMappingRequest other) { - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - return this; - } - - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - return this; - } - - public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); - return this; - } - - @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) - public Builder remoteMethod(Optional remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - public Builder remoteMethod(String remoteMethod) { - this.remoteMethod = Optional.ofNullable(remoteMethod); - return this; - } - - @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) - public Builder remoteUrlPath(Optional remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - public Builder remoteUrlPath(String remoteUrlPath) { - this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); - return this; - } - - public PatchedEditFieldMappingRequest build() { - return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/RemoteFieldsRetrieveRequest.java deleted file mode 100644 index cf489101a..000000000 --- a/src/main/java/com/merge/api/resources/ats/fieldmapping/requests/RemoteFieldsRetrieveRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) -public final class RemoteFieldsRetrieveRequest { - private final Optional commonModels; - - private final Optional includeExampleValues; - - private final Map additionalProperties; - - private RemoteFieldsRetrieveRequest( - Optional commonModels, - Optional includeExampleValues, - Map additionalProperties) { - this.commonModels = commonModels; - this.includeExampleValues = includeExampleValues; - this.additionalProperties = additionalProperties; - } - - /** - * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. - */ - @JsonProperty("common_models") - public Optional getCommonModels() { - return commonModels; - } - - /** - * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. - */ - @JsonProperty("include_example_values") - public Optional getIncludeExampleValues() { - return includeExampleValues; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldsRetrieveRequest other) { - return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels, this.includeExampleValues); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional commonModels = Optional.empty(); - - private Optional includeExampleValues = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldsRetrieveRequest other) { - commonModels(other.getCommonModels()); - includeExampleValues(other.getIncludeExampleValues()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(Optional commonModels) { - this.commonModels = commonModels; - return this; - } - - public Builder commonModels(String commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) - public Builder includeExampleValues(Optional includeExampleValues) { - this.includeExampleValues = includeExampleValues; - return this; - } - - public Builder includeExampleValues(String includeExampleValues) { - this.includeExampleValues = Optional.ofNullable(includeExampleValues); - return this; - } - - public RemoteFieldsRetrieveRequest build() { - return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/forceresync/ForceResyncClient.java b/src/main/java/com/merge/api/resources/ats/forceresync/ForceResyncClient.java deleted file mode 100644 index 7a15ae0c2..000000000 --- a/src/main/java/com/merge/api/resources/ats/forceresync/ForceResyncClient.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.forceresync; - -import com.fasterxml.jackson.core.type.TypeReference; -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.ats.types.SyncStatus; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ForceResyncClient { - protected final ClientOptions clientOptions; - - public ForceResyncClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate() { - return syncStatusResyncCreate(null); - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/sync-status/resync") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/api/resources/ats/generatekey/GenerateKeyClient.java deleted file mode 100644 index 9ae57d105..000000000 --- a/src/main/java/com/merge/api/resources/ats/generatekey/GenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.generatekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.generatekey.requests.GenerateRemoteKeyRequest; -import com.merge.api.resources.ats.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GenerateKeyClient { - protected final ClientOptions clientOptions; - - public GenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request) { - return create(request, null); - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/generate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/resources/ats/generatekey/requests/GenerateRemoteKeyRequest.java deleted file mode 100644 index dd106a555..000000000 --- a/src/main/java/com/merge/api/resources/ats/generatekey/requests/GenerateRemoteKeyRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.generatekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) -public final class GenerateRemoteKeyRequest { - private final String name; - - private final Map additionalProperties; - - private GenerateRemoteKeyRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GenerateRemoteKeyRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(GenerateRemoteKeyRequest other); - } - - public interface _FinalStage { - GenerateRemoteKeyRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GenerateRemoteKeyRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public GenerateRemoteKeyRequest build() { - return new GenerateRemoteKeyRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/interviews/InterviewsClient.java b/src/main/java/com/merge/api/resources/ats/interviews/InterviewsClient.java deleted file mode 100644 index 44a52af77..000000000 --- a/src/main/java/com/merge/api/resources/ats/interviews/InterviewsClient.java +++ /dev/null @@ -1,306 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.interviews; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.interviews.requests.InterviewsListRequest; -import com.merge.api.resources.ats.interviews.requests.InterviewsRetrieveRequest; -import com.merge.api.resources.ats.interviews.requests.ScheduledInterviewEndpointRequest; -import com.merge.api.resources.ats.types.MetaResponse; -import com.merge.api.resources.ats.types.PaginatedScheduledInterviewList; -import com.merge.api.resources.ats.types.ScheduledInterview; -import com.merge.api.resources.ats.types.ScheduledInterviewResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class InterviewsClient { - protected final ClientOptions clientOptions; - - public InterviewsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of ScheduledInterview objects. - */ - public PaginatedScheduledInterviewList list() { - return list(InterviewsListRequest.builder().build()); - } - - /** - * Returns a list of ScheduledInterview objects. - */ - public PaginatedScheduledInterviewList list(InterviewsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of ScheduledInterview objects. - */ - public PaginatedScheduledInterviewList list(InterviewsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/interviews"); - if (request.getApplicationId().isPresent()) { - httpUrl.addQueryParameter( - "application_id", request.getApplicationId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getJobId().isPresent()) { - httpUrl.addQueryParameter("job_id", request.getJobId().get()); - } - if (request.getJobInterviewStageId().isPresent()) { - httpUrl.addQueryParameter( - "job_interview_stage_id", request.getJobInterviewStageId().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOrganizerId().isPresent()) { - httpUrl.addQueryParameter("organizer_id", request.getOrganizerId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedScheduledInterviewList.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); - } - } - - /** - * Creates a ScheduledInterview object with the given values. - */ - public ScheduledInterviewResponse create(ScheduledInterviewEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a ScheduledInterview object with the given values. - */ - public ScheduledInterviewResponse create(ScheduledInterviewEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/interviews"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), ScheduledInterviewResponse.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); - } - } - - /** - * Returns a ScheduledInterview object with the given id. - */ - public ScheduledInterview retrieve(String id) { - return retrieve(id, InterviewsRetrieveRequest.builder().build()); - } - - /** - * Returns a ScheduledInterview object with the given id. - */ - public ScheduledInterview retrieve(String id, InterviewsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a ScheduledInterview object with the given id. - */ - public ScheduledInterview retrieve(String id, InterviewsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/interviews") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), ScheduledInterview.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); - } - } - - /** - * Returns metadata for ScheduledInterview POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for ScheduledInterview POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/interviews/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/interviews/requests/InterviewsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/interviews/requests/InterviewsRetrieveRequest.java deleted file mode 100644 index 5444be32f..000000000 --- a/src/main/java/com/merge/api/resources/ats/interviews/requests/InterviewsRetrieveRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.interviews.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.interviews.types.InterviewsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InterviewsRetrieveRequest.Builder.class) -public final class InterviewsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private InterviewsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InterviewsRetrieveRequest && equalTo((InterviewsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(InterviewsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(InterviewsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(InterviewsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public InterviewsRetrieveRequest build() { - return new InterviewsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/interviews/types/InterviewsListRequestExpand.java b/src/main/java/com/merge/api/resources/ats/interviews/types/InterviewsListRequestExpand.java deleted file mode 100644 index cf0c863be..000000000 --- a/src/main/java/com/merge/api/resources/ats/interviews/types/InterviewsListRequestExpand.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.interviews.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InterviewsListRequestExpand { - APPLICATION("application"), - - APPLICATION_JOB_INTERVIEW_STAGE("application,job_interview_stage"), - - INTERVIEWERS("interviewers"), - - INTERVIEWERS_APPLICATION("interviewers,application"), - - INTERVIEWERS_APPLICATION_JOB_INTERVIEW_STAGE("interviewers,application,job_interview_stage"), - - INTERVIEWERS_JOB_INTERVIEW_STAGE("interviewers,job_interview_stage"), - - INTERVIEWERS_ORGANIZER("interviewers,organizer"), - - INTERVIEWERS_ORGANIZER_APPLICATION("interviewers,organizer,application"), - - INTERVIEWERS_ORGANIZER_APPLICATION_JOB_INTERVIEW_STAGE("interviewers,organizer,application,job_interview_stage"), - - INTERVIEWERS_ORGANIZER_JOB_INTERVIEW_STAGE("interviewers,organizer,job_interview_stage"), - - JOB_INTERVIEW_STAGE("job_interview_stage"), - - ORGANIZER("organizer"), - - ORGANIZER_APPLICATION("organizer,application"), - - ORGANIZER_APPLICATION_JOB_INTERVIEW_STAGE("organizer,application,job_interview_stage"), - - ORGANIZER_JOB_INTERVIEW_STAGE("organizer,job_interview_stage"); - - private final String value; - - InterviewsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/interviews/types/InterviewsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ats/interviews/types/InterviewsRetrieveRequestExpand.java deleted file mode 100644 index c68cc5cfc..000000000 --- a/src/main/java/com/merge/api/resources/ats/interviews/types/InterviewsRetrieveRequestExpand.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.interviews.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InterviewsRetrieveRequestExpand { - APPLICATION("application"), - - APPLICATION_JOB_INTERVIEW_STAGE("application,job_interview_stage"), - - INTERVIEWERS("interviewers"), - - INTERVIEWERS_APPLICATION("interviewers,application"), - - INTERVIEWERS_APPLICATION_JOB_INTERVIEW_STAGE("interviewers,application,job_interview_stage"), - - INTERVIEWERS_JOB_INTERVIEW_STAGE("interviewers,job_interview_stage"), - - INTERVIEWERS_ORGANIZER("interviewers,organizer"), - - INTERVIEWERS_ORGANIZER_APPLICATION("interviewers,organizer,application"), - - INTERVIEWERS_ORGANIZER_APPLICATION_JOB_INTERVIEW_STAGE("interviewers,organizer,application,job_interview_stage"), - - INTERVIEWERS_ORGANIZER_JOB_INTERVIEW_STAGE("interviewers,organizer,job_interview_stage"), - - JOB_INTERVIEW_STAGE("job_interview_stage"), - - ORGANIZER("organizer"), - - ORGANIZER_APPLICATION("organizer,application"), - - ORGANIZER_APPLICATION_JOB_INTERVIEW_STAGE("organizer,application,job_interview_stage"), - - ORGANIZER_JOB_INTERVIEW_STAGE("organizer,job_interview_stage"); - - private final String value; - - InterviewsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/issues/IssuesClient.java b/src/main/java/com/merge/api/resources/ats/issues/IssuesClient.java deleted file mode 100644 index 38ba10ac0..000000000 --- a/src/main/java/com/merge/api/resources/ats/issues/IssuesClient.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.issues; - -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.ats.issues.requests.IssuesListRequest; -import com.merge.api.resources.ats.types.Issue; -import com.merge.api.resources.ats.types.PaginatedIssueList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuesClient { - protected final ClientOptions clientOptions; - - public IssuesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list() { - return list(IssuesListRequest.builder().build()); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request) { - return list(request, null); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/issues"); - if (request.getAccountToken().isPresent()) { - httpUrl.addQueryParameter("account_token", request.getAccountToken().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getFirstIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_after", - request.getFirstIncidentTimeAfter().get().toString()); - } - if (request.getFirstIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_before", - request.getFirstIncidentTimeBefore().get().toString()); - } - if (request.getIncludeMuted().isPresent()) { - httpUrl.addQueryParameter("include_muted", request.getIncludeMuted().get()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getLastIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_after", - request.getLastIncidentTimeAfter().get().toString()); - } - if (request.getLastIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_before", - request.getLastIncidentTimeBefore().get().toString()); - } - if (request.getLinkedAccountId().isPresent()) { - httpUrl.addQueryParameter( - "linked_account_id", request.getLinkedAccountId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedIssueList.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); - } - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id) { - return retrieve(id, null); - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/issues") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), Issue.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/api/resources/ats/issues/requests/IssuesListRequest.java deleted file mode 100644 index a356d42d9..000000000 --- a/src/main/java/com/merge/api/resources/ats/issues/requests/IssuesListRequest.java +++ /dev/null @@ -1,477 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.issues.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.issues.types.IssuesListRequestStatus; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IssuesListRequest.Builder.class) -public final class IssuesListRequest { - private final Optional accountToken; - - private final Optional cursor; - - private final Optional endDate; - - private final Optional endUserOrganizationName; - - private final Optional firstIncidentTimeAfter; - - private final Optional firstIncidentTimeBefore; - - private final Optional includeMuted; - - private final Optional integrationName; - - private final Optional lastIncidentTimeAfter; - - private final Optional lastIncidentTimeBefore; - - private final Optional linkedAccountId; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional status; - - private final Map additionalProperties; - - private IssuesListRequest( - Optional accountToken, - Optional cursor, - Optional endDate, - Optional endUserOrganizationName, - Optional firstIncidentTimeAfter, - Optional firstIncidentTimeBefore, - Optional includeMuted, - Optional integrationName, - Optional lastIncidentTimeAfter, - Optional lastIncidentTimeBefore, - Optional linkedAccountId, - Optional pageSize, - Optional startDate, - Optional status, - Map additionalProperties) { - this.accountToken = accountToken; - this.cursor = cursor; - this.endDate = endDate; - this.endUserOrganizationName = endUserOrganizationName; - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - this.includeMuted = includeMuted; - this.integrationName = integrationName; - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - this.linkedAccountId = linkedAccountId; - this.pageSize = pageSize; - this.startDate = startDate; - this.status = status; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public Optional getAccountToken() { - return accountToken; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include issues whose most recent action occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return issues whose first incident time was after this datetime. - */ - @JsonProperty("first_incident_time_after") - public Optional getFirstIncidentTimeAfter() { - return firstIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose first incident time was before this datetime. - */ - @JsonProperty("first_incident_time_before") - public Optional getFirstIncidentTimeBefore() { - return firstIncidentTimeBefore; - } - - /** - * @return If true, will include muted issues - */ - @JsonProperty("include_muted") - public Optional getIncludeMuted() { - return includeMuted; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If provided, will only return issues whose last incident time was after this datetime. - */ - @JsonProperty("last_incident_time_after") - public Optional getLastIncidentTimeAfter() { - return lastIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose last incident time was before this datetime. - */ - @JsonProperty("last_incident_time_before") - public Optional getLastIncidentTimeBefore() { - return lastIncidentTimeBefore; - } - - /** - * @return If provided, will only include issues pertaining to the linked account passed in. - */ - @JsonProperty("linked_account_id") - public Optional getLinkedAccountId() { - return linkedAccountId; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include issues whose most recent action occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IssuesListRequest other) { - return accountToken.equals(other.accountToken) - && cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) - && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) - && includeMuted.equals(other.includeMuted) - && integrationName.equals(other.integrationName) - && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) - && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) - && linkedAccountId.equals(other.linkedAccountId) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountToken, - this.cursor, - this.endDate, - this.endUserOrganizationName, - this.firstIncidentTimeAfter, - this.firstIncidentTimeBefore, - this.includeMuted, - this.integrationName, - this.lastIncidentTimeAfter, - this.lastIncidentTimeBefore, - this.linkedAccountId, - this.pageSize, - this.startDate, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountToken = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional firstIncidentTimeAfter = Optional.empty(); - - private Optional firstIncidentTimeBefore = Optional.empty(); - - private Optional includeMuted = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional lastIncidentTimeAfter = Optional.empty(); - - private Optional lastIncidentTimeBefore = Optional.empty(); - - private Optional linkedAccountId = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(IssuesListRequest other) { - accountToken(other.getAccountToken()); - cursor(other.getCursor()); - endDate(other.getEndDate()); - endUserOrganizationName(other.getEndUserOrganizationName()); - firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); - firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); - includeMuted(other.getIncludeMuted()); - integrationName(other.getIntegrationName()); - lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); - lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); - linkedAccountId(other.getLinkedAccountId()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "account_token", nulls = Nulls.SKIP) - public Builder accountToken(Optional accountToken) { - this.accountToken = accountToken; - return this; - } - - public Builder accountToken(String accountToken) { - this.accountToken = Optional.ofNullable(accountToken); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) - public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - return this; - } - - public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) - public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - return this; - } - - public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) - public Builder includeMuted(Optional includeMuted) { - this.includeMuted = includeMuted; - return this; - } - - public Builder includeMuted(String includeMuted) { - this.includeMuted = Optional.ofNullable(includeMuted); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) - public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - return this; - } - - public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) - public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - return this; - } - - public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) - public Builder linkedAccountId(Optional linkedAccountId) { - this.linkedAccountId = linkedAccountId; - return this; - } - - public Builder linkedAccountId(String linkedAccountId) { - this.linkedAccountId = Optional.ofNullable(linkedAccountId); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(IssuesListRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - public IssuesListRequest build() { - return new IssuesListRequest( - accountToken, - cursor, - endDate, - endUserOrganizationName, - firstIncidentTimeAfter, - firstIncidentTimeBefore, - includeMuted, - integrationName, - lastIncidentTimeAfter, - lastIncidentTimeBefore, - linkedAccountId, - pageSize, - startDate, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/resources/ats/issues/types/IssuesListRequestStatus.java deleted file mode 100644 index fda6f3e08..000000000 --- a/src/main/java/com/merge/api/resources/ats/issues/types/IssuesListRequestStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.issues.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssuesListRequestStatus { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssuesListRequestStatus(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobinterviewstages/JobInterviewStagesClient.java b/src/main/java/com/merge/api/resources/ats/jobinterviewstages/JobInterviewStagesClient.java deleted file mode 100644 index 0273c4c67..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobinterviewstages/JobInterviewStagesClient.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobinterviewstages; - -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.ats.jobinterviewstages.requests.JobInterviewStagesListRequest; -import com.merge.api.resources.ats.jobinterviewstages.requests.JobInterviewStagesRetrieveRequest; -import com.merge.api.resources.ats.types.JobInterviewStage; -import com.merge.api.resources.ats.types.PaginatedJobInterviewStageList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class JobInterviewStagesClient { - protected final ClientOptions clientOptions; - - public JobInterviewStagesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of JobInterviewStage objects. - */ - public PaginatedJobInterviewStageList list() { - return list(JobInterviewStagesListRequest.builder().build()); - } - - /** - * Returns a list of JobInterviewStage objects. - */ - public PaginatedJobInterviewStageList list(JobInterviewStagesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of JobInterviewStage objects. - */ - public PaginatedJobInterviewStageList list(JobInterviewStagesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/job-interview-stages"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getJobId().isPresent()) { - httpUrl.addQueryParameter("job_id", request.getJobId().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedJobInterviewStageList.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); - } - } - - /** - * Returns a JobInterviewStage object with the given id. - */ - public JobInterviewStage retrieve(String id) { - return retrieve(id, JobInterviewStagesRetrieveRequest.builder().build()); - } - - /** - * Returns a JobInterviewStage object with the given id. - */ - public JobInterviewStage retrieve(String id, JobInterviewStagesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a JobInterviewStage object with the given id. - */ - public JobInterviewStage retrieve( - String id, JobInterviewStagesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/job-interview-stages") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), JobInterviewStage.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesRetrieveRequest.java deleted file mode 100644 index 123a55032..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobinterviewstages/requests/JobInterviewStagesRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobinterviewstages.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = JobInterviewStagesRetrieveRequest.Builder.class) -public final class JobInterviewStagesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private JobInterviewStagesRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JobInterviewStagesRetrieveRequest && equalTo((JobInterviewStagesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(JobInterviewStagesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(JobInterviewStagesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public JobInterviewStagesRetrieveRequest build() { - return new JobInterviewStagesRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobpostings/JobPostingsClient.java b/src/main/java/com/merge/api/resources/ats/jobpostings/JobPostingsClient.java deleted file mode 100644 index c13e163eb..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobpostings/JobPostingsClient.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobpostings; - -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.ats.jobpostings.requests.JobPostingsListRequest; -import com.merge.api.resources.ats.jobpostings.requests.JobPostingsRetrieveRequest; -import com.merge.api.resources.ats.types.JobPosting; -import com.merge.api.resources.ats.types.PaginatedJobPostingList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class JobPostingsClient { - protected final ClientOptions clientOptions; - - public JobPostingsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of JobPosting objects. - */ - public PaginatedJobPostingList list() { - return list(JobPostingsListRequest.builder().build()); - } - - /** - * Returns a list of JobPosting objects. - */ - public PaginatedJobPostingList list(JobPostingsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of JobPosting objects. - */ - public PaginatedJobPostingList list(JobPostingsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/job-postings"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedJobPostingList.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); - } - } - - /** - * Returns a JobPosting object with the given id. - */ - public JobPosting retrieve(String id) { - return retrieve(id, JobPostingsRetrieveRequest.builder().build()); - } - - /** - * Returns a JobPosting object with the given id. - */ - public JobPosting retrieve(String id, JobPostingsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a JobPosting object with the given id. - */ - public JobPosting retrieve(String id, JobPostingsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/job-postings") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), JobPosting.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobpostings/requests/JobPostingsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/jobpostings/requests/JobPostingsRetrieveRequest.java deleted file mode 100644 index 3d2ef206c..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobpostings/requests/JobPostingsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobpostings.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = JobPostingsRetrieveRequest.Builder.class) -public final class JobPostingsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private JobPostingsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JobPostingsRetrieveRequest && equalTo((JobPostingsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(JobPostingsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(JobPostingsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public JobPostingsRetrieveRequest build() { - return new JobPostingsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobs/JobsClient.java b/src/main/java/com/merge/api/resources/ats/jobs/JobsClient.java deleted file mode 100644 index 01c7da75a..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobs/JobsClient.java +++ /dev/null @@ -1,271 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobs; - -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.ats.jobs.requests.JobsListRequest; -import com.merge.api.resources.ats.jobs.requests.JobsRetrieveRequest; -import com.merge.api.resources.ats.jobs.requests.JobsScreeningQuestionsListRequest; -import com.merge.api.resources.ats.types.Job; -import com.merge.api.resources.ats.types.PaginatedJobList; -import com.merge.api.resources.ats.types.PaginatedScreeningQuestionList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class JobsClient { - protected final ClientOptions clientOptions; - - public JobsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Job objects. - */ - public PaginatedJobList list() { - return list(JobsListRequest.builder().build()); - } - - /** - * Returns a list of Job objects. - */ - public PaginatedJobList list(JobsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Job objects. - */ - public PaginatedJobList list(JobsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/jobs"); - if (request.getCode().isPresent()) { - httpUrl.addQueryParameter("code", request.getCode().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOffices().isPresent()) { - httpUrl.addQueryParameter("offices", request.getOffices().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedJobList.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); - } - } - - /** - * Returns a Job object with the given id. - */ - public Job retrieve(String id) { - return retrieve(id, JobsRetrieveRequest.builder().build()); - } - - /** - * Returns a Job object with the given id. - */ - public Job retrieve(String id, JobsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Job object with the given id. - */ - public Job retrieve(String id, JobsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/jobs") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Job.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); - } - } - - /** - * Returns a list of ScreeningQuestion objects. - */ - public PaginatedScreeningQuestionList screeningQuestionsList(String jobId) { - return screeningQuestionsList( - jobId, JobsScreeningQuestionsListRequest.builder().build()); - } - - /** - * Returns a list of ScreeningQuestion objects. - */ - public PaginatedScreeningQuestionList screeningQuestionsList( - String jobId, JobsScreeningQuestionsListRequest request) { - return screeningQuestionsList(jobId, request, null); - } - - /** - * Returns a list of ScreeningQuestion objects. - */ - public PaginatedScreeningQuestionList screeningQuestionsList( - String jobId, JobsScreeningQuestionsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/jobs") - .addPathSegment(jobId) - .addPathSegments("screening-questions"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedScreeningQuestionList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobs/requests/JobsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/jobs/requests/JobsRetrieveRequest.java deleted file mode 100644 index b563005ed..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobs/requests/JobsRetrieveRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobs.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.jobs.types.JobsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = JobsRetrieveRequest.Builder.class) -public final class JobsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private JobsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JobsRetrieveRequest && equalTo((JobsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(JobsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(JobsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(JobsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public JobsRetrieveRequest build() { - return new JobsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsListRequestExpand.java b/src/main/java/com/merge/api/resources/ats/jobs/types/JobsListRequestExpand.java deleted file mode 100644 index 71f91497f..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsListRequestExpand.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobs.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum JobsListRequestExpand { - DEPARTMENTS("departments"), - - DEPARTMENTS_HIRING_MANAGERS("departments,hiring_managers"), - - DEPARTMENTS_HIRING_MANAGERS_JOB_POSTINGS("departments,hiring_managers,job_postings"), - - DEPARTMENTS_HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS("departments,hiring_managers,job_postings,recruiters"), - - DEPARTMENTS_HIRING_MANAGERS_RECRUITERS("departments,hiring_managers,recruiters"), - - DEPARTMENTS_JOB_POSTINGS("departments,job_postings"), - - DEPARTMENTS_JOB_POSTINGS_RECRUITERS("departments,job_postings,recruiters"), - - DEPARTMENTS_OFFICES("departments,offices"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS("departments,offices,hiring_managers"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS_JOB_POSTINGS("departments,offices,hiring_managers,job_postings"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS( - "departments,offices,hiring_managers,job_postings,recruiters"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS_RECRUITERS("departments,offices,hiring_managers,recruiters"), - - DEPARTMENTS_OFFICES_JOB_POSTINGS("departments,offices,job_postings"), - - DEPARTMENTS_OFFICES_JOB_POSTINGS_RECRUITERS("departments,offices,job_postings,recruiters"), - - DEPARTMENTS_OFFICES_RECRUITERS("departments,offices,recruiters"), - - DEPARTMENTS_RECRUITERS("departments,recruiters"), - - HIRING_MANAGERS("hiring_managers"), - - HIRING_MANAGERS_JOB_POSTINGS("hiring_managers,job_postings"), - - HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS("hiring_managers,job_postings,recruiters"), - - HIRING_MANAGERS_RECRUITERS("hiring_managers,recruiters"), - - JOB_POSTINGS("job_postings"), - - JOB_POSTINGS_RECRUITERS("job_postings,recruiters"), - - OFFICES("offices"), - - OFFICES_HIRING_MANAGERS("offices,hiring_managers"), - - OFFICES_HIRING_MANAGERS_JOB_POSTINGS("offices,hiring_managers,job_postings"), - - OFFICES_HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS("offices,hiring_managers,job_postings,recruiters"), - - OFFICES_HIRING_MANAGERS_RECRUITERS("offices,hiring_managers,recruiters"), - - OFFICES_JOB_POSTINGS("offices,job_postings"), - - OFFICES_JOB_POSTINGS_RECRUITERS("offices,job_postings,recruiters"), - - OFFICES_RECRUITERS("offices,recruiters"), - - RECRUITERS("recruiters"); - - private final String value; - - JobsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ats/jobs/types/JobsRetrieveRequestExpand.java deleted file mode 100644 index a397f83f3..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsRetrieveRequestExpand.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobs.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum JobsRetrieveRequestExpand { - DEPARTMENTS("departments"), - - DEPARTMENTS_HIRING_MANAGERS("departments,hiring_managers"), - - DEPARTMENTS_HIRING_MANAGERS_JOB_POSTINGS("departments,hiring_managers,job_postings"), - - DEPARTMENTS_HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS("departments,hiring_managers,job_postings,recruiters"), - - DEPARTMENTS_HIRING_MANAGERS_RECRUITERS("departments,hiring_managers,recruiters"), - - DEPARTMENTS_JOB_POSTINGS("departments,job_postings"), - - DEPARTMENTS_JOB_POSTINGS_RECRUITERS("departments,job_postings,recruiters"), - - DEPARTMENTS_OFFICES("departments,offices"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS("departments,offices,hiring_managers"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS_JOB_POSTINGS("departments,offices,hiring_managers,job_postings"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS( - "departments,offices,hiring_managers,job_postings,recruiters"), - - DEPARTMENTS_OFFICES_HIRING_MANAGERS_RECRUITERS("departments,offices,hiring_managers,recruiters"), - - DEPARTMENTS_OFFICES_JOB_POSTINGS("departments,offices,job_postings"), - - DEPARTMENTS_OFFICES_JOB_POSTINGS_RECRUITERS("departments,offices,job_postings,recruiters"), - - DEPARTMENTS_OFFICES_RECRUITERS("departments,offices,recruiters"), - - DEPARTMENTS_RECRUITERS("departments,recruiters"), - - HIRING_MANAGERS("hiring_managers"), - - HIRING_MANAGERS_JOB_POSTINGS("hiring_managers,job_postings"), - - HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS("hiring_managers,job_postings,recruiters"), - - HIRING_MANAGERS_RECRUITERS("hiring_managers,recruiters"), - - JOB_POSTINGS("job_postings"), - - JOB_POSTINGS_RECRUITERS("job_postings,recruiters"), - - OFFICES("offices"), - - OFFICES_HIRING_MANAGERS("offices,hiring_managers"), - - OFFICES_HIRING_MANAGERS_JOB_POSTINGS("offices,hiring_managers,job_postings"), - - OFFICES_HIRING_MANAGERS_JOB_POSTINGS_RECRUITERS("offices,hiring_managers,job_postings,recruiters"), - - OFFICES_HIRING_MANAGERS_RECRUITERS("offices,hiring_managers,recruiters"), - - OFFICES_JOB_POSTINGS("offices,job_postings"), - - OFFICES_JOB_POSTINGS_RECRUITERS("offices,job_postings,recruiters"), - - OFFICES_RECRUITERS("offices,recruiters"), - - RECRUITERS("recruiters"); - - private final String value; - - JobsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsScreeningQuestionsListRequestExpand.java b/src/main/java/com/merge/api/resources/ats/jobs/types/JobsScreeningQuestionsListRequestExpand.java deleted file mode 100644 index 572c4a298..000000000 --- a/src/main/java/com/merge/api/resources/ats/jobs/types/JobsScreeningQuestionsListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.jobs.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum JobsScreeningQuestionsListRequestExpand { - JOB("job"), - - OPTIONS("options"), - - OPTIONS_JOB("options,job"); - - private final String value; - - JobsScreeningQuestionsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/api/resources/ats/linkedaccounts/LinkedAccountsClient.java deleted file mode 100644 index cb0498dd7..000000000 --- a/src/main/java/com/merge/api/resources/ats/linkedaccounts/LinkedAccountsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.linkedaccounts; - -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.ats.linkedaccounts.requests.LinkedAccountsListRequest; -import com.merge.api.resources.ats.types.PaginatedAccountDetailsAndActionsList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkedAccountsClient { - protected final ClientOptions clientOptions; - - public LinkedAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list() { - return list(LinkedAccountsListRequest.builder().build()); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list(LinkedAccountsListRequest request) { - return list(request, null); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list( - LinkedAccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/linked-accounts"); - if (request.getCategory().isPresent()) { - httpUrl.addQueryParameter("category", request.getCategory().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndUserEmailAddress().isPresent()) { - httpUrl.addQueryParameter( - "end_user_email_address", request.getEndUserEmailAddress().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getEndUserOriginId().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_id", request.getEndUserOriginId().get()); - } - if (request.getEndUserOriginIds().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_ids", request.getEndUserOriginIds().get()); - } - if (request.getId().isPresent()) { - httpUrl.addQueryParameter("id", request.getId().get()); - } - if (request.getIds().isPresent()) { - httpUrl.addQueryParameter("ids", request.getIds().get()); - } - if (request.getIncludeDuplicates().isPresent()) { - httpUrl.addQueryParameter( - "include_duplicates", request.getIncludeDuplicates().get().toString()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getIsTestAccount().isPresent()) { - httpUrl.addQueryParameter( - "is_test_account", request.getIsTestAccount().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountDetailsAndActionsList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/resources/ats/linkedaccounts/requests/LinkedAccountsListRequest.java deleted file mode 100644 index 248070471..000000000 --- a/src/main/java/com/merge/api/resources/ats/linkedaccounts/requests/LinkedAccountsListRequest.java +++ /dev/null @@ -1,458 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.linkedaccounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.linkedaccounts.types.LinkedAccountsListRequestCategory; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) -public final class LinkedAccountsListRequest { - private final Optional category; - - private final Optional cursor; - - private final Optional endUserEmailAddress; - - private final Optional endUserOrganizationName; - - private final Optional endUserOriginId; - - private final Optional endUserOriginIds; - - private final Optional id; - - private final Optional ids; - - private final Optional includeDuplicates; - - private final Optional integrationName; - - private final Optional isTestAccount; - - private final Optional pageSize; - - private final Optional status; - - private final Map additionalProperties; - - private LinkedAccountsListRequest( - Optional category, - Optional cursor, - Optional endUserEmailAddress, - Optional endUserOrganizationName, - Optional endUserOriginId, - Optional endUserOriginIds, - Optional id, - Optional ids, - Optional includeDuplicates, - Optional integrationName, - Optional isTestAccount, - Optional pageSize, - Optional status, - Map additionalProperties) { - this.category = category; - this.cursor = cursor; - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.endUserOriginIds = endUserOriginIds; - this.id = id; - this.ids = ids; - this.includeDuplicates = includeDuplicates; - this.integrationName = integrationName; - this.isTestAccount = isTestAccount; - this.pageSize = pageSize; - this.status = status; - this.additionalProperties = additionalProperties; - } - - /** - * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing - *
    - *
  • hris - hris
  • - *
  • ats - ats
  • - *
  • accounting - accounting
  • - *
  • ticketing - ticketing
  • - *
  • crm - crm
  • - *
  • mktg - mktg
  • - *
  • filestorage - filestorage
  • - *
- */ - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return linked accounts associated with the given email address. - */ - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return If provided, will only return linked accounts associated with the given organization name. - */ - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return linked accounts associated with the given origin ID. - */ - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. - */ - @JsonProperty("end_user_origin_ids") - public Optional getEndUserOriginIds() { - return endUserOriginIds; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. - */ - @JsonProperty("ids") - public Optional getIds() { - return ids; - } - - /** - * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. - */ - @JsonProperty("include_duplicates") - public Optional getIncludeDuplicates() { - return includeDuplicates; - } - - /** - * @return If provided, will only return linked accounts associated with the given integration name. - */ - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. - */ - @JsonProperty("is_test_account") - public Optional getIsTestAccount() { - return isTestAccount; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountsListRequest other) { - return category.equals(other.category) - && cursor.equals(other.cursor) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOriginIds.equals(other.endUserOriginIds) - && id.equals(other.id) - && ids.equals(other.ids) - && includeDuplicates.equals(other.includeDuplicates) - && integrationName.equals(other.integrationName) - && isTestAccount.equals(other.isTestAccount) - && pageSize.equals(other.pageSize) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.category, - this.cursor, - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.endUserOriginIds, - this.id, - this.ids, - this.includeDuplicates, - this.integrationName, - this.isTestAccount, - this.pageSize, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional category = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOriginIds = Optional.empty(); - - private Optional id = Optional.empty(); - - private Optional ids = Optional.empty(); - - private Optional includeDuplicates = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional isTestAccount = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountsListRequest other) { - category(other.getCategory()); - cursor(other.getCursor()); - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - endUserOriginIds(other.getEndUserOriginIds()); - id(other.getId()); - ids(other.getIds()); - includeDuplicates(other.getIncludeDuplicates()); - integrationName(other.getIntegrationName()); - isTestAccount(other.getIsTestAccount()); - pageSize(other.getPageSize()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(LinkedAccountsListRequestCategory category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) - public Builder endUserOriginIds(Optional endUserOriginIds) { - this.endUserOriginIds = endUserOriginIds; - return this; - } - - public Builder endUserOriginIds(String endUserOriginIds) { - this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "ids", nulls = Nulls.SKIP) - public Builder ids(Optional ids) { - this.ids = ids; - return this; - } - - public Builder ids(String ids) { - this.ids = Optional.ofNullable(ids); - return this; - } - - @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) - public Builder includeDuplicates(Optional includeDuplicates) { - this.includeDuplicates = includeDuplicates; - return this; - } - - public Builder includeDuplicates(Boolean includeDuplicates) { - this.includeDuplicates = Optional.ofNullable(includeDuplicates); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) - public Builder isTestAccount(Optional isTestAccount) { - this.isTestAccount = isTestAccount; - return this; - } - - public Builder isTestAccount(String isTestAccount) { - this.isTestAccount = Optional.ofNullable(isTestAccount); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - public LinkedAccountsListRequest build() { - return new LinkedAccountsListRequest( - category, - cursor, - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - endUserOriginIds, - id, - ids, - includeDuplicates, - integrationName, - isTestAccount, - pageSize, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/resources/ats/linkedaccounts/types/LinkedAccountsListRequestCategory.java deleted file mode 100644 index 928f8c3d8..000000000 --- a/src/main/java/com/merge/api/resources/ats/linkedaccounts/types/LinkedAccountsListRequestCategory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.linkedaccounts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LinkedAccountsListRequestCategory { - ACCOUNTING("accounting"), - - ATS("ats"), - - CRM("crm"), - - FILESTORAGE("filestorage"), - - HRIS("hris"), - - MKTG("mktg"), - - TICKETING("ticketing"); - - private final String value; - - LinkedAccountsListRequestCategory(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/linktoken/LinkTokenClient.java b/src/main/java/com/merge/api/resources/ats/linktoken/LinkTokenClient.java deleted file mode 100644 index cd585031b..000000000 --- a/src/main/java/com/merge/api/resources/ats/linktoken/LinkTokenClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.linktoken; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.linktoken.requests.EndUserDetailsRequest; -import com.merge.api.resources.ats.types.LinkToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkTokenClient { - protected final ClientOptions clientOptions; - - public LinkTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request) { - return create(request, null); - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/link-token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), LinkToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/api/resources/ats/linktoken/requests/EndUserDetailsRequest.java deleted file mode 100644 index 4e6850d71..000000000 --- a/src/main/java/com/merge/api/resources/ats/linktoken/requests/EndUserDetailsRequest.java +++ /dev/null @@ -1,611 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.linktoken.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.CategoriesEnum; -import com.merge.api.resources.ats.types.CommonModelScopesBodyRequest; -import com.merge.api.resources.ats.types.IndividualCommonModelScopeDeserializerRequest; -import com.merge.api.resources.ats.types.LanguageEnum; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) -public final class EndUserDetailsRequest { - private final String endUserEmailAddress; - - private final String endUserOrganizationName; - - private final String endUserOriginId; - - private final List categories; - - private final Optional integration; - - private final Optional linkExpiryMins; - - private final Optional shouldCreateMagicLinkUrl; - - private final Optional hideAdminMagicLink; - - private final Optional> commonModels; - - private final Optional>>> - categoryCommonModelScopes; - - private final Optional language; - - private final Optional areSyncsDisabled; - - private final Optional> integrationSpecificConfig; - - private final Map additionalProperties; - - private EndUserDetailsRequest( - String endUserEmailAddress, - String endUserOrganizationName, - String endUserOriginId, - List categories, - Optional integration, - Optional linkExpiryMins, - Optional shouldCreateMagicLinkUrl, - Optional hideAdminMagicLink, - Optional> commonModels, - Optional>>> - categoryCommonModelScopes, - Optional language, - Optional areSyncsDisabled, - Optional> integrationSpecificConfig, - Map additionalProperties) { - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.categories = categories; - this.integration = integration; - this.linkExpiryMins = linkExpiryMins; - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - this.hideAdminMagicLink = hideAdminMagicLink; - this.commonModels = commonModels; - this.categoryCommonModelScopes = categoryCommonModelScopes; - this.language = language; - this.areSyncsDisabled = areSyncsDisabled; - this.integrationSpecificConfig = integrationSpecificConfig; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. - */ - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return Your end user's organization. - */ - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. - */ - @JsonProperty("end_user_origin_id") - public String getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return The integration categories to show in Merge Link. - */ - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - /** - * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. - */ - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - /** - * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. - */ - @JsonProperty("link_expiry_mins") - public Optional getLinkExpiryMins() { - return linkExpiryMins; - } - - /** - * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("should_create_magic_link_url") - public Optional getShouldCreateMagicLinkUrl() { - return shouldCreateMagicLinkUrl; - } - - /** - * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("hide_admin_magic_link") - public Optional getHideAdminMagicLink() { - return hideAdminMagicLink; - } - - /** - * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. - */ - @JsonProperty("common_models") - public Optional> getCommonModels() { - return commonModels; - } - - /** - * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. - */ - @JsonProperty("category_common_model_scopes") - public Optional>>> - getCategoryCommonModelScopes() { - return categoryCommonModelScopes; - } - - /** - * @return The following subset of IETF language tags can be used to configure localization. - *
    - *
  • en - en
  • - *
  • de - de
  • - *
- */ - @JsonProperty("language") - public Optional getLanguage() { - return language; - } - - /** - * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. - */ - @JsonProperty("are_syncs_disabled") - public Optional getAreSyncsDisabled() { - return areSyncsDisabled; - } - - /** - * @return A JSON object containing integration-specific configuration options. - */ - @JsonProperty("integration_specific_config") - public Optional> getIntegrationSpecificConfig() { - return integrationSpecificConfig; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EndUserDetailsRequest other) { - return endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && categories.equals(other.categories) - && integration.equals(other.integration) - && linkExpiryMins.equals(other.linkExpiryMins) - && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) - && hideAdminMagicLink.equals(other.hideAdminMagicLink) - && commonModels.equals(other.commonModels) - && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) - && language.equals(other.language) - && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.categories, - this.integration, - this.linkExpiryMins, - this.shouldCreateMagicLinkUrl, - this.hideAdminMagicLink, - this.commonModels, - this.categoryCommonModelScopes, - this.language, - this.areSyncsDisabled, - this.integrationSpecificConfig); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EndUserEmailAddressStage builder() { - return new Builder(); - } - - public interface EndUserEmailAddressStage { - EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); - - Builder from(EndUserDetailsRequest other); - } - - public interface EndUserOrganizationNameStage { - EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserOriginIdStage { - _FinalStage endUserOriginId(@NotNull String endUserOriginId); - } - - public interface _FinalStage { - EndUserDetailsRequest build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage integration(Optional integration); - - _FinalStage integration(String integration); - - _FinalStage linkExpiryMins(Optional linkExpiryMins); - - _FinalStage linkExpiryMins(Integer linkExpiryMins); - - _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); - - _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); - - _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); - - _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); - - _FinalStage commonModels(Optional> commonModels); - - _FinalStage commonModels(List commonModels); - - _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes); - - _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes); - - _FinalStage language(Optional language); - - _FinalStage language(LanguageEnum language); - - _FinalStage areSyncsDisabled(Optional areSyncsDisabled); - - _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); - - _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); - - _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { - private String endUserEmailAddress; - - private String endUserOrganizationName; - - private String endUserOriginId; - - private Optional> integrationSpecificConfig = Optional.empty(); - - private Optional areSyncsDisabled = Optional.empty(); - - private Optional language = Optional.empty(); - - private Optional>>> - categoryCommonModelScopes = Optional.empty(); - - private Optional> commonModels = Optional.empty(); - - private Optional hideAdminMagicLink = Optional.empty(); - - private Optional shouldCreateMagicLinkUrl = Optional.empty(); - - private Optional linkExpiryMins = Optional.empty(); - - private Optional integration = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EndUserDetailsRequest other) { - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - categories(other.getCategories()); - integration(other.getIntegration()); - linkExpiryMins(other.getLinkExpiryMins()); - shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); - hideAdminMagicLink(other.getHideAdminMagicLink()); - commonModels(other.getCommonModels()); - categoryCommonModelScopes(other.getCategoryCommonModelScopes()); - language(other.getLanguage()); - areSyncsDisabled(other.getAreSyncsDisabled()); - integrationSpecificConfig(other.getIntegrationSpecificConfig()); - return this; - } - - /** - *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_email_address") - public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - /** - *

Your end user's organization.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - /** - *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_origin_id") - public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - /** - *

A JSON object containing integration-specific configuration options.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { - this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) - public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { - this.integrationSpecificConfig = integrationSpecificConfig; - return this; - } - - /** - *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { - this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) - public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { - this.areSyncsDisabled = areSyncsDisabled; - return this; - } - - /** - *

The following subset of IETF language tags can be used to configure localization.

- *
    - *
  • en - en
  • - *
  • de - de
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage language(LanguageEnum language) { - this.language = Optional.ofNullable(language); - return this; - } - - @java.lang.Override - @JsonSetter(value = "language", nulls = Nulls.SKIP) - public _FinalStage language(Optional language) { - this.language = language; - return this; - } - - /** - *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes) { - this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) - public _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes) { - this.categoryCommonModelScopes = categoryCommonModelScopes; - return this; - } - - /** - *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage commonModels(List commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @java.lang.Override - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public _FinalStage commonModels(Optional> commonModels) { - this.commonModels = commonModels; - return this; - } - - /** - *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { - this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); - return this; - } - - @java.lang.Override - @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) - public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { - this.hideAdminMagicLink = hideAdminMagicLink; - return this; - } - - /** - *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) - public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - return this; - } - - /** - *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage linkExpiryMins(Integer linkExpiryMins) { - this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); - return this; - } - - @java.lang.Override - @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) - public _FinalStage linkExpiryMins(Optional linkExpiryMins) { - this.linkExpiryMins = linkExpiryMins; - return this; - } - - /** - *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public EndUserDetailsRequest build() { - return new EndUserDetailsRequest( - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - categories, - integration, - linkExpiryMins, - shouldCreateMagicLinkUrl, - hideAdminMagicLink, - commonModels, - categoryCommonModelScopes, - language, - areSyncsDisabled, - integrationSpecificConfig, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/offers/OffersClient.java b/src/main/java/com/merge/api/resources/ats/offers/OffersClient.java deleted file mode 100644 index c50c482e8..000000000 --- a/src/main/java/com/merge/api/resources/ats/offers/OffersClient.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.offers; - -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.ats.offers.requests.OffersListRequest; -import com.merge.api.resources.ats.offers.requests.OffersRetrieveRequest; -import com.merge.api.resources.ats.types.Offer; -import com.merge.api.resources.ats.types.PaginatedOfferList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class OffersClient { - protected final ClientOptions clientOptions; - - public OffersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Offer objects. - */ - public PaginatedOfferList list() { - return list(OffersListRequest.builder().build()); - } - - /** - * Returns a list of Offer objects. - */ - public PaginatedOfferList list(OffersListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Offer objects. - */ - public PaginatedOfferList list(OffersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/offers"); - if (request.getApplicationId().isPresent()) { - httpUrl.addQueryParameter( - "application_id", request.getApplicationId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCreatorId().isPresent()) { - httpUrl.addQueryParameter("creator_id", request.getCreatorId().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedOfferList.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); - } - } - - /** - * Returns an Offer object with the given id. - */ - public Offer retrieve(String id) { - return retrieve(id, OffersRetrieveRequest.builder().build()); - } - - /** - * Returns an Offer object with the given id. - */ - public Offer retrieve(String id, OffersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Offer object with the given id. - */ - public Offer retrieve(String id, OffersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/offers") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Offer.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/offers/requests/OffersRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/offers/requests/OffersRetrieveRequest.java deleted file mode 100644 index ecdd2a680..000000000 --- a/src/main/java/com/merge/api/resources/ats/offers/requests/OffersRetrieveRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.offers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.offers.types.OffersRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = OffersRetrieveRequest.Builder.class) -public final class OffersRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private OffersRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof OffersRetrieveRequest && equalTo((OffersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(OffersRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(OffersRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(OffersRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public OffersRetrieveRequest build() { - return new OffersRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/offers/types/OffersListRequestExpand.java b/src/main/java/com/merge/api/resources/ats/offers/types/OffersListRequestExpand.java deleted file mode 100644 index 29f725d71..000000000 --- a/src/main/java/com/merge/api/resources/ats/offers/types/OffersListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.offers.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum OffersListRequestExpand { - APPLICATION("application"), - - APPLICATION_CREATOR("application,creator"), - - CREATOR("creator"); - - private final String value; - - OffersListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/offers/types/OffersRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ats/offers/types/OffersRetrieveRequestExpand.java deleted file mode 100644 index abfa2da2b..000000000 --- a/src/main/java/com/merge/api/resources/ats/offers/types/OffersRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.offers.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum OffersRetrieveRequestExpand { - APPLICATION("application"), - - APPLICATION_CREATOR("application,creator"), - - CREATOR("creator"); - - private final String value; - - OffersRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/offices/OfficesClient.java b/src/main/java/com/merge/api/resources/ats/offices/OfficesClient.java deleted file mode 100644 index 6a5320785..000000000 --- a/src/main/java/com/merge/api/resources/ats/offices/OfficesClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.offices; - -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.ats.offices.requests.OfficesListRequest; -import com.merge.api.resources.ats.offices.requests.OfficesRetrieveRequest; -import com.merge.api.resources.ats.types.Office; -import com.merge.api.resources.ats.types.PaginatedOfficeList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class OfficesClient { - protected final ClientOptions clientOptions; - - public OfficesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Office objects. - */ - public PaginatedOfficeList list() { - return list(OfficesListRequest.builder().build()); - } - - /** - * Returns a list of Office objects. - */ - public PaginatedOfficeList list(OfficesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Office objects. - */ - public PaginatedOfficeList list(OfficesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/offices"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedOfficeList.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); - } - } - - /** - * Returns an Office object with the given id. - */ - public Office retrieve(String id) { - return retrieve(id, OfficesRetrieveRequest.builder().build()); - } - - /** - * Returns an Office object with the given id. - */ - public Office retrieve(String id, OfficesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Office object with the given id. - */ - public Office retrieve(String id, OfficesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/offices") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Office.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/offices/requests/OfficesRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/offices/requests/OfficesRetrieveRequest.java deleted file mode 100644 index 82a8d0234..000000000 --- a/src/main/java/com/merge/api/resources/ats/offices/requests/OfficesRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.offices.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = OfficesRetrieveRequest.Builder.class) -public final class OfficesRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private OfficesRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof OfficesRetrieveRequest && equalTo((OfficesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(OfficesRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(OfficesRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public OfficesRetrieveRequest build() { - return new OfficesRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/passthrough/PassthroughClient.java b/src/main/java/com/merge/api/resources/ats/passthrough/PassthroughClient.java deleted file mode 100644 index 1362268a6..000000000 --- a/src/main/java/com/merge/api/resources/ats/passthrough/PassthroughClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.passthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.types.DataPassthroughRequest; -import com.merge.api.resources.ats.types.RemoteResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PassthroughClient { - protected final ClientOptions clientOptions; - - public PassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), RemoteResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/api/resources/ats/regeneratekey/RegenerateKeyClient.java deleted file mode 100644 index 90a7a9e6f..000000000 --- a/src/main/java/com/merge/api/resources/ats/regeneratekey/RegenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.regeneratekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.regeneratekey.requests.RemoteKeyForRegenerationRequest; -import com.merge.api.resources.ats.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RegenerateKeyClient { - protected final ClientOptions clientOptions; - - public RegenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request) { - return create(request, null); - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/regenerate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/resources/ats/regeneratekey/requests/RemoteKeyForRegenerationRequest.java deleted file mode 100644 index ba49078e5..000000000 --- a/src/main/java/com/merge/api/resources/ats/regeneratekey/requests/RemoteKeyForRegenerationRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.regeneratekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) -public final class RemoteKeyForRegenerationRequest { - private final String name; - - private final Map additionalProperties; - - private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKeyForRegenerationRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(RemoteKeyForRegenerationRequest other); - } - - public interface _FinalStage { - RemoteKeyForRegenerationRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKeyForRegenerationRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public RemoteKeyForRegenerationRequest build() { - return new RemoteKeyForRegenerationRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/rejectreasons/RejectReasonsClient.java b/src/main/java/com/merge/api/resources/ats/rejectreasons/RejectReasonsClient.java deleted file mode 100644 index 466913eca..000000000 --- a/src/main/java/com/merge/api/resources/ats/rejectreasons/RejectReasonsClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.rejectreasons; - -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.ats.rejectreasons.requests.RejectReasonsListRequest; -import com.merge.api.resources.ats.rejectreasons.requests.RejectReasonsRetrieveRequest; -import com.merge.api.resources.ats.types.PaginatedRejectReasonList; -import com.merge.api.resources.ats.types.RejectReason; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RejectReasonsClient { - protected final ClientOptions clientOptions; - - public RejectReasonsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of RejectReason objects. - */ - public PaginatedRejectReasonList list() { - return list(RejectReasonsListRequest.builder().build()); - } - - /** - * Returns a list of RejectReason objects. - */ - public PaginatedRejectReasonList list(RejectReasonsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of RejectReason objects. - */ - public PaginatedRejectReasonList list(RejectReasonsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/reject-reasons"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRejectReasonList.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); - } - } - - /** - * Returns a RejectReason object with the given id. - */ - public RejectReason retrieve(String id) { - return retrieve(id, RejectReasonsRetrieveRequest.builder().build()); - } - - /** - * Returns a RejectReason object with the given id. - */ - public RejectReason retrieve(String id, RejectReasonsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a RejectReason object with the given id. - */ - public RejectReason retrieve(String id, RejectReasonsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/reject-reasons") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RejectReason.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/rejectreasons/requests/RejectReasonsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/rejectreasons/requests/RejectReasonsRetrieveRequest.java deleted file mode 100644 index 20d543488..000000000 --- a/src/main/java/com/merge/api/resources/ats/rejectreasons/requests/RejectReasonsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.rejectreasons.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RejectReasonsRetrieveRequest.Builder.class) -public final class RejectReasonsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private RejectReasonsRetrieveRequest( - Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RejectReasonsRetrieveRequest && equalTo((RejectReasonsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RejectReasonsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RejectReasonsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public RejectReasonsRetrieveRequest build() { - return new RejectReasonsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/scopes/ScopesClient.java b/src/main/java/com/merge/api/resources/ats/scopes/ScopesClient.java deleted file mode 100644 index 9d60d9130..000000000 --- a/src/main/java/com/merge/api/resources/ats/scopes/ScopesClient.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.scopes; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; -import com.merge.api.resources.ats.types.CommonModelScopeApi; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ScopesClient { - protected final ClientOptions clientOptions; - - public ScopesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve() { - return defaultScopesRetrieve(null); - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/default-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve() { - return linkedAccountScopesRetrieve(null); - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/linked-account-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { - return linkedAccountScopesCreate(request, null); - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate( - LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/linked-account-scopes") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/ats/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 604416d23..000000000 --- a/src/main/java/com/merge/api/resources/ats/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.scopes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.types.IndividualCommonModelScopeDeserializerRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) -public final class LinkedAccountCommonModelScopeDeserializerRequest { - private final List commonModels; - - private final Map additionalProperties; - - private LinkedAccountCommonModelScopeDeserializerRequest( - List commonModels, - Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountCommonModelScopeDeserializerRequest - && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public LinkedAccountCommonModelScopeDeserializerRequest build() { - return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/scorecards/ScorecardsClient.java b/src/main/java/com/merge/api/resources/ats/scorecards/ScorecardsClient.java deleted file mode 100644 index c89219fff..000000000 --- a/src/main/java/com/merge/api/resources/ats/scorecards/ScorecardsClient.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.scorecards; - -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.ats.scorecards.requests.ScorecardsListRequest; -import com.merge.api.resources.ats.scorecards.requests.ScorecardsRetrieveRequest; -import com.merge.api.resources.ats.types.PaginatedScorecardList; -import com.merge.api.resources.ats.types.Scorecard; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ScorecardsClient { - protected final ClientOptions clientOptions; - - public ScorecardsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Scorecard objects. - */ - public PaginatedScorecardList list() { - return list(ScorecardsListRequest.builder().build()); - } - - /** - * Returns a list of Scorecard objects. - */ - public PaginatedScorecardList list(ScorecardsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Scorecard objects. - */ - public PaginatedScorecardList list(ScorecardsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/scorecards"); - if (request.getApplicationId().isPresent()) { - httpUrl.addQueryParameter( - "application_id", request.getApplicationId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getInterviewId().isPresent()) { - httpUrl.addQueryParameter("interview_id", request.getInterviewId().get()); - } - if (request.getInterviewerId().isPresent()) { - httpUrl.addQueryParameter( - "interviewer_id", request.getInterviewerId().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedScorecardList.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); - } - } - - /** - * Returns a Scorecard object with the given id. - */ - public Scorecard retrieve(String id) { - return retrieve(id, ScorecardsRetrieveRequest.builder().build()); - } - - /** - * Returns a Scorecard object with the given id. - */ - public Scorecard retrieve(String id, ScorecardsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Scorecard object with the given id. - */ - public Scorecard retrieve(String id, ScorecardsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/scorecards") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Scorecard.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/scorecards/requests/ScorecardsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/scorecards/requests/ScorecardsRetrieveRequest.java deleted file mode 100644 index d54ffd109..000000000 --- a/src/main/java/com/merge/api/resources/ats/scorecards/requests/ScorecardsRetrieveRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.scorecards.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ats.scorecards.types.ScorecardsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ScorecardsRetrieveRequest.Builder.class) -public final class ScorecardsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private ScorecardsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ScorecardsRetrieveRequest && equalTo((ScorecardsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ScorecardsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ScorecardsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ScorecardsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public ScorecardsRetrieveRequest build() { - return new ScorecardsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/scorecards/types/ScorecardsListRequestExpand.java b/src/main/java/com/merge/api/resources/ats/scorecards/types/ScorecardsListRequestExpand.java deleted file mode 100644 index 083a88836..000000000 --- a/src/main/java/com/merge/api/resources/ats/scorecards/types/ScorecardsListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.scorecards.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ScorecardsListRequestExpand { - APPLICATION("application"), - - APPLICATION_INTERVIEW("application,interview"), - - APPLICATION_INTERVIEW_INTERVIEWER("application,interview,interviewer"), - - APPLICATION_INTERVIEWER("application,interviewer"), - - INTERVIEW("interview"), - - INTERVIEW_INTERVIEWER("interview,interviewer"), - - INTERVIEWER("interviewer"); - - private final String value; - - ScorecardsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/scorecards/types/ScorecardsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ats/scorecards/types/ScorecardsRetrieveRequestExpand.java deleted file mode 100644 index f6bde3064..000000000 --- a/src/main/java/com/merge/api/resources/ats/scorecards/types/ScorecardsRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.scorecards.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ScorecardsRetrieveRequestExpand { - APPLICATION("application"), - - APPLICATION_INTERVIEW("application,interview"), - - APPLICATION_INTERVIEW_INTERVIEWER("application,interview,interviewer"), - - APPLICATION_INTERVIEWER("application,interviewer"), - - INTERVIEW("interview"), - - INTERVIEW_INTERVIEWER("interview,interviewer"), - - INTERVIEWER("interviewer"); - - private final String value; - - ScorecardsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/api/resources/ats/syncstatus/SyncStatusClient.java deleted file mode 100644 index b9533d672..000000000 --- a/src/main/java/com/merge/api/resources/ats/syncstatus/SyncStatusClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.syncstatus; - -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.ats.syncstatus.requests.SyncStatusListRequest; -import com.merge.api.resources.ats.types.PaginatedSyncStatusList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SyncStatusClient { - protected final ClientOptions clientOptions; - - public SyncStatusClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list() { - return list(SyncStatusListRequest.builder().build()); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request) { - return list(request, null); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/sync-status"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedSyncStatusList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/api/resources/ats/syncstatus/requests/SyncStatusListRequest.java deleted file mode 100644 index 6f35684a8..000000000 --- a/src/main/java/com/merge/api/resources/ats/syncstatus/requests/SyncStatusListRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.syncstatus.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) -public final class SyncStatusListRequest { - private final Optional cursor; - - private final Optional pageSize; - - private final Map additionalProperties; - - private SyncStatusListRequest( - Optional cursor, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatusListRequest other) { - return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(SyncStatusListRequest other) { - cursor(other.getCursor()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public SyncStatusListRequest build() { - return new SyncStatusListRequest(cursor, pageSize, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/tags/TagsClient.java b/src/main/java/com/merge/api/resources/ats/tags/TagsClient.java deleted file mode 100644 index 16d4567d0..000000000 --- a/src/main/java/com/merge/api/resources/ats/tags/TagsClient.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.tags; - -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.ats.tags.requests.TagsListRequest; -import com.merge.api.resources.ats.types.PaginatedTagList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TagsClient { - protected final ClientOptions clientOptions; - - public TagsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Tag objects. - */ - public PaginatedTagList list() { - return list(TagsListRequest.builder().build()); - } - - /** - * Returns a list of Tag objects. - */ - public PaginatedTagList list(TagsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Tag objects. - */ - public PaginatedTagList list(TagsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/tags"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTagList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/tags/requests/TagsListRequest.java b/src/main/java/com/merge/api/resources/ats/tags/requests/TagsListRequest.java deleted file mode 100644 index 56973dd80..000000000 --- a/src/main/java/com/merge/api/resources/ats/tags/requests/TagsListRequest.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.tags.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TagsListRequest.Builder.class) -public final class TagsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private TagsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TagsListRequest && equalTo((TagsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TagsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TagsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public TagsListRequest build() { - return new TagsListRequest( - createdAfter, - createdBefore, - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AccountDetails.java b/src/main/java/com/merge/api/resources/ats/types/AccountDetails.java deleted file mode 100644 index fde2ee7d6..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AccountDetails.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetails.Builder.class) -public final class AccountDetails { - private final Optional id; - - private final Optional integration; - - private final Optional integrationSlug; - - private final Optional category; - - private final Optional endUserOriginId; - - private final Optional endUserOrganizationName; - - private final Optional endUserEmailAddress; - - private final Optional status; - - private final Optional webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional accountType; - - private final Optional completedAt; - - private final Map additionalProperties; - - private AccountDetails( - Optional id, - Optional integration, - Optional integrationSlug, - Optional category, - Optional endUserOriginId, - Optional endUserOrganizationName, - Optional endUserEmailAddress, - Optional status, - Optional webhookListenerUrl, - Optional isDuplicate, - Optional accountType, - Optional completedAt, - Map additionalProperties) { - this.id = id; - this.integration = integration; - this.integrationSlug = integrationSlug; - this.category = category; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.status = status; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("integration_slug") - public Optional getIntegrationSlug() { - return integrationSlug; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("webhook_listener_url") - public Optional getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The time at which account completes the linking flow. - */ - @JsonProperty("completed_at") - public Optional getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetails && equalTo((AccountDetails) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetails other) { - return id.equals(other.id) - && integration.equals(other.integration) - && integrationSlug.equals(other.integrationSlug) - && category.equals(other.category) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && status.equals(other.status) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.integration, - this.integrationSlug, - this.category, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.status, - this.webhookListenerUrl, - this.isDuplicate, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional integration = Optional.empty(); - - private Optional integrationSlug = Optional.empty(); - - private Optional category = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional webhookListenerUrl = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional completedAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountDetails other) { - id(other.getId()); - integration(other.getIntegration()); - integrationSlug(other.getIntegrationSlug()); - category(other.getCategory()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - status(other.getStatus()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public Builder integration(Optional integration) { - this.integration = integration; - return this; - } - - public Builder integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) - public Builder integrationSlug(Optional integrationSlug) { - this.integrationSlug = integrationSlug; - return this; - } - - public Builder integrationSlug(String integrationSlug) { - this.integrationSlug = Optional.ofNullable(integrationSlug); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) - public Builder webhookListenerUrl(Optional webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - public Builder webhookListenerUrl(String webhookListenerUrl) { - this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); - return this; - } - - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public Builder isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - public Builder isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(String accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) - public Builder completedAt(Optional completedAt) { - this.completedAt = completedAt; - return this; - } - - public Builder completedAt(OffsetDateTime completedAt) { - this.completedAt = Optional.ofNullable(completedAt); - return this; - } - - public AccountDetails build() { - return new AccountDetails( - id, - integration, - integrationSlug, - category, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - status, - webhookListenerUrl, - isDuplicate, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActions.java deleted file mode 100644 index 3b3ce6193..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActions.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) -public final class AccountDetailsAndActions { - private final String id; - - private final Optional category; - - private final AccountDetailsAndActionsStatusEnum status; - - private final Optional statusDetail; - - private final Optional endUserOriginId; - - private final String endUserOrganizationName; - - private final String endUserEmailAddress; - - private final Optional subdomain; - - private final String webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional integration; - - private final String accountType; - - private final OffsetDateTime completedAt; - - private final Map additionalProperties; - - private AccountDetailsAndActions( - String id, - Optional category, - AccountDetailsAndActionsStatusEnum status, - Optional statusDetail, - Optional endUserOriginId, - String endUserOrganizationName, - String endUserEmailAddress, - Optional subdomain, - String webhookListenerUrl, - Optional isDuplicate, - Optional integration, - String accountType, - OffsetDateTime completedAt, - Map additionalProperties) { - this.id = id; - this.category = category; - this.status = status; - this.statusDetail = statusDetail; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.subdomain = subdomain; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.integration = integration; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("status") - public AccountDetailsAndActionsStatusEnum getStatus() { - return status; - } - - @JsonProperty("status_detail") - public Optional getStatusDetail() { - return statusDetail; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return The tenant or domain the customer has provided access to. - */ - @JsonProperty("subdomain") - public Optional getSubdomain() { - return subdomain; - } - - @JsonProperty("webhook_listener_url") - public String getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("account_type") - public String getAccountType() { - return accountType; - } - - @JsonProperty("completed_at") - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActions other) { - return id.equals(other.id) - && category.equals(other.category) - && status.equals(other.status) - && statusDetail.equals(other.statusDetail) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && subdomain.equals(other.subdomain) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && integration.equals(other.integration) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.category, - this.status, - this.statusDetail, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.subdomain, - this.webhookListenerUrl, - this.isDuplicate, - this.integration, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - StatusStage id(@NotNull String id); - - Builder from(AccountDetailsAndActions other); - } - - public interface StatusStage { - EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); - } - - public interface EndUserOrganizationNameStage { - EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserEmailAddressStage { - WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); - } - - public interface WebhookListenerUrlStage { - AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); - } - - public interface AccountTypeStage { - CompletedAtStage accountType(@NotNull String accountType); - } - - public interface CompletedAtStage { - _FinalStage completedAt(@NotNull OffsetDateTime completedAt); - } - - public interface _FinalStage { - AccountDetailsAndActions build(); - - _FinalStage category(Optional category); - - _FinalStage category(CategoryEnum category); - - _FinalStage statusDetail(Optional statusDetail); - - _FinalStage statusDetail(String statusDetail); - - _FinalStage endUserOriginId(Optional endUserOriginId); - - _FinalStage endUserOriginId(String endUserOriginId); - - _FinalStage subdomain(Optional subdomain); - - _FinalStage subdomain(String subdomain); - - _FinalStage isDuplicate(Optional isDuplicate); - - _FinalStage isDuplicate(Boolean isDuplicate); - - _FinalStage integration(Optional integration); - - _FinalStage integration(AccountDetailsAndActionsIntegration integration); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements IdStage, - StatusStage, - EndUserOrganizationNameStage, - EndUserEmailAddressStage, - WebhookListenerUrlStage, - AccountTypeStage, - CompletedAtStage, - _FinalStage { - private String id; - - private AccountDetailsAndActionsStatusEnum status; - - private String endUserOrganizationName; - - private String endUserEmailAddress; - - private String webhookListenerUrl; - - private String accountType; - - private OffsetDateTime completedAt; - - private Optional integration = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional subdomain = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional statusDetail = Optional.empty(); - - private Optional category = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActions other) { - id(other.getId()); - category(other.getCategory()); - status(other.getStatus()); - statusDetail(other.getStatusDetail()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - subdomain(other.getSubdomain()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - integration(other.getIntegration()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public StatusStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_email_address") - public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - @java.lang.Override - @JsonSetter("webhook_listener_url") - public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - @java.lang.Override - @JsonSetter("account_type") - public CompletedAtStage accountType(@NotNull String accountType) { - this.accountType = accountType; - return this; - } - - @java.lang.Override - @JsonSetter("completed_at") - public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - @java.lang.Override - public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public _FinalStage isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - /** - *

The tenant or domain the customer has provided access to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage subdomain(String subdomain) { - this.subdomain = Optional.ofNullable(subdomain); - return this; - } - - @java.lang.Override - @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) - public _FinalStage subdomain(Optional subdomain) { - this.subdomain = subdomain; - return this; - } - - @java.lang.Override - public _FinalStage endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public _FinalStage endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - @java.lang.Override - public _FinalStage statusDetail(String statusDetail) { - this.statusDetail = Optional.ofNullable(statusDetail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) - public _FinalStage statusDetail(Optional statusDetail) { - this.statusDetail = statusDetail; - return this; - } - - @java.lang.Override - public _FinalStage category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public _FinalStage category(Optional category) { - this.category = category; - return this; - } - - @java.lang.Override - public AccountDetailsAndActions build() { - return new AccountDetailsAndActions( - id, - category, - status, - statusDetail, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - subdomain, - webhookListenerUrl, - isDuplicate, - integration, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActionsIntegration.java deleted file mode 100644 index 0b4a09859..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActionsIntegration.java +++ /dev/null @@ -1,328 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) -public final class AccountDetailsAndActionsIntegration { - private final String name; - - private final List categories; - - private final Optional image; - - private final Optional squareImage; - - private final String color; - - private final String slug; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AccountDetailsAndActionsIntegration( - String name, - List categories, - Optional image, - Optional squareImage, - String color, - String slug, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.name = name; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - @JsonProperty("image") - public Optional getImage() { - return image; - } - - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - @JsonProperty("color") - public String getColor() { - return color; - } - - @JsonProperty("slug") - public String getSlug() { - return slug; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActionsIntegration - && equalTo((AccountDetailsAndActionsIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActionsIntegration other) { - return name.equals(other.name) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.passthroughAvailable, - this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - ColorStage name(@NotNull String name); - - Builder from(AccountDetailsAndActionsIntegration other); - } - - public interface ColorStage { - SlugStage color(@NotNull String color); - } - - public interface SlugStage { - PassthroughAvailableStage slug(@NotNull String slug); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AccountDetailsAndActionsIntegration build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { - private String name; - - private String color; - - private String slug; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActionsIntegration other) { - name(other.getName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public ColorStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("color") - public SlugStage color(@NotNull String color) { - this.color = color; - return this; - } - - @java.lang.Override - @JsonSetter("slug") - public PassthroughAvailableStage slug(@NotNull String slug) { - this.slug = slug; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public AccountDetailsAndActionsIntegration build() { - return new AccountDetailsAndActionsIntegration( - name, - categories, - image, - squareImage, - color, - slug, - passthroughAvailable, - availableModelOperations, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActionsStatusEnum.java deleted file mode 100644 index 2bd85fb62..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AccountDetailsAndActionsStatusEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AccountDetailsAndActionsStatusEnum { - COMPLETE("COMPLETE"), - - INCOMPLETE("INCOMPLETE"), - - RELINK_NEEDED("RELINK_NEEDED"), - - IDLE("IDLE"); - - private final String value; - - AccountDetailsAndActionsStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AccountIntegration.java b/src/main/java/com/merge/api/resources/ats/types/AccountIntegration.java deleted file mode 100644 index b5d5122d5..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AccountIntegration.java +++ /dev/null @@ -1,463 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountIntegration.Builder.class) -public final class AccountIntegration { - private final String name; - - private final Optional abbreviatedName; - - private final Optional> categories; - - private final Optional image; - - private final Optional squareImage; - - private final Optional color; - - private final Optional slug; - - private final Optional> apiEndpointsToDocumentationUrls; - - private final Optional webhookSetupGuideUrl; - - private final Optional> categoryBetaStatus; - - private final Map additionalProperties; - - private AccountIntegration( - String name, - Optional abbreviatedName, - Optional> categories, - Optional image, - Optional squareImage, - Optional color, - Optional slug, - Optional> apiEndpointsToDocumentationUrls, - Optional webhookSetupGuideUrl, - Optional> categoryBetaStatus, - Map additionalProperties) { - this.name = name; - this.abbreviatedName = abbreviatedName; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - this.categoryBetaStatus = categoryBetaStatus; - this.additionalProperties = additionalProperties; - } - - /** - * @return Company name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> - */ - @JsonProperty("abbreviated_name") - public Optional getAbbreviatedName() { - return abbreviatedName; - } - - /** - * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. - */ - @JsonProperty("categories") - public Optional> getCategories() { - return categories; - } - - /** - * @return Company logo in rectangular shape. - */ - @JsonProperty("image") - public Optional getImage() { - return image; - } - - /** - * @return Company logo in square shape. - */ - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - /** - * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> - */ - @JsonProperty("color") - public Optional getColor() { - return color; - } - - @JsonProperty("slug") - public Optional getSlug() { - return slug; - } - - /** - * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} - */ - @JsonProperty("api_endpoints_to_documentation_urls") - public Optional> getApiEndpointsToDocumentationUrls() { - return apiEndpointsToDocumentationUrls; - } - - /** - * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. - */ - @JsonProperty("webhook_setup_guide_url") - public Optional getWebhookSetupGuideUrl() { - return webhookSetupGuideUrl; - } - - /** - * @return Category or categories this integration is in beta status for. - */ - @JsonProperty("category_beta_status") - public Optional> getCategoryBetaStatus() { - return categoryBetaStatus; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountIntegration && equalTo((AccountIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountIntegration other) { - return name.equals(other.name) - && abbreviatedName.equals(other.abbreviatedName) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) - && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) - && categoryBetaStatus.equals(other.categoryBetaStatus); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.abbreviatedName, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.apiEndpointsToDocumentationUrls, - this.webhookSetupGuideUrl, - this.categoryBetaStatus); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(AccountIntegration other); - } - - public interface _FinalStage { - AccountIntegration build(); - - _FinalStage abbreviatedName(Optional abbreviatedName); - - _FinalStage abbreviatedName(String abbreviatedName); - - _FinalStage categories(Optional> categories); - - _FinalStage categories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage color(Optional color); - - _FinalStage color(String color); - - _FinalStage slug(Optional slug); - - _FinalStage slug(String slug); - - _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); - - _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); - - _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); - - _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); - - _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); - - _FinalStage categoryBetaStatus(Map categoryBetaStatus); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - private Optional> categoryBetaStatus = Optional.empty(); - - private Optional webhookSetupGuideUrl = Optional.empty(); - - private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); - - private Optional slug = Optional.empty(); - - private Optional color = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private Optional> categories = Optional.empty(); - - private Optional abbreviatedName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountIntegration other) { - name(other.getName()); - abbreviatedName(other.getAbbreviatedName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); - webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); - categoryBetaStatus(other.getCategoryBetaStatus()); - return this; - } - - /** - *

Company name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

Category or categories this integration is in beta status for.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { - this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) - public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { - this.categoryBetaStatus = categoryBetaStatus; - return this; - } - - /** - *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) - public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - return this; - } - - /** - *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); - return this; - } - - @java.lang.Override - @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) - public _FinalStage apiEndpointsToDocumentationUrls( - Optional> apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - return this; - } - - @java.lang.Override - public _FinalStage slug(String slug) { - this.slug = Optional.ofNullable(slug); - return this; - } - - @java.lang.Override - @JsonSetter(value = "slug", nulls = Nulls.SKIP) - public _FinalStage slug(Optional slug) { - this.slug = slug; - return this; - } - - /** - *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage color(String color) { - this.color = Optional.ofNullable(color); - return this; - } - - @java.lang.Override - @JsonSetter(value = "color", nulls = Nulls.SKIP) - public _FinalStage color(Optional color) { - this.color = color; - return this; - } - - /** - *

Company logo in square shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - /** - *

Company logo in rectangular shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - /** - *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categories(List categories) { - this.categories = Optional.ofNullable(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(Optional> categories) { - this.categories = categories; - return this; - } - - /** - *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage abbreviatedName(String abbreviatedName) { - this.abbreviatedName = Optional.ofNullable(abbreviatedName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) - public _FinalStage abbreviatedName(Optional abbreviatedName) { - this.abbreviatedName = abbreviatedName; - return this; - } - - @java.lang.Override - public AccountIntegration build() { - return new AccountIntegration( - name, - abbreviatedName, - categories, - image, - squareImage, - color, - slug, - apiEndpointsToDocumentationUrls, - webhookSetupGuideUrl, - categoryBetaStatus, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AccountToken.java b/src/main/java/com/merge/api/resources/ats/types/AccountToken.java deleted file mode 100644 index 6acc06eee..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AccountToken.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountToken.Builder.class) -public final class AccountToken { - private final String accountToken; - - private final AccountIntegration integration; - - private final Map additionalProperties; - - private AccountToken( - String accountToken, AccountIntegration integration, Map additionalProperties) { - this.accountToken = accountToken; - this.integration = integration; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public String getAccountToken() { - return accountToken; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountToken && equalTo((AccountToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountToken other) { - return accountToken.equals(other.accountToken) && integration.equals(other.integration); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.accountToken, this.integration); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccountTokenStage builder() { - return new Builder(); - } - - public interface AccountTokenStage { - IntegrationStage accountToken(@NotNull String accountToken); - - Builder from(AccountToken other); - } - - public interface IntegrationStage { - _FinalStage integration(@NotNull AccountIntegration integration); - } - - public interface _FinalStage { - AccountToken build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountTokenStage, IntegrationStage, _FinalStage { - private String accountToken; - - private AccountIntegration integration; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountToken other) { - accountToken(other.getAccountToken()); - integration(other.getIntegration()); - return this; - } - - @java.lang.Override - @JsonSetter("account_token") - public IntegrationStage accountToken(@NotNull String accountToken) { - this.accountToken = accountToken; - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public _FinalStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - public AccountToken build() { - return new AccountToken(accountToken, integration, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityActivityType.java b/src/main/java/com/merge/api/resources/ats/types/ActivityActivityType.java deleted file mode 100644 index 0a627c478..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityActivityType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ActivityActivityType.Deserializer.class) -public final class ActivityActivityType { - private final Object value; - - private final int type; - - private ActivityActivityType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ActivityTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActivityActivityType && equalTo((ActivityActivityType) other); - } - - private boolean equalTo(ActivityActivityType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ActivityActivityType of(ActivityTypeEnum value) { - return new ActivityActivityType(value, 0); - } - - public static ActivityActivityType of(String value) { - return new ActivityActivityType(value, 1); - } - - public interface Visitor { - T visit(ActivityTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ActivityActivityType.class); - } - - @java.lang.Override - public ActivityActivityType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActivityTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityRequestActivityType.java b/src/main/java/com/merge/api/resources/ats/types/ActivityRequestActivityType.java deleted file mode 100644 index b83affbb3..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityRequestActivityType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ActivityRequestActivityType.Deserializer.class) -public final class ActivityRequestActivityType { - private final Object value; - - private final int type; - - private ActivityRequestActivityType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ActivityTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActivityRequestActivityType && equalTo((ActivityRequestActivityType) other); - } - - private boolean equalTo(ActivityRequestActivityType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ActivityRequestActivityType of(ActivityTypeEnum value) { - return new ActivityRequestActivityType(value, 0); - } - - public static ActivityRequestActivityType of(String value) { - return new ActivityRequestActivityType(value, 1); - } - - public interface Visitor { - T visit(ActivityTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ActivityRequestActivityType.class); - } - - @java.lang.Override - public ActivityRequestActivityType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActivityTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityRequestVisibility.java b/src/main/java/com/merge/api/resources/ats/types/ActivityRequestVisibility.java deleted file mode 100644 index 798f66bb8..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityRequestVisibility.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ActivityRequestVisibility.Deserializer.class) -public final class ActivityRequestVisibility { - private final Object value; - - private final int type; - - private ActivityRequestVisibility(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((VisibilityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActivityRequestVisibility && equalTo((ActivityRequestVisibility) other); - } - - private boolean equalTo(ActivityRequestVisibility other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ActivityRequestVisibility of(VisibilityEnum value) { - return new ActivityRequestVisibility(value, 0); - } - - public static ActivityRequestVisibility of(String value) { - return new ActivityRequestVisibility(value, 1); - } - - public interface Visitor { - T visit(VisibilityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ActivityRequestVisibility.class); - } - - @java.lang.Override - public ActivityRequestVisibility deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, VisibilityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityTypeEnum.java b/src/main/java/com/merge/api/resources/ats/types/ActivityTypeEnum.java deleted file mode 100644 index ae47f7816..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityTypeEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ActivityTypeEnum { - NOTE("NOTE"), - - EMAIL("EMAIL"), - - OTHER("OTHER"); - - private final String value; - - ActivityTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ActivityVisibility.java b/src/main/java/com/merge/api/resources/ats/types/ActivityVisibility.java deleted file mode 100644 index a96043903..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ActivityVisibility.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ActivityVisibility.Deserializer.class) -public final class ActivityVisibility { - private final Object value; - - private final int type; - - private ActivityVisibility(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((VisibilityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActivityVisibility && equalTo((ActivityVisibility) other); - } - - private boolean equalTo(ActivityVisibility other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ActivityVisibility of(VisibilityEnum value) { - return new ActivityVisibility(value, 0); - } - - public static ActivityVisibility of(String value) { - return new ActivityVisibility(value, 1); - } - - public interface Visitor { - T visit(VisibilityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ActivityVisibility.class); - } - - @java.lang.Override - public ActivityVisibility deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, VisibilityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AdvancedMetadata.java b/src/main/java/com/merge/api/resources/ats/types/AdvancedMetadata.java deleted file mode 100644 index 26743ca5f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AdvancedMetadata.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedMetadata.Builder.class) -public final class AdvancedMetadata { - private final String id; - - private final Optional displayName; - - private final Optional description; - - private final Optional isRequired; - - private final Optional isCustom; - - private final Optional> fieldChoices; - - private final Map additionalProperties; - - private AdvancedMetadata( - String id, - Optional displayName, - Optional description, - Optional isRequired, - Optional isCustom, - Optional> fieldChoices, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.description = description; - this.isRequired = isRequired; - this.isCustom = isCustom; - this.fieldChoices = fieldChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedMetadata other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && description.equals(other.description) - && isRequired.equals(other.isRequired) - && isCustom.equals(other.isCustom) - && fieldChoices.equals(other.fieldChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - _FinalStage id(@NotNull String id); - - Builder from(AdvancedMetadata other); - } - - public interface _FinalStage { - AdvancedMetadata build(); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage description(Optional description); - - _FinalStage description(String description); - - _FinalStage isRequired(Optional isRequired); - - _FinalStage isRequired(Boolean isRequired); - - _FinalStage isCustom(Optional isCustom); - - _FinalStage isCustom(Boolean isCustom); - - _FinalStage fieldChoices(Optional> fieldChoices); - - _FinalStage fieldChoices(List fieldChoices); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, _FinalStage { - private String id; - - private Optional> fieldChoices = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedMetadata other) { - id(other.getId()); - displayName(other.getDisplayName()); - description(other.getDescription()); - isRequired(other.getIsRequired()); - isCustom(other.getIsCustom()); - fieldChoices(other.getFieldChoices()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public _FinalStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - public _FinalStage fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public _FinalStage fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - @java.lang.Override - public _FinalStage isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public _FinalStage isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - @java.lang.Override - public _FinalStage isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public _FinalStage isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - @java.lang.Override - public _FinalStage description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @java.lang.Override - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public _FinalStage description(Optional description) { - this.description = description; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - @java.lang.Override - public AdvancedMetadata build() { - return new AdvancedMetadata( - id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/resources/ats/types/AsyncPassthroughReciept.java deleted file mode 100644 index 5762d11c7..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AsyncPassthroughReciept.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) -public final class AsyncPassthroughReciept { - private final String asyncPassthroughReceiptId; - - private final Map additionalProperties; - - private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("async_passthrough_receipt_id") - public String getAsyncPassthroughReceiptId() { - return asyncPassthroughReceiptId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AsyncPassthroughReciept other) { - return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncPassthroughReceiptId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AsyncPassthroughReceiptIdStage builder() { - return new Builder(); - } - - public interface AsyncPassthroughReceiptIdStage { - _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); - - Builder from(AsyncPassthroughReciept other); - } - - public interface _FinalStage { - AsyncPassthroughReciept build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { - private String asyncPassthroughReceiptId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AsyncPassthroughReciept other) { - asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); - return this; - } - - @java.lang.Override - @JsonSetter("async_passthrough_receipt_id") - public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - return this; - } - - @java.lang.Override - public AsyncPassthroughReciept build() { - return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/Attachment.java b/src/main/java/com/merge/api/resources/ats/types/Attachment.java deleted file mode 100644 index 044ace13e..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/Attachment.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Attachment.Builder.class) -public final class Attachment { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional fileName; - - private final Optional fileUrl; - - private final Optional candidate; - - private final Optional attachmentType; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Attachment( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional fileName, - Optional fileUrl, - Optional candidate, - Optional attachmentType, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.fileName = fileName; - this.fileUrl = fileUrl; - this.candidate = candidate; - this.attachmentType = attachmentType; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The attachment's name. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The attachment's url. - */ - @JsonProperty("file_url") - public Optional getFileUrl() { - return fileUrl; - } - - /** - * @return - */ - @JsonProperty("candidate") - public Optional getCandidate() { - return candidate; - } - - /** - * @return The attachment's type. - *
    - *
  • RESUME - RESUME
  • - *
  • COVER_LETTER - COVER_LETTER
  • - *
  • OFFER_LETTER - OFFER_LETTER
  • - *
  • OTHER - OTHER
  • - *
- */ - @JsonProperty("attachment_type") - public Optional getAttachmentType() { - return attachmentType; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Attachment && equalTo((Attachment) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Attachment other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && fileName.equals(other.fileName) - && fileUrl.equals(other.fileUrl) - && candidate.equals(other.candidate) - && attachmentType.equals(other.attachmentType) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.fileName, - this.fileUrl, - this.candidate, - this.attachmentType, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional fileUrl = Optional.empty(); - - private Optional candidate = Optional.empty(); - - private Optional attachmentType = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Attachment other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - fileName(other.getFileName()); - fileUrl(other.getFileUrl()); - candidate(other.getCandidate()); - attachmentType(other.getAttachmentType()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public Builder fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - public Builder fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @JsonSetter(value = "file_url", nulls = Nulls.SKIP) - public Builder fileUrl(Optional fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - public Builder fileUrl(String fileUrl) { - this.fileUrl = Optional.ofNullable(fileUrl); - return this; - } - - @JsonSetter(value = "candidate", nulls = Nulls.SKIP) - public Builder candidate(Optional candidate) { - this.candidate = candidate; - return this; - } - - public Builder candidate(String candidate) { - this.candidate = Optional.ofNullable(candidate); - return this; - } - - @JsonSetter(value = "attachment_type", nulls = Nulls.SKIP) - public Builder attachmentType(Optional attachmentType) { - this.attachmentType = attachmentType; - return this; - } - - public Builder attachmentType(AttachmentAttachmentType attachmentType) { - this.attachmentType = Optional.ofNullable(attachmentType); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Attachment build() { - return new Attachment( - id, - remoteId, - createdAt, - modifiedAt, - fileName, - fileUrl, - candidate, - attachmentType, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AttachmentAttachmentType.java b/src/main/java/com/merge/api/resources/ats/types/AttachmentAttachmentType.java deleted file mode 100644 index 11678b1ea..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AttachmentAttachmentType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AttachmentAttachmentType.Deserializer.class) -public final class AttachmentAttachmentType { - private final Object value; - - private final int type; - - private AttachmentAttachmentType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AttachmentTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentAttachmentType && equalTo((AttachmentAttachmentType) other); - } - - private boolean equalTo(AttachmentAttachmentType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AttachmentAttachmentType of(AttachmentTypeEnum value) { - return new AttachmentAttachmentType(value, 0); - } - - public static AttachmentAttachmentType of(String value) { - return new AttachmentAttachmentType(value, 1); - } - - public interface Visitor { - T visit(AttachmentTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AttachmentAttachmentType.class); - } - - @java.lang.Override - public AttachmentAttachmentType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AttachmentTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AttachmentRequest.java b/src/main/java/com/merge/api/resources/ats/types/AttachmentRequest.java deleted file mode 100644 index 028785ad7..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AttachmentRequest.java +++ /dev/null @@ -1,249 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentRequest.Builder.class) -public final class AttachmentRequest { - private final Optional fileName; - - private final Optional fileUrl; - - private final Optional candidate; - - private final Optional attachmentType; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private AttachmentRequest( - Optional fileName, - Optional fileUrl, - Optional candidate, - Optional attachmentType, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.fileName = fileName; - this.fileUrl = fileUrl; - this.candidate = candidate; - this.attachmentType = attachmentType; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The attachment's name. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The attachment's url. - */ - @JsonProperty("file_url") - public Optional getFileUrl() { - return fileUrl; - } - - /** - * @return - */ - @JsonProperty("candidate") - public Optional getCandidate() { - return candidate; - } - - /** - * @return The attachment's type. - *
    - *
  • RESUME - RESUME
  • - *
  • COVER_LETTER - COVER_LETTER
  • - *
  • OFFER_LETTER - OFFER_LETTER
  • - *
  • OTHER - OTHER
  • - *
- */ - @JsonProperty("attachment_type") - public Optional getAttachmentType() { - return attachmentType; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentRequest && equalTo((AttachmentRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentRequest other) { - return fileName.equals(other.fileName) - && fileUrl.equals(other.fileUrl) - && candidate.equals(other.candidate) - && attachmentType.equals(other.attachmentType) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.fileName, - this.fileUrl, - this.candidate, - this.attachmentType, - this.integrationParams, - this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional fileName = Optional.empty(); - - private Optional fileUrl = Optional.empty(); - - private Optional candidate = Optional.empty(); - - private Optional attachmentType = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentRequest other) { - fileName(other.getFileName()); - fileUrl(other.getFileUrl()); - candidate(other.getCandidate()); - attachmentType(other.getAttachmentType()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public Builder fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - public Builder fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @JsonSetter(value = "file_url", nulls = Nulls.SKIP) - public Builder fileUrl(Optional fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - public Builder fileUrl(String fileUrl) { - this.fileUrl = Optional.ofNullable(fileUrl); - return this; - } - - @JsonSetter(value = "candidate", nulls = Nulls.SKIP) - public Builder candidate(Optional candidate) { - this.candidate = candidate; - return this; - } - - public Builder candidate(String candidate) { - this.candidate = Optional.ofNullable(candidate); - return this; - } - - @JsonSetter(value = "attachment_type", nulls = Nulls.SKIP) - public Builder attachmentType(Optional attachmentType) { - this.attachmentType = attachmentType; - return this; - } - - public Builder attachmentType(AttachmentRequestAttachmentType attachmentType) { - this.attachmentType = Optional.ofNullable(attachmentType); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public AttachmentRequest build() { - return new AttachmentRequest( - fileName, - fileUrl, - candidate, - attachmentType, - integrationParams, - linkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AttachmentRequestAttachmentType.java b/src/main/java/com/merge/api/resources/ats/types/AttachmentRequestAttachmentType.java deleted file mode 100644 index ea216f02f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AttachmentRequestAttachmentType.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AttachmentRequestAttachmentType.Deserializer.class) -public final class AttachmentRequestAttachmentType { - private final Object value; - - private final int type; - - private AttachmentRequestAttachmentType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AttachmentTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentRequestAttachmentType && equalTo((AttachmentRequestAttachmentType) other); - } - - private boolean equalTo(AttachmentRequestAttachmentType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AttachmentRequestAttachmentType of(AttachmentTypeEnum value) { - return new AttachmentRequestAttachmentType(value, 0); - } - - public static AttachmentRequestAttachmentType of(String value) { - return new AttachmentRequestAttachmentType(value, 1); - } - - public interface Visitor { - T visit(AttachmentTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AttachmentRequestAttachmentType.class); - } - - @java.lang.Override - public AttachmentRequestAttachmentType deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AttachmentTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AuditLogEvent.java b/src/main/java/com/merge/api/resources/ats/types/AuditLogEvent.java deleted file mode 100644 index 105c5fb50..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AuditLogEvent.java +++ /dev/null @@ -1,447 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditLogEvent.Builder.class) -public final class AuditLogEvent { - private final Optional id; - - private final Optional userName; - - private final Optional userEmail; - - private final AuditLogEventRole role; - - private final String ipAddress; - - private final AuditLogEventEventType eventType; - - private final String eventDescription; - - private final Optional createdAt; - - private final Map additionalProperties; - - private AuditLogEvent( - Optional id, - Optional userName, - Optional userEmail, - AuditLogEventRole role, - String ipAddress, - AuditLogEventEventType eventType, - String eventDescription, - Optional createdAt, - Map additionalProperties) { - this.id = id; - this.userName = userName; - this.userEmail = userEmail; - this.role = role; - this.ipAddress = ipAddress; - this.eventType = eventType; - this.eventDescription = eventDescription; - this.createdAt = createdAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The User's full name at the time of this Event occurring. - */ - @JsonProperty("user_name") - public Optional getUserName() { - return userName; - } - - /** - * @return The User's email at the time of this Event occurring. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - /** - * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. - *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- */ - @JsonProperty("role") - public AuditLogEventRole getRole() { - return role; - } - - @JsonProperty("ip_address") - public String getIpAddress() { - return ipAddress; - } - - /** - * @return Designates the type of event that occurred. - *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- */ - @JsonProperty("event_type") - public AuditLogEventEventType getEventType() { - return eventType; - } - - @JsonProperty("event_description") - public String getEventDescription() { - return eventDescription; - } - - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditLogEvent other) { - return id.equals(other.id) - && userName.equals(other.userName) - && userEmail.equals(other.userEmail) - && role.equals(other.role) - && ipAddress.equals(other.ipAddress) - && eventType.equals(other.eventType) - && eventDescription.equals(other.eventDescription) - && createdAt.equals(other.createdAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.userName, - this.userEmail, - this.role, - this.ipAddress, - this.eventType, - this.eventDescription, - this.createdAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RoleStage builder() { - return new Builder(); - } - - public interface RoleStage { - IpAddressStage role(@NotNull AuditLogEventRole role); - - Builder from(AuditLogEvent other); - } - - public interface IpAddressStage { - EventTypeStage ipAddress(@NotNull String ipAddress); - } - - public interface EventTypeStage { - EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); - } - - public interface EventDescriptionStage { - _FinalStage eventDescription(@NotNull String eventDescription); - } - - public interface _FinalStage { - AuditLogEvent build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage userName(Optional userName); - - _FinalStage userName(String userName); - - _FinalStage userEmail(Optional userEmail); - - _FinalStage userEmail(String userEmail); - - _FinalStage createdAt(Optional createdAt); - - _FinalStage createdAt(OffsetDateTime createdAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { - private AuditLogEventRole role; - - private String ipAddress; - - private AuditLogEventEventType eventType; - - private String eventDescription; - - private Optional createdAt = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - private Optional userName = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AuditLogEvent other) { - id(other.getId()); - userName(other.getUserName()); - userEmail(other.getUserEmail()); - role(other.getRole()); - ipAddress(other.getIpAddress()); - eventType(other.getEventType()); - eventDescription(other.getEventDescription()); - createdAt(other.getCreatedAt()); - return this; - } - - /** - *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

- *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("role") - public IpAddressStage role(@NotNull AuditLogEventRole role) { - this.role = role; - return this; - } - - @java.lang.Override - @JsonSetter("ip_address") - public EventTypeStage ipAddress(@NotNull String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - *

Designates the type of event that occurred.

- *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("event_type") - public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { - this.eventType = eventType; - return this; - } - - @java.lang.Override - @JsonSetter("event_description") - public _FinalStage eventDescription(@NotNull String eventDescription) { - this.eventDescription = eventDescription; - return this; - } - - @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public _FinalStage createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The User's email at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public _FinalStage userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - *

The User's full name at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userName(String userName) { - this.userName = Optional.ofNullable(userName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_name", nulls = Nulls.SKIP) - public _FinalStage userName(Optional userName) { - this.userName = userName; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public AuditLogEvent build() { - return new AuditLogEvent( - id, - userName, - userEmail, - role, - ipAddress, - eventType, - eventDescription, - createdAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/resources/ats/types/AuditLogEventEventType.java deleted file mode 100644 index c9de1a5ea..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AuditLogEventEventType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) -public final class AuditLogEventEventType { - private final Object value; - - private final int type; - - private AuditLogEventEventType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EventTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); - } - - private boolean equalTo(AuditLogEventEventType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventEventType of(EventTypeEnum value) { - return new AuditLogEventEventType(value, 0); - } - - public static AuditLogEventEventType of(String value) { - return new AuditLogEventEventType(value, 1); - } - - public interface Visitor { - T visit(EventTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventEventType.class); - } - - @java.lang.Override - public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AuditLogEventRole.java b/src/main/java/com/merge/api/resources/ats/types/AuditLogEventRole.java deleted file mode 100644 index 56eef04ae..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AuditLogEventRole.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) -public final class AuditLogEventRole { - private final Object value; - - private final int type; - - private AuditLogEventRole(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RoleEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); - } - - private boolean equalTo(AuditLogEventRole other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventRole of(RoleEnum value) { - return new AuditLogEventRole(value, 0); - } - - public static AuditLogEventRole of(String value) { - return new AuditLogEventRole(value, 1); - } - - public interface Visitor { - T visit(RoleEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventRole.class); - } - - @java.lang.Override - public AuditLogEventRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/AvailableActions.java b/src/main/java/com/merge/api/resources/ats/types/AvailableActions.java deleted file mode 100644 index 5c4725223..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/AvailableActions.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AvailableActions.Builder.class) -public final class AvailableActions { - private final AccountIntegration integration; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AvailableActions( - AccountIntegration integration, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.integration = integration; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AvailableActions && equalTo((AvailableActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AvailableActions other) { - return integration.equals(other.integration) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IntegrationStage builder() { - return new Builder(); - } - - public interface IntegrationStage { - PassthroughAvailableStage integration(@NotNull AccountIntegration integration); - - Builder from(AvailableActions other); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AvailableActions build(); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { - private AccountIntegration integration; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AvailableActions other) { - integration(other.getIntegration()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public AvailableActions build() { - return new AvailableActions( - integration, passthroughAvailable, availableModelOperations, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/CategoriesEnum.java b/src/main/java/com/merge/api/resources/ats/types/CategoriesEnum.java deleted file mode 100644 index 28b3cf92d..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/CategoriesEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoriesEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoriesEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/CategoryEnum.java b/src/main/java/com/merge/api/resources/ats/types/CategoryEnum.java deleted file mode 100644 index 4825f4f40..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/CategoryEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoryEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/resources/ats/types/CommonModelScopeApi.java deleted file mode 100644 index 765f05e43..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/CommonModelScopeApi.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) -public final class CommonModelScopeApi { - private final List commonModels; - - private final Map additionalProperties; - - private CommonModelScopeApi( - List commonModels, Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopeApi other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CommonModelScopeApi other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public CommonModelScopeApi build() { - return new CommonModelScopeApi(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/resources/ats/types/CommonModelScopesBodyRequest.java deleted file mode 100644 index ac3ab167f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/CommonModelScopesBodyRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) -public final class CommonModelScopesBodyRequest { - private final String modelId; - - private final List enabledActions; - - private final List disabledFields; - - private final Map additionalProperties; - - private CommonModelScopesBodyRequest( - String modelId, - List enabledActions, - List disabledFields, - Map additionalProperties) { - this.modelId = modelId; - this.enabledActions = enabledActions; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("enabled_actions") - public List getEnabledActions() { - return enabledActions; - } - - @JsonProperty("disabled_fields") - public List getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopesBodyRequest other) { - return modelId.equals(other.modelId) - && enabledActions.equals(other.enabledActions) - && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelIdStage builder() { - return new Builder(); - } - - public interface ModelIdStage { - _FinalStage modelId(@NotNull String modelId); - - Builder from(CommonModelScopesBodyRequest other); - } - - public interface _FinalStage { - CommonModelScopesBodyRequest build(); - - _FinalStage enabledActions(List enabledActions); - - _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); - - _FinalStage addAllEnabledActions(List enabledActions); - - _FinalStage disabledFields(List disabledFields); - - _FinalStage addDisabledFields(String disabledFields); - - _FinalStage addAllDisabledFields(List disabledFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelIdStage, _FinalStage { - private String modelId; - - private List disabledFields = new ArrayList<>(); - - private List enabledActions = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CommonModelScopesBodyRequest other) { - modelId(other.getModelId()); - enabledActions(other.getEnabledActions()); - disabledFields(other.getDisabledFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public _FinalStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - public _FinalStage addAllDisabledFields(List disabledFields) { - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addDisabledFields(String disabledFields) { - this.disabledFields.add(disabledFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public _FinalStage disabledFields(List disabledFields) { - this.disabledFields.clear(); - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllEnabledActions(List enabledActions) { - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { - this.enabledActions.add(enabledActions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) - public _FinalStage enabledActions(List enabledActions) { - this.enabledActions.clear(); - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public CommonModelScopesBodyRequest build() { - return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/resources/ats/types/DataPassthroughRequest.java deleted file mode 100644 index ca53229a8..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/DataPassthroughRequest.java +++ /dev/null @@ -1,371 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) -public final class DataPassthroughRequest { - private final MethodEnum method; - - private final String path; - - private final Optional baseUrlOverride; - - private final Optional data; - - private final Optional> multipartFormData; - - private final Optional> headers; - - private final Optional requestFormat; - - private final Optional normalizeResponse; - - private final Map additionalProperties; - - private DataPassthroughRequest( - MethodEnum method, - String path, - Optional baseUrlOverride, - Optional data, - Optional> multipartFormData, - Optional> headers, - Optional requestFormat, - Optional normalizeResponse, - Map additionalProperties) { - this.method = method; - this.path = path; - this.baseUrlOverride = baseUrlOverride; - this.data = data; - this.multipartFormData = multipartFormData; - this.headers = headers; - this.requestFormat = requestFormat; - this.normalizeResponse = normalizeResponse; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public MethodEnum getMethod() { - return method; - } - - /** - * @return The path of the request in the third party's platform. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - /** - * @return An optional override of the third party's base url for the request. - */ - @JsonProperty("base_url_override") - public Optional getBaseUrlOverride() { - return baseUrlOverride; - } - - /** - * @return The data with the request. You must include a request_format parameter matching the data's format - */ - @JsonProperty("data") - public Optional getData() { - return data; - } - - /** - * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. - */ - @JsonProperty("multipart_form_data") - public Optional> getMultipartFormData() { - return multipartFormData; - } - - /** - * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("request_format") - public Optional getRequestFormat() { - return requestFormat; - } - - /** - * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. - */ - @JsonProperty("normalize_response") - public Optional getNormalizeResponse() { - return normalizeResponse; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DataPassthroughRequest other) { - return method.equals(other.method) - && path.equals(other.path) - && baseUrlOverride.equals(other.baseUrlOverride) - && data.equals(other.data) - && multipartFormData.equals(other.multipartFormData) - && headers.equals(other.headers) - && requestFormat.equals(other.requestFormat) - && normalizeResponse.equals(other.normalizeResponse); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.baseUrlOverride, - this.data, - this.multipartFormData, - this.headers, - this.requestFormat, - this.normalizeResponse); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull MethodEnum method); - - Builder from(DataPassthroughRequest other); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - } - - public interface _FinalStage { - DataPassthroughRequest build(); - - _FinalStage baseUrlOverride(Optional baseUrlOverride); - - _FinalStage baseUrlOverride(String baseUrlOverride); - - _FinalStage data(Optional data); - - _FinalStage data(String data); - - _FinalStage multipartFormData(Optional> multipartFormData); - - _FinalStage multipartFormData(List multipartFormData); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - - _FinalStage requestFormat(Optional requestFormat); - - _FinalStage requestFormat(RequestFormatEnum requestFormat); - - _FinalStage normalizeResponse(Optional normalizeResponse); - - _FinalStage normalizeResponse(Boolean normalizeResponse); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, _FinalStage { - private MethodEnum method; - - private String path; - - private Optional normalizeResponse = Optional.empty(); - - private Optional requestFormat = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional> multipartFormData = Optional.empty(); - - private Optional data = Optional.empty(); - - private Optional baseUrlOverride = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DataPassthroughRequest other) { - method(other.getMethod()); - path(other.getPath()); - baseUrlOverride(other.getBaseUrlOverride()); - data(other.getData()); - multipartFormData(other.getMultipartFormData()); - headers(other.getHeaders()); - requestFormat(other.getRequestFormat()); - normalizeResponse(other.getNormalizeResponse()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull MethodEnum method) { - this.method = method; - return this; - } - - /** - *

The path of the request in the third party's platform.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - /** - *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage normalizeResponse(Boolean normalizeResponse) { - this.normalizeResponse = Optional.ofNullable(normalizeResponse); - return this; - } - - @java.lang.Override - @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) - public _FinalStage normalizeResponse(Optional normalizeResponse) { - this.normalizeResponse = normalizeResponse; - return this; - } - - @java.lang.Override - public _FinalStage requestFormat(RequestFormatEnum requestFormat) { - this.requestFormat = Optional.ofNullable(requestFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_format", nulls = Nulls.SKIP) - public _FinalStage requestFormat(Optional requestFormat) { - this.requestFormat = requestFormat; - return this; - } - - /** - *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - /** - *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage multipartFormData(List multipartFormData) { - this.multipartFormData = Optional.ofNullable(multipartFormData); - return this; - } - - @java.lang.Override - @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) - public _FinalStage multipartFormData(Optional> multipartFormData) { - this.multipartFormData = multipartFormData; - return this; - } - - /** - *

The data with the request. You must include a request_format parameter matching the data's format

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage data(String data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - /** - *

An optional override of the third party's base url for the request.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage baseUrlOverride(String baseUrlOverride) { - this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); - return this; - } - - @java.lang.Override - @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) - public _FinalStage baseUrlOverride(Optional baseUrlOverride) { - this.baseUrlOverride = baseUrlOverride; - return this; - } - - @java.lang.Override - public DataPassthroughRequest build() { - return new DataPassthroughRequest( - method, - path, - baseUrlOverride, - data, - multipartFormData, - headers, - requestFormat, - normalizeResponse, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/DebugModeLog.java b/src/main/java/com/merge/api/resources/ats/types/DebugModeLog.java deleted file mode 100644 index 23d6a12eb..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/DebugModeLog.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModeLog.Builder.class) -public final class DebugModeLog { - private final String logId; - - private final String dashboardView; - - private final DebugModelLogSummary logSummary; - - private final Map additionalProperties; - - private DebugModeLog( - String logId, - String dashboardView, - DebugModelLogSummary logSummary, - Map additionalProperties) { - this.logId = logId; - this.dashboardView = dashboardView; - this.logSummary = logSummary; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("log_id") - public String getLogId() { - return logId; - } - - @JsonProperty("dashboard_view") - public String getDashboardView() { - return dashboardView; - } - - @JsonProperty("log_summary") - public DebugModelLogSummary getLogSummary() { - return logSummary; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModeLog && equalTo((DebugModeLog) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModeLog other) { - return logId.equals(other.logId) - && dashboardView.equals(other.dashboardView) - && logSummary.equals(other.logSummary); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.logId, this.dashboardView, this.logSummary); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LogIdStage builder() { - return new Builder(); - } - - public interface LogIdStage { - DashboardViewStage logId(@NotNull String logId); - - Builder from(DebugModeLog other); - } - - public interface DashboardViewStage { - LogSummaryStage dashboardView(@NotNull String dashboardView); - } - - public interface LogSummaryStage { - _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); - } - - public interface _FinalStage { - DebugModeLog build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { - private String logId; - - private String dashboardView; - - private DebugModelLogSummary logSummary; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModeLog other) { - logId(other.getLogId()); - dashboardView(other.getDashboardView()); - logSummary(other.getLogSummary()); - return this; - } - - @java.lang.Override - @JsonSetter("log_id") - public DashboardViewStage logId(@NotNull String logId) { - this.logId = logId; - return this; - } - - @java.lang.Override - @JsonSetter("dashboard_view") - public LogSummaryStage dashboardView(@NotNull String dashboardView) { - this.dashboardView = dashboardView; - return this; - } - - @java.lang.Override - @JsonSetter("log_summary") - public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { - this.logSummary = logSummary; - return this; - } - - @java.lang.Override - public DebugModeLog build() { - return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/resources/ats/types/DebugModelLogSummary.java deleted file mode 100644 index a562bf01c..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/DebugModelLogSummary.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) -public final class DebugModelLogSummary { - private final String url; - - private final String method; - - private final int statusCode; - - private final Map additionalProperties; - - private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { - this.url = url; - this.method = method; - this.statusCode = statusCode; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("url") - public String getUrl() { - return url; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("status_code") - public int getStatusCode() { - return statusCode; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModelLogSummary other) { - return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.url, this.method, this.statusCode); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static UrlStage builder() { - return new Builder(); - } - - public interface UrlStage { - MethodStage url(@NotNull String url); - - Builder from(DebugModelLogSummary other); - } - - public interface MethodStage { - StatusCodeStage method(@NotNull String method); - } - - public interface StatusCodeStage { - _FinalStage statusCode(int statusCode); - } - - public interface _FinalStage { - DebugModelLogSummary build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { - private String url; - - private String method; - - private int statusCode; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModelLogSummary other) { - url(other.getUrl()); - method(other.getMethod()); - statusCode(other.getStatusCode()); - return this; - } - - @java.lang.Override - @JsonSetter("url") - public MethodStage url(@NotNull String url) { - this.url = url; - return this; - } - - @java.lang.Override - @JsonSetter("method") - public StatusCodeStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("status_code") - public _FinalStage statusCode(int statusCode) { - this.statusCode = statusCode; - return this; - } - - @java.lang.Override - public DebugModelLogSummary build() { - return new DebugModelLogSummary(url, method, statusCode, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EeocDisabilityStatus.java b/src/main/java/com/merge/api/resources/ats/types/EeocDisabilityStatus.java deleted file mode 100644 index 8b426206b..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EeocDisabilityStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EeocDisabilityStatus.Deserializer.class) -public final class EeocDisabilityStatus { - private final Object value; - - private final int type; - - private EeocDisabilityStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((DisabilityStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EeocDisabilityStatus && equalTo((EeocDisabilityStatus) other); - } - - private boolean equalTo(EeocDisabilityStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EeocDisabilityStatus of(DisabilityStatusEnum value) { - return new EeocDisabilityStatus(value, 0); - } - - public static EeocDisabilityStatus of(String value) { - return new EeocDisabilityStatus(value, 1); - } - - public interface Visitor { - T visit(DisabilityStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EeocDisabilityStatus.class); - } - - @java.lang.Override - public EeocDisabilityStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, DisabilityStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EeocGender.java b/src/main/java/com/merge/api/resources/ats/types/EeocGender.java deleted file mode 100644 index 4dfa73057..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EeocGender.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EeocGender.Deserializer.class) -public final class EeocGender { - private final Object value; - - private final int type; - - private EeocGender(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((GenderEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EeocGender && equalTo((EeocGender) other); - } - - private boolean equalTo(EeocGender other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EeocGender of(GenderEnum value) { - return new EeocGender(value, 0); - } - - public static EeocGender of(String value) { - return new EeocGender(value, 1); - } - - public interface Visitor { - T visit(GenderEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EeocGender.class); - } - - @java.lang.Override - public EeocGender deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, GenderEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EeocRace.java b/src/main/java/com/merge/api/resources/ats/types/EeocRace.java deleted file mode 100644 index 1f345517a..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EeocRace.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EeocRace.Deserializer.class) -public final class EeocRace { - private final Object value; - - private final int type; - - private EeocRace(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RaceEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EeocRace && equalTo((EeocRace) other); - } - - private boolean equalTo(EeocRace other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EeocRace of(RaceEnum value) { - return new EeocRace(value, 0); - } - - public static EeocRace of(String value) { - return new EeocRace(value, 1); - } - - public interface Visitor { - T visit(RaceEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EeocRace.class); - } - - @java.lang.Override - public EeocRace deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RaceEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EeocVeteranStatus.java b/src/main/java/com/merge/api/resources/ats/types/EeocVeteranStatus.java deleted file mode 100644 index e21d445ab..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EeocVeteranStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EeocVeteranStatus.Deserializer.class) -public final class EeocVeteranStatus { - private final Object value; - - private final int type; - - private EeocVeteranStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((VeteranStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EeocVeteranStatus && equalTo((EeocVeteranStatus) other); - } - - private boolean equalTo(EeocVeteranStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EeocVeteranStatus of(VeteranStatusEnum value) { - return new EeocVeteranStatus(value, 0); - } - - public static EeocVeteranStatus of(String value) { - return new EeocVeteranStatus(value, 1); - } - - public interface Visitor { - T visit(VeteranStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EeocVeteranStatus.class); - } - - @java.lang.Override - public EeocVeteranStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, VeteranStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EmailAddress.java b/src/main/java/com/merge/api/resources/ats/types/EmailAddress.java deleted file mode 100644 index 3bfc073a8..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EmailAddress.java +++ /dev/null @@ -1,215 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmailAddress.Builder.class) -public final class EmailAddress { - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional value; - - private final Optional emailAddressType; - - private final Optional remoteWasDeleted; - - private final Map additionalProperties; - - private EmailAddress( - Optional createdAt, - Optional modifiedAt, - Optional value, - Optional emailAddressType, - Optional remoteWasDeleted, - Map additionalProperties) { - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.value = value; - this.emailAddressType = emailAddressType; - this.remoteWasDeleted = remoteWasDeleted; - this.additionalProperties = additionalProperties; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The email address. - */ - @JsonProperty("value") - public Optional getValue() { - return value; - } - - /** - * @return The type of email address. - *
    - *
  • PERSONAL - PERSONAL
  • - *
  • WORK - WORK
  • - *
  • OTHER - OTHER
  • - *
- */ - @JsonProperty("email_address_type") - public Optional getEmailAddressType() { - return emailAddressType; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmailAddress && equalTo((EmailAddress) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmailAddress other) { - return createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && value.equals(other.value) - && emailAddressType.equals(other.emailAddressType) - && remoteWasDeleted.equals(other.remoteWasDeleted); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.createdAt, this.modifiedAt, this.value, this.emailAddressType, this.remoteWasDeleted); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional value = Optional.empty(); - - private Optional emailAddressType = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmailAddress other) { - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - value(other.getValue()); - emailAddressType(other.getEmailAddressType()); - remoteWasDeleted(other.getRemoteWasDeleted()); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public Builder value(Optional value) { - this.value = value; - return this; - } - - public Builder value(String value) { - this.value = Optional.ofNullable(value); - return this; - } - - @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) - public Builder emailAddressType(Optional emailAddressType) { - this.emailAddressType = emailAddressType; - return this; - } - - public Builder emailAddressType(EmailAddressEmailAddressType emailAddressType) { - this.emailAddressType = Optional.ofNullable(emailAddressType); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - public EmailAddress build() { - return new EmailAddress( - createdAt, modifiedAt, value, emailAddressType, remoteWasDeleted, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EmailAddressEmailAddressType.java b/src/main/java/com/merge/api/resources/ats/types/EmailAddressEmailAddressType.java deleted file mode 100644 index bfb5aef33..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EmailAddressEmailAddressType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmailAddressEmailAddressType.Deserializer.class) -public final class EmailAddressEmailAddressType { - private final Object value; - - private final int type; - - private EmailAddressEmailAddressType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EmailAddressTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmailAddressEmailAddressType && equalTo((EmailAddressEmailAddressType) other); - } - - private boolean equalTo(EmailAddressEmailAddressType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmailAddressEmailAddressType of(EmailAddressTypeEnum value) { - return new EmailAddressEmailAddressType(value, 0); - } - - public static EmailAddressEmailAddressType of(String value) { - return new EmailAddressEmailAddressType(value, 1); - } - - public interface Visitor { - T visit(EmailAddressTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmailAddressEmailAddressType.class); - } - - @java.lang.Override - public EmailAddressEmailAddressType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmailAddressTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EmailAddressRequest.java b/src/main/java/com/merge/api/resources/ats/types/EmailAddressRequest.java deleted file mode 100644 index 546cc387f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EmailAddressRequest.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmailAddressRequest.Builder.class) -public final class EmailAddressRequest { - private final Optional value; - - private final Optional emailAddressType; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private EmailAddressRequest( - Optional value, - Optional emailAddressType, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.value = value; - this.emailAddressType = emailAddressType; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The email address. - */ - @JsonProperty("value") - public Optional getValue() { - return value; - } - - /** - * @return The type of email address. - *
    - *
  • PERSONAL - PERSONAL
  • - *
  • WORK - WORK
  • - *
  • OTHER - OTHER
  • - *
- */ - @JsonProperty("email_address_type") - public Optional getEmailAddressType() { - return emailAddressType; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmailAddressRequest && equalTo((EmailAddressRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmailAddressRequest other) { - return value.equals(other.value) - && emailAddressType.equals(other.emailAddressType) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value, this.emailAddressType, this.integrationParams, this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional value = Optional.empty(); - - private Optional emailAddressType = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmailAddressRequest other) { - value(other.getValue()); - emailAddressType(other.getEmailAddressType()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public Builder value(Optional value) { - this.value = value; - return this; - } - - public Builder value(String value) { - this.value = Optional.ofNullable(value); - return this; - } - - @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) - public Builder emailAddressType(Optional emailAddressType) { - this.emailAddressType = emailAddressType; - return this; - } - - public Builder emailAddressType(EmailAddressRequestEmailAddressType emailAddressType) { - this.emailAddressType = Optional.ofNullable(emailAddressType); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public EmailAddressRequest build() { - return new EmailAddressRequest( - value, emailAddressType, integrationParams, linkedAccountParams, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EmailAddressRequestEmailAddressType.java b/src/main/java/com/merge/api/resources/ats/types/EmailAddressRequestEmailAddressType.java deleted file mode 100644 index b7a94cfa6..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EmailAddressRequestEmailAddressType.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmailAddressRequestEmailAddressType.Deserializer.class) -public final class EmailAddressRequestEmailAddressType { - private final Object value; - - private final int type; - - private EmailAddressRequestEmailAddressType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EmailAddressTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmailAddressRequestEmailAddressType - && equalTo((EmailAddressRequestEmailAddressType) other); - } - - private boolean equalTo(EmailAddressRequestEmailAddressType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmailAddressRequestEmailAddressType of(EmailAddressTypeEnum value) { - return new EmailAddressRequestEmailAddressType(value, 0); - } - - public static EmailAddressRequestEmailAddressType of(String value) { - return new EmailAddressRequestEmailAddressType(value, 1); - } - - public interface Visitor { - T visit(EmailAddressTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmailAddressRequestEmailAddressType.class); - } - - @java.lang.Override - public EmailAddressRequestEmailAddressType deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmailAddressTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/resources/ats/types/EnabledActionsEnum.java deleted file mode 100644 index 879b82e96..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EnabledActionsEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EnabledActionsEnum { - READ("READ"), - - WRITE("WRITE"); - - private final String value; - - EnabledActionsEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EncodingEnum.java b/src/main/java/com/merge/api/resources/ats/types/EncodingEnum.java deleted file mode 100644 index e8a26475f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EncodingEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EncodingEnum { - RAW("RAW"), - - BASE_64("BASE64"), - - GZIP_BASE_64("GZIP_BASE64"); - - private final String value; - - EncodingEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/resources/ats/types/ErrorValidationProblem.java deleted file mode 100644 index a8eb977e0..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ErrorValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) -public final class ErrorValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private ErrorValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ErrorValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(ErrorValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - ErrorValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ErrorValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public ErrorValidationProblem build() { - return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/EventTypeEnum.java b/src/main/java/com/merge/api/resources/ats/types/EventTypeEnum.java deleted file mode 100644 index cbbb99e0a..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/EventTypeEnum.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EventTypeEnum { - CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), - - DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), - - CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), - - DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), - - REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), - - INVITED_USER("INVITED_USER"), - - TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), - - TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), - - DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), - - CREATED_DESTINATION("CREATED_DESTINATION"), - - DELETED_DESTINATION("DELETED_DESTINATION"), - - CHANGED_DESTINATION("CHANGED_DESTINATION"), - - CHANGED_SCOPES("CHANGED_SCOPES"), - - CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), - - CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), - - ENABLED_INTEGRATION("ENABLED_INTEGRATION"), - - DISABLED_INTEGRATION("DISABLED_INTEGRATION"), - - ENABLED_CATEGORY("ENABLED_CATEGORY"), - - DISABLED_CATEGORY("DISABLED_CATEGORY"), - - CHANGED_PASSWORD("CHANGED_PASSWORD"), - - RESET_PASSWORD("RESET_PASSWORD"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), - - MUTED_ISSUE("MUTED_ISSUE"), - - GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), - - ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), - - DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), - - MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), - - END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); - - private final String value; - - EventTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/resources/ats/types/ExternalTargetFieldApi.java deleted file mode 100644 index e382f3ccf..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ExternalTargetFieldApi.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) -public final class ExternalTargetFieldApi { - private final Optional name; - - private final Optional description; - - private final Optional isMapped; - - private final Map additionalProperties; - - private ExternalTargetFieldApi( - Optional name, - Optional description, - Optional isMapped, - Map additionalProperties) { - this.name = name; - this.description = description; - this.isMapped = isMapped; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_mapped") - public Optional getIsMapped() { - return isMapped; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApi other) { - return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isMapped); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isMapped = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApi other) { - name(other.getName()); - description(other.getDescription()); - isMapped(other.getIsMapped()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) - public Builder isMapped(Optional isMapped) { - this.isMapped = isMapped; - return this; - } - - public Builder isMapped(String isMapped) { - this.isMapped = Optional.ofNullable(isMapped); - return this; - } - - public ExternalTargetFieldApi build() { - return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/resources/ats/types/ExternalTargetFieldApiResponse.java deleted file mode 100644 index 83fde0d1a..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ExternalTargetFieldApiResponse.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) -public final class ExternalTargetFieldApiResponse { - private final Optional> activity; - - private final Optional> application; - - private final Optional> attachment; - - private final Optional> candidate; - - private final Optional> department; - - private final Optional> eeoc; - - private final Optional> scheduledInterview; - - private final Optional> job; - - private final Optional> jobPosting; - - private final Optional> jobInterviewStage; - - private final Optional> offer; - - private final Optional> office; - - private final Optional> rejectReason; - - private final Optional> scorecard; - - private final Optional> tag; - - private final Optional> remoteUser; - - private final Map additionalProperties; - - private ExternalTargetFieldApiResponse( - Optional> activity, - Optional> application, - Optional> attachment, - Optional> candidate, - Optional> department, - Optional> eeoc, - Optional> scheduledInterview, - Optional> job, - Optional> jobPosting, - Optional> jobInterviewStage, - Optional> offer, - Optional> office, - Optional> rejectReason, - Optional> scorecard, - Optional> tag, - Optional> remoteUser, - Map additionalProperties) { - this.activity = activity; - this.application = application; - this.attachment = attachment; - this.candidate = candidate; - this.department = department; - this.eeoc = eeoc; - this.scheduledInterview = scheduledInterview; - this.job = job; - this.jobPosting = jobPosting; - this.jobInterviewStage = jobInterviewStage; - this.offer = offer; - this.office = office; - this.rejectReason = rejectReason; - this.scorecard = scorecard; - this.tag = tag; - this.remoteUser = remoteUser; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Activity") - public Optional> getActivity() { - return activity; - } - - @JsonProperty("Application") - public Optional> getApplication() { - return application; - } - - @JsonProperty("Attachment") - public Optional> getAttachment() { - return attachment; - } - - @JsonProperty("Candidate") - public Optional> getCandidate() { - return candidate; - } - - @JsonProperty("Department") - public Optional> getDepartment() { - return department; - } - - @JsonProperty("EEOC") - public Optional> getEeoc() { - return eeoc; - } - - @JsonProperty("ScheduledInterview") - public Optional> getScheduledInterview() { - return scheduledInterview; - } - - @JsonProperty("Job") - public Optional> getJob() { - return job; - } - - @JsonProperty("JobPosting") - public Optional> getJobPosting() { - return jobPosting; - } - - @JsonProperty("JobInterviewStage") - public Optional> getJobInterviewStage() { - return jobInterviewStage; - } - - @JsonProperty("Offer") - public Optional> getOffer() { - return offer; - } - - @JsonProperty("Office") - public Optional> getOffice() { - return office; - } - - @JsonProperty("RejectReason") - public Optional> getRejectReason() { - return rejectReason; - } - - @JsonProperty("Scorecard") - public Optional> getScorecard() { - return scorecard; - } - - @JsonProperty("Tag") - public Optional> getTag() { - return tag; - } - - @JsonProperty("RemoteUser") - public Optional> getRemoteUser() { - return remoteUser; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApiResponse other) { - return activity.equals(other.activity) - && application.equals(other.application) - && attachment.equals(other.attachment) - && candidate.equals(other.candidate) - && department.equals(other.department) - && eeoc.equals(other.eeoc) - && scheduledInterview.equals(other.scheduledInterview) - && job.equals(other.job) - && jobPosting.equals(other.jobPosting) - && jobInterviewStage.equals(other.jobInterviewStage) - && offer.equals(other.offer) - && office.equals(other.office) - && rejectReason.equals(other.rejectReason) - && scorecard.equals(other.scorecard) - && tag.equals(other.tag) - && remoteUser.equals(other.remoteUser); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.activity, - this.application, - this.attachment, - this.candidate, - this.department, - this.eeoc, - this.scheduledInterview, - this.job, - this.jobPosting, - this.jobInterviewStage, - this.offer, - this.office, - this.rejectReason, - this.scorecard, - this.tag, - this.remoteUser); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> activity = Optional.empty(); - - private Optional> application = Optional.empty(); - - private Optional> attachment = Optional.empty(); - - private Optional> candidate = Optional.empty(); - - private Optional> department = Optional.empty(); - - private Optional> eeoc = Optional.empty(); - - private Optional> scheduledInterview = Optional.empty(); - - private Optional> job = Optional.empty(); - - private Optional> jobPosting = Optional.empty(); - - private Optional> jobInterviewStage = Optional.empty(); - - private Optional> offer = Optional.empty(); - - private Optional> office = Optional.empty(); - - private Optional> rejectReason = Optional.empty(); - - private Optional> scorecard = Optional.empty(); - - private Optional> tag = Optional.empty(); - - private Optional> remoteUser = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApiResponse other) { - activity(other.getActivity()); - application(other.getApplication()); - attachment(other.getAttachment()); - candidate(other.getCandidate()); - department(other.getDepartment()); - eeoc(other.getEeoc()); - scheduledInterview(other.getScheduledInterview()); - job(other.getJob()); - jobPosting(other.getJobPosting()); - jobInterviewStage(other.getJobInterviewStage()); - offer(other.getOffer()); - office(other.getOffice()); - rejectReason(other.getRejectReason()); - scorecard(other.getScorecard()); - tag(other.getTag()); - remoteUser(other.getRemoteUser()); - return this; - } - - @JsonSetter(value = "Activity", nulls = Nulls.SKIP) - public Builder activity(Optional> activity) { - this.activity = activity; - return this; - } - - public Builder activity(List activity) { - this.activity = Optional.ofNullable(activity); - return this; - } - - @JsonSetter(value = "Application", nulls = Nulls.SKIP) - public Builder application(Optional> application) { - this.application = application; - return this; - } - - public Builder application(List application) { - this.application = Optional.ofNullable(application); - return this; - } - - @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) - public Builder attachment(Optional> attachment) { - this.attachment = attachment; - return this; - } - - public Builder attachment(List attachment) { - this.attachment = Optional.ofNullable(attachment); - return this; - } - - @JsonSetter(value = "Candidate", nulls = Nulls.SKIP) - public Builder candidate(Optional> candidate) { - this.candidate = candidate; - return this; - } - - public Builder candidate(List candidate) { - this.candidate = Optional.ofNullable(candidate); - return this; - } - - @JsonSetter(value = "Department", nulls = Nulls.SKIP) - public Builder department(Optional> department) { - this.department = department; - return this; - } - - public Builder department(List department) { - this.department = Optional.ofNullable(department); - return this; - } - - @JsonSetter(value = "EEOC", nulls = Nulls.SKIP) - public Builder eeoc(Optional> eeoc) { - this.eeoc = eeoc; - return this; - } - - public Builder eeoc(List eeoc) { - this.eeoc = Optional.ofNullable(eeoc); - return this; - } - - @JsonSetter(value = "ScheduledInterview", nulls = Nulls.SKIP) - public Builder scheduledInterview(Optional> scheduledInterview) { - this.scheduledInterview = scheduledInterview; - return this; - } - - public Builder scheduledInterview(List scheduledInterview) { - this.scheduledInterview = Optional.ofNullable(scheduledInterview); - return this; - } - - @JsonSetter(value = "Job", nulls = Nulls.SKIP) - public Builder job(Optional> job) { - this.job = job; - return this; - } - - public Builder job(List job) { - this.job = Optional.ofNullable(job); - return this; - } - - @JsonSetter(value = "JobPosting", nulls = Nulls.SKIP) - public Builder jobPosting(Optional> jobPosting) { - this.jobPosting = jobPosting; - return this; - } - - public Builder jobPosting(List jobPosting) { - this.jobPosting = Optional.ofNullable(jobPosting); - return this; - } - - @JsonSetter(value = "JobInterviewStage", nulls = Nulls.SKIP) - public Builder jobInterviewStage(Optional> jobInterviewStage) { - this.jobInterviewStage = jobInterviewStage; - return this; - } - - public Builder jobInterviewStage(List jobInterviewStage) { - this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); - return this; - } - - @JsonSetter(value = "Offer", nulls = Nulls.SKIP) - public Builder offer(Optional> offer) { - this.offer = offer; - return this; - } - - public Builder offer(List offer) { - this.offer = Optional.ofNullable(offer); - return this; - } - - @JsonSetter(value = "Office", nulls = Nulls.SKIP) - public Builder office(Optional> office) { - this.office = office; - return this; - } - - public Builder office(List office) { - this.office = Optional.ofNullable(office); - return this; - } - - @JsonSetter(value = "RejectReason", nulls = Nulls.SKIP) - public Builder rejectReason(Optional> rejectReason) { - this.rejectReason = rejectReason; - return this; - } - - public Builder rejectReason(List rejectReason) { - this.rejectReason = Optional.ofNullable(rejectReason); - return this; - } - - @JsonSetter(value = "Scorecard", nulls = Nulls.SKIP) - public Builder scorecard(Optional> scorecard) { - this.scorecard = scorecard; - return this; - } - - public Builder scorecard(List scorecard) { - this.scorecard = Optional.ofNullable(scorecard); - return this; - } - - @JsonSetter(value = "Tag", nulls = Nulls.SKIP) - public Builder tag(Optional> tag) { - this.tag = tag; - return this; - } - - public Builder tag(List tag) { - this.tag = Optional.ofNullable(tag); - return this; - } - - @JsonSetter(value = "RemoteUser", nulls = Nulls.SKIP) - public Builder remoteUser(Optional> remoteUser) { - this.remoteUser = remoteUser; - return this; - } - - public Builder remoteUser(List remoteUser) { - this.remoteUser = Optional.ofNullable(remoteUser); - return this; - } - - public ExternalTargetFieldApiResponse build() { - return new ExternalTargetFieldApiResponse( - activity, - application, - attachment, - candidate, - department, - eeoc, - scheduledInterview, - job, - jobPosting, - jobInterviewStage, - offer, - office, - rejectReason, - scorecard, - tag, - remoteUser, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstance.java deleted file mode 100644 index 7b33ce11f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstance.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) -public final class FieldMappingApiInstance { - private final Optional id; - - private final Optional isIntegrationWide; - - private final Optional targetField; - - private final Optional remoteField; - - private final Map additionalProperties; - - private FieldMappingApiInstance( - Optional id, - Optional isIntegrationWide, - Optional targetField, - Optional remoteField, - Map additionalProperties) { - this.id = id; - this.isIntegrationWide = isIntegrationWide; - this.targetField = targetField; - this.remoteField = remoteField; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("is_integration_wide") - public Optional getIsIntegrationWide() { - return isIntegrationWide; - } - - @JsonProperty("target_field") - public Optional getTargetField() { - return targetField; - } - - @JsonProperty("remote_field") - public Optional getRemoteField() { - return remoteField; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstance other) { - return id.equals(other.id) - && isIntegrationWide.equals(other.isIntegrationWide) - && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional isIntegrationWide = Optional.empty(); - - private Optional targetField = Optional.empty(); - - private Optional remoteField = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstance other) { - id(other.getId()); - isIntegrationWide(other.getIsIntegrationWide()); - targetField(other.getTargetField()); - remoteField(other.getRemoteField()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) - public Builder isIntegrationWide(Optional isIntegrationWide) { - this.isIntegrationWide = isIntegrationWide; - return this; - } - - public Builder isIntegrationWide(Boolean isIntegrationWide) { - this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); - return this; - } - - @JsonSetter(value = "target_field", nulls = Nulls.SKIP) - public Builder targetField(Optional targetField) { - this.targetField = targetField; - return this; - } - - public Builder targetField(FieldMappingApiInstanceTargetField targetField) { - this.targetField = Optional.ofNullable(targetField); - return this; - } - - @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) - public Builder remoteField(Optional remoteField) { - this.remoteField = remoteField; - return this; - } - - public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { - this.remoteField = Optional.ofNullable(remoteField); - return this; - } - - public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceRemoteField.java deleted file mode 100644 index eeac3b3d8..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceRemoteField.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) -public final class FieldMappingApiInstanceRemoteField { - private final Optional remoteKeyName; - - private final Optional> schema; - - private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteField( - Optional remoteKeyName, - Optional> schema, - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, - Map additionalProperties) { - this.remoteKeyName = remoteKeyName; - this.schema = schema; - this.remoteEndpointInfo = remoteEndpointInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("schema") - public Optional> getSchema() { - return schema; - } - - @JsonProperty("remote_endpoint_info") - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteField - && equalTo((FieldMappingApiInstanceRemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteField other) { - return remoteKeyName.equals(other.remoteKeyName) - && schema.equals(other.schema) - && remoteEndpointInfo.equals(other.remoteEndpointInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteEndpointInfoStage builder() { - return new Builder(); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); - - Builder from(FieldMappingApiInstanceRemoteField other); - } - - public interface _FinalStage { - FieldMappingApiInstanceRemoteField build(); - - _FinalStage remoteKeyName(Optional remoteKeyName); - - _FinalStage remoteKeyName(String remoteKeyName); - - _FinalStage schema(Optional> schema); - - _FinalStage schema(Map schema); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private Optional> schema = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceRemoteField other) { - remoteKeyName(other.getRemoteKeyName()); - schema(other.getSchema()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage schema(Map schema) { - this.schema = Optional.ofNullable(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Optional> schema) { - this.schema = schema; - return this; - } - - @java.lang.Override - public _FinalStage remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public _FinalStage remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceRemoteField build() { - return new FieldMappingApiInstanceRemoteField( - remoteKeyName, schema, remoteEndpointInfo, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java deleted file mode 100644 index 0f356ac84..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) -public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { - private final Optional method; - - private final Optional urlPath; - - private final Optional> fieldTraversalPath; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - Optional method, - Optional urlPath, - Optional> fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public Optional getMethod() { - return method; - } - - @JsonProperty("url_path") - public Optional getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public Optional> getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional method = Optional.empty(); - - private Optional urlPath = Optional.empty(); - - private Optional> fieldTraversalPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @JsonSetter(value = "method", nulls = Nulls.SKIP) - public Builder method(Optional method) { - this.method = method; - return this; - } - - public Builder method(String method) { - this.method = Optional.ofNullable(method); - return this; - } - - @JsonSetter(value = "url_path", nulls = Nulls.SKIP) - public Builder urlPath(Optional urlPath) { - this.urlPath = urlPath; - return this; - } - - public Builder urlPath(String urlPath) { - this.urlPath = Optional.ofNullable(urlPath); - return this; - } - - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public Builder fieldTraversalPath(Optional> fieldTraversalPath) { - this.fieldTraversalPath = fieldTraversalPath; - return this; - } - - public Builder fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); - return this; - } - - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { - return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceResponse.java deleted file mode 100644 index 9a3d8e591..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceResponse.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) -public final class FieldMappingApiInstanceResponse { - private final Optional> activity; - - private final Optional> application; - - private final Optional> attachment; - - private final Optional> candidate; - - private final Optional> department; - - private final Optional> eeoc; - - private final Optional> scheduledInterview; - - private final Optional> job; - - private final Optional> jobPosting; - - private final Optional> jobInterviewStage; - - private final Optional> offer; - - private final Optional> office; - - private final Optional> rejectReason; - - private final Optional> scorecard; - - private final Optional> tag; - - private final Optional> remoteUser; - - private final Map additionalProperties; - - private FieldMappingApiInstanceResponse( - Optional> activity, - Optional> application, - Optional> attachment, - Optional> candidate, - Optional> department, - Optional> eeoc, - Optional> scheduledInterview, - Optional> job, - Optional> jobPosting, - Optional> jobInterviewStage, - Optional> offer, - Optional> office, - Optional> rejectReason, - Optional> scorecard, - Optional> tag, - Optional> remoteUser, - Map additionalProperties) { - this.activity = activity; - this.application = application; - this.attachment = attachment; - this.candidate = candidate; - this.department = department; - this.eeoc = eeoc; - this.scheduledInterview = scheduledInterview; - this.job = job; - this.jobPosting = jobPosting; - this.jobInterviewStage = jobInterviewStage; - this.offer = offer; - this.office = office; - this.rejectReason = rejectReason; - this.scorecard = scorecard; - this.tag = tag; - this.remoteUser = remoteUser; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Activity") - public Optional> getActivity() { - return activity; - } - - @JsonProperty("Application") - public Optional> getApplication() { - return application; - } - - @JsonProperty("Attachment") - public Optional> getAttachment() { - return attachment; - } - - @JsonProperty("Candidate") - public Optional> getCandidate() { - return candidate; - } - - @JsonProperty("Department") - public Optional> getDepartment() { - return department; - } - - @JsonProperty("EEOC") - public Optional> getEeoc() { - return eeoc; - } - - @JsonProperty("ScheduledInterview") - public Optional> getScheduledInterview() { - return scheduledInterview; - } - - @JsonProperty("Job") - public Optional> getJob() { - return job; - } - - @JsonProperty("JobPosting") - public Optional> getJobPosting() { - return jobPosting; - } - - @JsonProperty("JobInterviewStage") - public Optional> getJobInterviewStage() { - return jobInterviewStage; - } - - @JsonProperty("Offer") - public Optional> getOffer() { - return offer; - } - - @JsonProperty("Office") - public Optional> getOffice() { - return office; - } - - @JsonProperty("RejectReason") - public Optional> getRejectReason() { - return rejectReason; - } - - @JsonProperty("Scorecard") - public Optional> getScorecard() { - return scorecard; - } - - @JsonProperty("Tag") - public Optional> getTag() { - return tag; - } - - @JsonProperty("RemoteUser") - public Optional> getRemoteUser() { - return remoteUser; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceResponse other) { - return activity.equals(other.activity) - && application.equals(other.application) - && attachment.equals(other.attachment) - && candidate.equals(other.candidate) - && department.equals(other.department) - && eeoc.equals(other.eeoc) - && scheduledInterview.equals(other.scheduledInterview) - && job.equals(other.job) - && jobPosting.equals(other.jobPosting) - && jobInterviewStage.equals(other.jobInterviewStage) - && offer.equals(other.offer) - && office.equals(other.office) - && rejectReason.equals(other.rejectReason) - && scorecard.equals(other.scorecard) - && tag.equals(other.tag) - && remoteUser.equals(other.remoteUser); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.activity, - this.application, - this.attachment, - this.candidate, - this.department, - this.eeoc, - this.scheduledInterview, - this.job, - this.jobPosting, - this.jobInterviewStage, - this.offer, - this.office, - this.rejectReason, - this.scorecard, - this.tag, - this.remoteUser); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> activity = Optional.empty(); - - private Optional> application = Optional.empty(); - - private Optional> attachment = Optional.empty(); - - private Optional> candidate = Optional.empty(); - - private Optional> department = Optional.empty(); - - private Optional> eeoc = Optional.empty(); - - private Optional> scheduledInterview = Optional.empty(); - - private Optional> job = Optional.empty(); - - private Optional> jobPosting = Optional.empty(); - - private Optional> jobInterviewStage = Optional.empty(); - - private Optional> offer = Optional.empty(); - - private Optional> office = Optional.empty(); - - private Optional> rejectReason = Optional.empty(); - - private Optional> scorecard = Optional.empty(); - - private Optional> tag = Optional.empty(); - - private Optional> remoteUser = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceResponse other) { - activity(other.getActivity()); - application(other.getApplication()); - attachment(other.getAttachment()); - candidate(other.getCandidate()); - department(other.getDepartment()); - eeoc(other.getEeoc()); - scheduledInterview(other.getScheduledInterview()); - job(other.getJob()); - jobPosting(other.getJobPosting()); - jobInterviewStage(other.getJobInterviewStage()); - offer(other.getOffer()); - office(other.getOffice()); - rejectReason(other.getRejectReason()); - scorecard(other.getScorecard()); - tag(other.getTag()); - remoteUser(other.getRemoteUser()); - return this; - } - - @JsonSetter(value = "Activity", nulls = Nulls.SKIP) - public Builder activity(Optional> activity) { - this.activity = activity; - return this; - } - - public Builder activity(List activity) { - this.activity = Optional.ofNullable(activity); - return this; - } - - @JsonSetter(value = "Application", nulls = Nulls.SKIP) - public Builder application(Optional> application) { - this.application = application; - return this; - } - - public Builder application(List application) { - this.application = Optional.ofNullable(application); - return this; - } - - @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) - public Builder attachment(Optional> attachment) { - this.attachment = attachment; - return this; - } - - public Builder attachment(List attachment) { - this.attachment = Optional.ofNullable(attachment); - return this; - } - - @JsonSetter(value = "Candidate", nulls = Nulls.SKIP) - public Builder candidate(Optional> candidate) { - this.candidate = candidate; - return this; - } - - public Builder candidate(List candidate) { - this.candidate = Optional.ofNullable(candidate); - return this; - } - - @JsonSetter(value = "Department", nulls = Nulls.SKIP) - public Builder department(Optional> department) { - this.department = department; - return this; - } - - public Builder department(List department) { - this.department = Optional.ofNullable(department); - return this; - } - - @JsonSetter(value = "EEOC", nulls = Nulls.SKIP) - public Builder eeoc(Optional> eeoc) { - this.eeoc = eeoc; - return this; - } - - public Builder eeoc(List eeoc) { - this.eeoc = Optional.ofNullable(eeoc); - return this; - } - - @JsonSetter(value = "ScheduledInterview", nulls = Nulls.SKIP) - public Builder scheduledInterview(Optional> scheduledInterview) { - this.scheduledInterview = scheduledInterview; - return this; - } - - public Builder scheduledInterview(List scheduledInterview) { - this.scheduledInterview = Optional.ofNullable(scheduledInterview); - return this; - } - - @JsonSetter(value = "Job", nulls = Nulls.SKIP) - public Builder job(Optional> job) { - this.job = job; - return this; - } - - public Builder job(List job) { - this.job = Optional.ofNullable(job); - return this; - } - - @JsonSetter(value = "JobPosting", nulls = Nulls.SKIP) - public Builder jobPosting(Optional> jobPosting) { - this.jobPosting = jobPosting; - return this; - } - - public Builder jobPosting(List jobPosting) { - this.jobPosting = Optional.ofNullable(jobPosting); - return this; - } - - @JsonSetter(value = "JobInterviewStage", nulls = Nulls.SKIP) - public Builder jobInterviewStage(Optional> jobInterviewStage) { - this.jobInterviewStage = jobInterviewStage; - return this; - } - - public Builder jobInterviewStage(List jobInterviewStage) { - this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); - return this; - } - - @JsonSetter(value = "Offer", nulls = Nulls.SKIP) - public Builder offer(Optional> offer) { - this.offer = offer; - return this; - } - - public Builder offer(List offer) { - this.offer = Optional.ofNullable(offer); - return this; - } - - @JsonSetter(value = "Office", nulls = Nulls.SKIP) - public Builder office(Optional> office) { - this.office = office; - return this; - } - - public Builder office(List office) { - this.office = Optional.ofNullable(office); - return this; - } - - @JsonSetter(value = "RejectReason", nulls = Nulls.SKIP) - public Builder rejectReason(Optional> rejectReason) { - this.rejectReason = rejectReason; - return this; - } - - public Builder rejectReason(List rejectReason) { - this.rejectReason = Optional.ofNullable(rejectReason); - return this; - } - - @JsonSetter(value = "Scorecard", nulls = Nulls.SKIP) - public Builder scorecard(Optional> scorecard) { - this.scorecard = scorecard; - return this; - } - - public Builder scorecard(List scorecard) { - this.scorecard = Optional.ofNullable(scorecard); - return this; - } - - @JsonSetter(value = "Tag", nulls = Nulls.SKIP) - public Builder tag(Optional> tag) { - this.tag = tag; - return this; - } - - public Builder tag(List tag) { - this.tag = Optional.ofNullable(tag); - return this; - } - - @JsonSetter(value = "RemoteUser", nulls = Nulls.SKIP) - public Builder remoteUser(Optional> remoteUser) { - this.remoteUser = remoteUser; - return this; - } - - public Builder remoteUser(List remoteUser) { - this.remoteUser = Optional.ofNullable(remoteUser); - return this; - } - - public FieldMappingApiInstanceResponse build() { - return new FieldMappingApiInstanceResponse( - activity, - application, - attachment, - candidate, - department, - eeoc, - scheduledInterview, - job, - jobPosting, - jobInterviewStage, - offer, - office, - rejectReason, - scorecard, - tag, - remoteUser, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceTargetField.java deleted file mode 100644 index 117253ca4..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldMappingApiInstanceTargetField.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) -public final class FieldMappingApiInstanceTargetField { - private final String name; - - private final String description; - - private final boolean isOrganizationWide; - - private final Map additionalProperties; - - private FieldMappingApiInstanceTargetField( - String name, String description, boolean isOrganizationWide, Map additionalProperties) { - this.name = name; - this.description = description; - this.isOrganizationWide = isOrganizationWide; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("is_organization_wide") - public boolean getIsOrganizationWide() { - return isOrganizationWide; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceTargetField - && equalTo((FieldMappingApiInstanceTargetField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceTargetField other) { - return name.equals(other.name) - && description.equals(other.description) - && isOrganizationWide == other.isOrganizationWide; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isOrganizationWide); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DescriptionStage name(@NotNull String name); - - Builder from(FieldMappingApiInstanceTargetField other); - } - - public interface DescriptionStage { - IsOrganizationWideStage description(@NotNull String description); - } - - public interface IsOrganizationWideStage { - _FinalStage isOrganizationWide(boolean isOrganizationWide); - } - - public interface _FinalStage { - FieldMappingApiInstanceTargetField build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { - private String name; - - private String description; - - private boolean isOrganizationWide; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceTargetField other) { - name(other.getName()); - description(other.getDescription()); - isOrganizationWide(other.getIsOrganizationWide()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public DescriptionStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("description") - public IsOrganizationWideStage description(@NotNull String description) { - this.description = description; - return this; - } - - @java.lang.Override - @JsonSetter("is_organization_wide") - public _FinalStage isOrganizationWide(boolean isOrganizationWide) { - this.isOrganizationWide = isOrganizationWide; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceTargetField build() { - return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/resources/ats/types/FieldMappingInstanceResponse.java deleted file mode 100644 index 6355358b4..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldMappingInstanceResponse.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) -public final class FieldMappingInstanceResponse { - private final FieldMappingApiInstance model; - - private final List warnings; - - private final List errors; - - private final Optional> logs; - - private final Map additionalProperties; - - private FieldMappingInstanceResponse( - FieldMappingApiInstance model, - List warnings, - List errors, - Optional> logs, - Map additionalProperties) { - this.model = model; - this.warnings = warnings; - this.errors = errors; - this.logs = logs; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model") - public FieldMappingApiInstance getModel() { - return model; - } - - @JsonProperty("warnings") - public List getWarnings() { - return warnings; - } - - @JsonProperty("errors") - public List getErrors() { - return errors; - } - - @JsonProperty("logs") - public Optional> getLogs() { - return logs; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingInstanceResponse other) { - return model.equals(other.model) - && warnings.equals(other.warnings) - && errors.equals(other.errors) - && logs.equals(other.logs); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.warnings, this.errors, this.logs); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelStage builder() { - return new Builder(); - } - - public interface ModelStage { - _FinalStage model(@NotNull FieldMappingApiInstance model); - - Builder from(FieldMappingInstanceResponse other); - } - - public interface _FinalStage { - FieldMappingInstanceResponse build(); - - _FinalStage warnings(List warnings); - - _FinalStage addWarnings(WarningValidationProblem warnings); - - _FinalStage addAllWarnings(List warnings); - - _FinalStage errors(List errors); - - _FinalStage addErrors(ErrorValidationProblem errors); - - _FinalStage addAllErrors(List errors); - - _FinalStage logs(Optional> logs); - - _FinalStage logs(List logs); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelStage, _FinalStage { - private FieldMappingApiInstance model; - - private Optional> logs = Optional.empty(); - - private List errors = new ArrayList<>(); - - private List warnings = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingInstanceResponse other) { - model(other.getModel()); - warnings(other.getWarnings()); - errors(other.getErrors()); - logs(other.getLogs()); - return this; - } - - @java.lang.Override - @JsonSetter("model") - public _FinalStage model(@NotNull FieldMappingApiInstance model) { - this.model = model; - return this; - } - - @java.lang.Override - public _FinalStage logs(List logs) { - this.logs = Optional.ofNullable(logs); - return this; - } - - @java.lang.Override - @JsonSetter(value = "logs", nulls = Nulls.SKIP) - public _FinalStage logs(Optional> logs) { - this.logs = logs; - return this; - } - - @java.lang.Override - public _FinalStage addAllErrors(List errors) { - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addErrors(ErrorValidationProblem errors) { - this.errors.add(errors); - return this; - } - - @java.lang.Override - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public _FinalStage errors(List errors) { - this.errors.clear(); - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addAllWarnings(List warnings) { - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public _FinalStage addWarnings(WarningValidationProblem warnings) { - this.warnings.add(warnings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public _FinalStage warnings(List warnings) { - this.warnings.clear(); - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public FieldMappingInstanceResponse build() { - return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/resources/ats/types/FieldPermissionDeserializer.java deleted file mode 100644 index 44ff29437..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldPermissionDeserializer.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) -public final class FieldPermissionDeserializer { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializer( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializer other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializer other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializer build() { - return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/ats/types/FieldPermissionDeserializerRequest.java deleted file mode 100644 index a0bb14a8f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/FieldPermissionDeserializerRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) -public final class FieldPermissionDeserializerRequest { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializerRequest( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializerRequest - && equalTo((FieldPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializerRequest other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializerRequest other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializerRequest build() { - return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/GenderEnum.java b/src/main/java/com/merge/api/resources/ats/types/GenderEnum.java deleted file mode 100644 index f3f75159f..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/GenderEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum GenderEnum { - MALE("MALE"), - - FEMALE("FEMALE"), - - NON_BINARY("NON-BINARY"), - - OTHER("OTHER"), - - DECLINE_TO_SELF_IDENTIFY("DECLINE_TO_SELF_IDENTIFY"); - - private final String value; - - GenderEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/resources/ats/types/IndividualCommonModelScopeDeserializer.java deleted file mode 100644 index 979346f72..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/IndividualCommonModelScopeDeserializer.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) -public final class IndividualCommonModelScopeDeserializer { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializer( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializer - && equalTo((IndividualCommonModelScopeDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializer other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializer other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializer build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializer other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions(Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializer build() { - return new IndividualCommonModelScopeDeserializer( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/ats/types/IndividualCommonModelScopeDeserializerRequest.java deleted file mode 100644 index c218099bc..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/IndividualCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) -public final class IndividualCommonModelScopeDeserializerRequest { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializerRequest( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializerRequest - && equalTo((IndividualCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializerRequest other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializerRequest build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializerRequest other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions( - Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializerRequest build() { - return new IndividualCommonModelScopeDeserializerRequest( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/Issue.java b/src/main/java/com/merge/api/resources/ats/types/Issue.java deleted file mode 100644 index ad13c7086..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/Issue.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Issue.Builder.class) -public final class Issue { - private final Optional id; - - private final Optional status; - - private final String errorDescription; - - private final Optional> endUser; - - private final Optional firstIncidentTime; - - private final Optional lastIncidentTime; - - private final Optional isMuted; - - private final Optional> errorDetails; - - private final Map additionalProperties; - - private Issue( - Optional id, - Optional status, - String errorDescription, - Optional> endUser, - Optional firstIncidentTime, - Optional lastIncidentTime, - Optional isMuted, - Optional> errorDetails, - Map additionalProperties) { - this.id = id; - this.status = status; - this.errorDescription = errorDescription; - this.endUser = endUser; - this.firstIncidentTime = firstIncidentTime; - this.lastIncidentTime = lastIncidentTime; - this.isMuted = isMuted; - this.errorDetails = errorDetails; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("error_description") - public String getErrorDescription() { - return errorDescription; - } - - @JsonProperty("end_user") - public Optional> getEndUser() { - return endUser; - } - - @JsonProperty("first_incident_time") - public Optional getFirstIncidentTime() { - return firstIncidentTime; - } - - @JsonProperty("last_incident_time") - public Optional getLastIncidentTime() { - return lastIncidentTime; - } - - @JsonProperty("is_muted") - public Optional getIsMuted() { - return isMuted; - } - - @JsonProperty("error_details") - public Optional> getErrorDetails() { - return errorDetails; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Issue && equalTo((Issue) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Issue other) { - return id.equals(other.id) - && status.equals(other.status) - && errorDescription.equals(other.errorDescription) - && endUser.equals(other.endUser) - && firstIncidentTime.equals(other.firstIncidentTime) - && lastIncidentTime.equals(other.lastIncidentTime) - && isMuted.equals(other.isMuted) - && errorDetails.equals(other.errorDetails); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.status, - this.errorDescription, - this.endUser, - this.firstIncidentTime, - this.lastIncidentTime, - this.isMuted, - this.errorDetails); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ErrorDescriptionStage builder() { - return new Builder(); - } - - public interface ErrorDescriptionStage { - _FinalStage errorDescription(@NotNull String errorDescription); - - Builder from(Issue other); - } - - public interface _FinalStage { - Issue build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage status(Optional status); - - _FinalStage status(IssueStatus status); - - _FinalStage endUser(Optional> endUser); - - _FinalStage endUser(Map endUser); - - _FinalStage firstIncidentTime(Optional firstIncidentTime); - - _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); - - _FinalStage lastIncidentTime(Optional lastIncidentTime); - - _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); - - _FinalStage isMuted(Optional isMuted); - - _FinalStage isMuted(Boolean isMuted); - - _FinalStage errorDetails(Optional> errorDetails); - - _FinalStage errorDetails(List errorDetails); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ErrorDescriptionStage, _FinalStage { - private String errorDescription; - - private Optional> errorDetails = Optional.empty(); - - private Optional isMuted = Optional.empty(); - - private Optional lastIncidentTime = Optional.empty(); - - private Optional firstIncidentTime = Optional.empty(); - - private Optional> endUser = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Issue other) { - id(other.getId()); - status(other.getStatus()); - errorDescription(other.getErrorDescription()); - endUser(other.getEndUser()); - firstIncidentTime(other.getFirstIncidentTime()); - lastIncidentTime(other.getLastIncidentTime()); - isMuted(other.getIsMuted()); - errorDetails(other.getErrorDetails()); - return this; - } - - @java.lang.Override - @JsonSetter("error_description") - public _FinalStage errorDescription(@NotNull String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - @java.lang.Override - public _FinalStage errorDetails(List errorDetails) { - this.errorDetails = Optional.ofNullable(errorDetails); - return this; - } - - @java.lang.Override - @JsonSetter(value = "error_details", nulls = Nulls.SKIP) - public _FinalStage errorDetails(Optional> errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - @java.lang.Override - public _FinalStage isMuted(Boolean isMuted) { - this.isMuted = Optional.ofNullable(isMuted); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) - public _FinalStage isMuted(Optional isMuted) { - this.isMuted = isMuted; - return this; - } - - @java.lang.Override - public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { - this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) - public _FinalStage lastIncidentTime(Optional lastIncidentTime) { - this.lastIncidentTime = lastIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { - this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) - public _FinalStage firstIncidentTime(Optional firstIncidentTime) { - this.firstIncidentTime = firstIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage endUser(Map endUser) { - this.endUser = Optional.ofNullable(endUser); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user", nulls = Nulls.SKIP) - public _FinalStage endUser(Optional> endUser) { - this.endUser = endUser; - return this; - } - - /** - *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

- *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage status(IssueStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public Issue build() { - return new Issue( - id, - status, - errorDescription, - endUser, - firstIncidentTime, - lastIncidentTime, - isMuted, - errorDetails, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/IssueStatus.java b/src/main/java/com/merge/api/resources/ats/types/IssueStatus.java deleted file mode 100644 index 1b6845c14..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/IssueStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IssueStatus.Deserializer.class) -public final class IssueStatus { - private final Object value; - - private final int type; - - private IssueStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((IssueStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssueStatus && equalTo((IssueStatus) other); - } - - private boolean equalTo(IssueStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IssueStatus of(IssueStatusEnum value) { - return new IssueStatus(value, 0); - } - - public static IssueStatus of(String value) { - return new IssueStatus(value, 1); - } - - public interface Visitor { - T visit(IssueStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IssueStatus.class); - } - - @java.lang.Override - public IssueStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/IssueStatusEnum.java b/src/main/java/com/merge/api/resources/ats/types/IssueStatusEnum.java deleted file mode 100644 index 8a00ee243..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/IssueStatusEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssueStatusEnum { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssueStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/JobStatus.java b/src/main/java/com/merge/api/resources/ats/types/JobStatus.java deleted file mode 100644 index 18cb646c1..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/JobStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = JobStatus.Deserializer.class) -public final class JobStatus { - private final Object value; - - private final int type; - - private JobStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((JobStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof JobStatus && equalTo((JobStatus) other); - } - - private boolean equalTo(JobStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static JobStatus of(JobStatusEnum value) { - return new JobStatus(value, 0); - } - - public static JobStatus of(String value) { - return new JobStatus(value, 1); - } - - public interface Visitor { - T visit(JobStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(JobStatus.class); - } - - @java.lang.Override - public JobStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, JobStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/LanguageEnum.java b/src/main/java/com/merge/api/resources/ats/types/LanguageEnum.java deleted file mode 100644 index 6cce50996..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/LanguageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LanguageEnum { - EN("en"), - - DE("de"); - - private final String value; - - LanguageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/LinkToken.java b/src/main/java/com/merge/api/resources/ats/types/LinkToken.java deleted file mode 100644 index 0974edc34..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/LinkToken.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkToken.Builder.class) -public final class LinkToken { - private final String linkToken; - - private final Optional integrationName; - - private final Optional magicLinkUrl; - - private final Map additionalProperties; - - private LinkToken( - String linkToken, - Optional integrationName, - Optional magicLinkUrl, - Map additionalProperties) { - this.linkToken = linkToken; - this.integrationName = integrationName; - this.magicLinkUrl = magicLinkUrl; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("link_token") - public String getLinkToken() { - return linkToken; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - @JsonProperty("magic_link_url") - public Optional getMagicLinkUrl() { - return magicLinkUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkToken && equalTo((LinkToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkToken other) { - return linkToken.equals(other.linkToken) - && integrationName.equals(other.integrationName) - && magicLinkUrl.equals(other.magicLinkUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkTokenStage builder() { - return new Builder(); - } - - public interface LinkTokenStage { - _FinalStage linkToken(@NotNull String linkToken); - - Builder from(LinkToken other); - } - - public interface _FinalStage { - LinkToken build(); - - _FinalStage integrationName(Optional integrationName); - - _FinalStage integrationName(String integrationName); - - _FinalStage magicLinkUrl(Optional magicLinkUrl); - - _FinalStage magicLinkUrl(String magicLinkUrl); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkTokenStage, _FinalStage { - private String linkToken; - - private Optional magicLinkUrl = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkToken other) { - linkToken(other.getLinkToken()); - integrationName(other.getIntegrationName()); - magicLinkUrl(other.getMagicLinkUrl()); - return this; - } - - @java.lang.Override - @JsonSetter("link_token") - public _FinalStage linkToken(@NotNull String linkToken) { - this.linkToken = linkToken; - return this; - } - - @java.lang.Override - public _FinalStage magicLinkUrl(String magicLinkUrl) { - this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) - public _FinalStage magicLinkUrl(Optional magicLinkUrl) { - this.magicLinkUrl = magicLinkUrl; - return this; - } - - @java.lang.Override - public _FinalStage integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public _FinalStage integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - @java.lang.Override - public LinkToken build() { - return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/resources/ats/types/LinkedAccountStatus.java deleted file mode 100644 index 603119e83..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/LinkedAccountStatus.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) -public final class LinkedAccountStatus { - private final String linkedAccountStatus; - - private final boolean canMakeRequest; - - private final Map additionalProperties; - - private LinkedAccountStatus( - String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { - this.linkedAccountStatus = linkedAccountStatus; - this.canMakeRequest = canMakeRequest; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("linked_account_status") - public String getLinkedAccountStatus() { - return linkedAccountStatus; - } - - @JsonProperty("can_make_request") - public boolean getCanMakeRequest() { - return canMakeRequest; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountStatus other) { - return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkedAccountStatusStage builder() { - return new Builder(); - } - - public interface LinkedAccountStatusStage { - CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); - - Builder from(LinkedAccountStatus other); - } - - public interface CanMakeRequestStage { - _FinalStage canMakeRequest(boolean canMakeRequest); - } - - public interface _FinalStage { - LinkedAccountStatus build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { - private String linkedAccountStatus; - - private boolean canMakeRequest; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkedAccountStatus other) { - linkedAccountStatus(other.getLinkedAccountStatus()); - canMakeRequest(other.getCanMakeRequest()); - return this; - } - - @java.lang.Override - @JsonSetter("linked_account_status") - public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { - this.linkedAccountStatus = linkedAccountStatus; - return this; - } - - @java.lang.Override - @JsonSetter("can_make_request") - public _FinalStage canMakeRequest(boolean canMakeRequest) { - this.canMakeRequest = canMakeRequest; - return this; - } - - @java.lang.Override - public LinkedAccountStatus build() { - return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/MetaResponse.java b/src/main/java/com/merge/api/resources/ats/types/MetaResponse.java deleted file mode 100644 index c536109b8..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/MetaResponse.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MetaResponse.Builder.class) -public final class MetaResponse { - private final Map requestSchema; - - private final Optional> remoteFieldClasses; - - private final Optional status; - - private final boolean hasConditionalParams; - - private final boolean hasRequiredLinkedAccountParams; - - private final Map additionalProperties; - - private MetaResponse( - Map requestSchema, - Optional> remoteFieldClasses, - Optional status, - boolean hasConditionalParams, - boolean hasRequiredLinkedAccountParams, - Map additionalProperties) { - this.requestSchema = requestSchema; - this.remoteFieldClasses = remoteFieldClasses; - this.status = status; - this.hasConditionalParams = hasConditionalParams; - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("request_schema") - public Map getRequestSchema() { - return requestSchema; - } - - @JsonProperty("remote_field_classes") - public Optional> getRemoteFieldClasses() { - return remoteFieldClasses; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("has_conditional_params") - public boolean getHasConditionalParams() { - return hasConditionalParams; - } - - @JsonProperty("has_required_linked_account_params") - public boolean getHasRequiredLinkedAccountParams() { - return hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MetaResponse && equalTo((MetaResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MetaResponse other) { - return requestSchema.equals(other.requestSchema) - && remoteFieldClasses.equals(other.remoteFieldClasses) - && status.equals(other.status) - && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.requestSchema, - this.remoteFieldClasses, - this.status, - this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static HasConditionalParamsStage builder() { - return new Builder(); - } - - public interface HasConditionalParamsStage { - HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); - - Builder from(MetaResponse other); - } - - public interface HasRequiredLinkedAccountParamsStage { - _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); - } - - public interface _FinalStage { - MetaResponse build(); - - _FinalStage requestSchema(Map requestSchema); - - _FinalStage putAllRequestSchema(Map requestSchema); - - _FinalStage requestSchema(String key, JsonNode value); - - _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); - - _FinalStage remoteFieldClasses(Map remoteFieldClasses); - - _FinalStage status(Optional status); - - _FinalStage status(LinkedAccountStatus status); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { - private boolean hasConditionalParams; - - private boolean hasRequiredLinkedAccountParams; - - private Optional status = Optional.empty(); - - private Optional> remoteFieldClasses = Optional.empty(); - - private Map requestSchema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MetaResponse other) { - requestSchema(other.getRequestSchema()); - remoteFieldClasses(other.getRemoteFieldClasses()); - status(other.getStatus()); - hasConditionalParams(other.getHasConditionalParams()); - hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); - return this; - } - - @java.lang.Override - @JsonSetter("has_conditional_params") - public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { - this.hasConditionalParams = hasConditionalParams; - return this; - } - - @java.lang.Override - @JsonSetter("has_required_linked_account_params") - public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - return this; - } - - @java.lang.Override - public _FinalStage status(LinkedAccountStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { - this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) - public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { - this.remoteFieldClasses = remoteFieldClasses; - return this; - } - - @java.lang.Override - public _FinalStage requestSchema(String key, JsonNode value) { - this.requestSchema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllRequestSchema(Map requestSchema) { - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) - public _FinalStage requestSchema(Map requestSchema) { - this.requestSchema.clear(); - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - public MetaResponse build() { - return new MetaResponse( - requestSchema, - remoteFieldClasses, - status, - hasConditionalParams, - hasRequiredLinkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/MethodEnum.java b/src/main/java/com/merge/api/resources/ats/types/MethodEnum.java deleted file mode 100644 index b20af24a2..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/MethodEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum MethodEnum { - GET("GET"), - - OPTIONS("OPTIONS"), - - HEAD("HEAD"), - - POST("POST"), - - PUT("PUT"), - - PATCH("PATCH"), - - DELETE("DELETE"); - - private final String value; - - MethodEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ModelOperation.java b/src/main/java/com/merge/api/resources/ats/types/ModelOperation.java deleted file mode 100644 index 09da41faa..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ModelOperation.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelOperation.Builder.class) -public final class ModelOperation { - private final String modelName; - - private final List availableOperations; - - private final List requiredPostParameters; - - private final List supportedFields; - - private final Map additionalProperties; - - private ModelOperation( - String modelName, - List availableOperations, - List requiredPostParameters, - List supportedFields, - Map additionalProperties) { - this.modelName = modelName; - this.availableOperations = availableOperations; - this.requiredPostParameters = requiredPostParameters; - this.supportedFields = supportedFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("available_operations") - public List getAvailableOperations() { - return availableOperations; - } - - @JsonProperty("required_post_parameters") - public List getRequiredPostParameters() { - return requiredPostParameters; - } - - @JsonProperty("supported_fields") - public List getSupportedFields() { - return supportedFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelOperation && equalTo((ModelOperation) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelOperation other) { - return modelName.equals(other.modelName) - && availableOperations.equals(other.availableOperations) - && requiredPostParameters.equals(other.requiredPostParameters) - && supportedFields.equals(other.supportedFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(ModelOperation other); - } - - public interface _FinalStage { - ModelOperation build(); - - _FinalStage availableOperations(List availableOperations); - - _FinalStage addAvailableOperations(String availableOperations); - - _FinalStage addAllAvailableOperations(List availableOperations); - - _FinalStage requiredPostParameters(List requiredPostParameters); - - _FinalStage addRequiredPostParameters(String requiredPostParameters); - - _FinalStage addAllRequiredPostParameters(List requiredPostParameters); - - _FinalStage supportedFields(List supportedFields); - - _FinalStage addSupportedFields(String supportedFields); - - _FinalStage addAllSupportedFields(List supportedFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private List supportedFields = new ArrayList<>(); - - private List requiredPostParameters = new ArrayList<>(); - - private List availableOperations = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ModelOperation other) { - modelName(other.getModelName()); - availableOperations(other.getAvailableOperations()); - requiredPostParameters(other.getRequiredPostParameters()); - supportedFields(other.getSupportedFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage addAllSupportedFields(List supportedFields) { - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addSupportedFields(String supportedFields) { - this.supportedFields.add(supportedFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) - public _FinalStage supportedFields(List supportedFields) { - this.supportedFields.clear(); - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addRequiredPostParameters(String requiredPostParameters) { - this.requiredPostParameters.add(requiredPostParameters); - return this; - } - - @java.lang.Override - @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) - public _FinalStage requiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.clear(); - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addAllAvailableOperations(List availableOperations) { - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public _FinalStage addAvailableOperations(String availableOperations) { - this.availableOperations.add(availableOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) - public _FinalStage availableOperations(List availableOperations) { - this.availableOperations.clear(); - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public ModelOperation build() { - return new ModelOperation( - modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/resources/ats/types/ModelPermissionDeserializer.java deleted file mode 100644 index 5bd856be3..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ModelPermissionDeserializer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) -public final class ModelPermissionDeserializer { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializer other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializer other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializer build() { - return new ModelPermissionDeserializer(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/ats/types/ModelPermissionDeserializerRequest.java deleted file mode 100644 index 3670f25cb..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ModelPermissionDeserializerRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) -public final class ModelPermissionDeserializerRequest { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializerRequest - && equalTo((ModelPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializerRequest other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializerRequest other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializerRequest build() { - return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/resources/ats/types/MultipartFormFieldRequest.java deleted file mode 100644 index 94682fda3..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/MultipartFormFieldRequest.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) -public final class MultipartFormFieldRequest { - private final String name; - - private final String data; - - private final Optional encoding; - - private final Optional fileName; - - private final Optional contentType; - - private final Map additionalProperties; - - private MultipartFormFieldRequest( - String name, - String data, - Optional encoding, - Optional fileName, - Optional contentType, - Map additionalProperties) { - this.name = name; - this.data = data; - this.encoding = encoding; - this.fileName = fileName; - this.contentType = contentType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the form field - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The data for the form field. - */ - @JsonProperty("data") - public String getData() { - return data; - } - - /** - * @return The encoding of the value of data. Defaults to RAW if not defined. - *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- */ - @JsonProperty("encoding") - public Optional getEncoding() { - return encoding; - } - - /** - * @return The file name of the form field, if the field is for a file. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The MIME type of the file, if the field is for a file. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MultipartFormFieldRequest other) { - return name.equals(other.name) - && data.equals(other.data) - && encoding.equals(other.encoding) - && fileName.equals(other.fileName) - && contentType.equals(other.contentType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DataStage name(@NotNull String name); - - Builder from(MultipartFormFieldRequest other); - } - - public interface DataStage { - _FinalStage data(@NotNull String data); - } - - public interface _FinalStage { - MultipartFormFieldRequest build(); - - _FinalStage encoding(Optional encoding); - - _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); - - _FinalStage fileName(Optional fileName); - - _FinalStage fileName(String fileName); - - _FinalStage contentType(Optional contentType); - - _FinalStage contentType(String contentType); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DataStage, _FinalStage { - private String name; - - private String data; - - private Optional contentType = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional encoding = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MultipartFormFieldRequest other) { - name(other.getName()); - data(other.getData()); - encoding(other.getEncoding()); - fileName(other.getFileName()); - contentType(other.getContentType()); - return this; - } - - /** - *

The name of the form field

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public DataStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

The data for the form field.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull String data) { - this.data = data; - return this; - } - - /** - *

The MIME type of the file, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public _FinalStage contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - /** - *

The file name of the form field, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public _FinalStage fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - /** - *

The encoding of the value of data. Defaults to RAW if not defined.

- *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { - this.encoding = Optional.ofNullable(encoding); - return this; - } - - @java.lang.Override - @JsonSetter(value = "encoding", nulls = Nulls.SKIP) - public _FinalStage encoding(Optional encoding) { - this.encoding = encoding; - return this; - } - - @java.lang.Override - public MultipartFormFieldRequest build() { - return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/resources/ats/types/MultipartFormFieldRequestEncoding.java deleted file mode 100644 index f60d846f0..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/MultipartFormFieldRequestEncoding.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) -public final class MultipartFormFieldRequestEncoding { - private final Object value; - - private final int type; - - private MultipartFormFieldRequestEncoding(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EncodingEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); - } - - private boolean equalTo(MultipartFormFieldRequestEncoding other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { - return new MultipartFormFieldRequestEncoding(value, 0); - } - - public static MultipartFormFieldRequestEncoding of(String value) { - return new MultipartFormFieldRequestEncoding(value, 1); - } - - public interface Visitor { - T visit(EncodingEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MultipartFormFieldRequestEncoding.class); - } - - @java.lang.Override - public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/OfferStatus.java b/src/main/java/com/merge/api/resources/ats/types/OfferStatus.java deleted file mode 100644 index e3b03dfcf..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/OfferStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = OfferStatus.Deserializer.class) -public final class OfferStatus { - private final Object value; - - private final int type; - - private OfferStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((OfferStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof OfferStatus && equalTo((OfferStatus) other); - } - - private boolean equalTo(OfferStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static OfferStatus of(OfferStatusEnum value) { - return new OfferStatus(value, 0); - } - - public static OfferStatus of(String value) { - return new OfferStatus(value, 1); - } - - public interface Visitor { - T visit(OfferStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(OfferStatus.class); - } - - @java.lang.Override - public OfferStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, OfferStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/resources/ats/types/PaginatedAccountDetailsAndActionsList.java deleted file mode 100644 index 69403ce42..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedAccountDetailsAndActionsList.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) -public final class PaginatedAccountDetailsAndActionsList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountDetailsAndActionsList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountDetailsAndActionsList - && equalTo((PaginatedAccountDetailsAndActionsList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountDetailsAndActionsList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountDetailsAndActionsList build() { - return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedAttachmentList.java b/src/main/java/com/merge/api/resources/ats/types/PaginatedAttachmentList.java deleted file mode 100644 index 1fd85d5d5..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedAttachmentList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAttachmentList.Builder.class) -public final class PaginatedAttachmentList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAttachmentList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAttachmentList && equalTo((PaginatedAttachmentList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAttachmentList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAttachmentList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAttachmentList build() { - return new PaginatedAttachmentList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/resources/ats/types/PaginatedAuditLogEventList.java deleted file mode 100644 index 4852ef536..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedAuditLogEventList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) -public final class PaginatedAuditLogEventList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAuditLogEventList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAuditLogEventList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAuditLogEventList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAuditLogEventList build() { - return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedIssueList.java b/src/main/java/com/merge/api/resources/ats/types/PaginatedIssueList.java deleted file mode 100644 index b895de603..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedIssueList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedIssueList.Builder.class) -public final class PaginatedIssueList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedIssueList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedIssueList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedIssueList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedIssueList build() { - return new PaginatedIssueList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/resources/ats/types/PaginatedSyncStatusList.java deleted file mode 100644 index 210b0e395..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedSyncStatusList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) -public final class PaginatedSyncStatusList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedSyncStatusList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedSyncStatusList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedSyncStatusList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedSyncStatusList build() { - return new PaginatedSyncStatusList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PaginatedTagList.java b/src/main/java/com/merge/api/resources/ats/types/PaginatedTagList.java deleted file mode 100644 index c1b970007..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PaginatedTagList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedTagList.Builder.class) -public final class PaginatedTagList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedTagList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedTagList && equalTo((PaginatedTagList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedTagList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedTagList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedTagList build() { - return new PaginatedTagList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PhoneNumber.java b/src/main/java/com/merge/api/resources/ats/types/PhoneNumber.java deleted file mode 100644 index bb739368b..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PhoneNumber.java +++ /dev/null @@ -1,217 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PhoneNumber.Builder.class) -public final class PhoneNumber { - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional value; - - private final Optional phoneNumberType; - - private final Optional remoteWasDeleted; - - private final Map additionalProperties; - - private PhoneNumber( - Optional createdAt, - Optional modifiedAt, - Optional value, - Optional phoneNumberType, - Optional remoteWasDeleted, - Map additionalProperties) { - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.value = value; - this.phoneNumberType = phoneNumberType; - this.remoteWasDeleted = remoteWasDeleted; - this.additionalProperties = additionalProperties; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The phone number. - */ - @JsonProperty("value") - public Optional getValue() { - return value; - } - - /** - * @return The type of phone number. - *
    - *
  • HOME - HOME
  • - *
  • WORK - WORK
  • - *
  • MOBILE - MOBILE
  • - *
  • SKYPE - SKYPE
  • - *
  • OTHER - OTHER
  • - *
- */ - @JsonProperty("phone_number_type") - public Optional getPhoneNumberType() { - return phoneNumberType; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneNumber && equalTo((PhoneNumber) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PhoneNumber other) { - return createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && value.equals(other.value) - && phoneNumberType.equals(other.phoneNumberType) - && remoteWasDeleted.equals(other.remoteWasDeleted); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.createdAt, this.modifiedAt, this.value, this.phoneNumberType, this.remoteWasDeleted); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional value = Optional.empty(); - - private Optional phoneNumberType = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PhoneNumber other) { - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - value(other.getValue()); - phoneNumberType(other.getPhoneNumberType()); - remoteWasDeleted(other.getRemoteWasDeleted()); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public Builder value(Optional value) { - this.value = value; - return this; - } - - public Builder value(String value) { - this.value = Optional.ofNullable(value); - return this; - } - - @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) - public Builder phoneNumberType(Optional phoneNumberType) { - this.phoneNumberType = phoneNumberType; - return this; - } - - public Builder phoneNumberType(PhoneNumberPhoneNumberType phoneNumberType) { - this.phoneNumberType = Optional.ofNullable(phoneNumberType); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - public PhoneNumber build() { - return new PhoneNumber( - createdAt, modifiedAt, value, phoneNumberType, remoteWasDeleted, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberPhoneNumberType.java b/src/main/java/com/merge/api/resources/ats/types/PhoneNumberPhoneNumberType.java deleted file mode 100644 index c14d32a40..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberPhoneNumberType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PhoneNumberPhoneNumberType.Deserializer.class) -public final class PhoneNumberPhoneNumberType { - private final Object value; - - private final int type; - - private PhoneNumberPhoneNumberType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PhoneNumberTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneNumberPhoneNumberType && equalTo((PhoneNumberPhoneNumberType) other); - } - - private boolean equalTo(PhoneNumberPhoneNumberType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PhoneNumberPhoneNumberType of(PhoneNumberTypeEnum value) { - return new PhoneNumberPhoneNumberType(value, 0); - } - - public static PhoneNumberPhoneNumberType of(String value) { - return new PhoneNumberPhoneNumberType(value, 1); - } - - public interface Visitor { - T visit(PhoneNumberTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PhoneNumberPhoneNumberType.class); - } - - @java.lang.Override - public PhoneNumberPhoneNumberType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PhoneNumberTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberRequest.java b/src/main/java/com/merge/api/resources/ats/types/PhoneNumberRequest.java deleted file mode 100644 index d772ce948..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberRequest.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PhoneNumberRequest.Builder.class) -public final class PhoneNumberRequest { - private final Optional value; - - private final Optional phoneNumberType; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private PhoneNumberRequest( - Optional value, - Optional phoneNumberType, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.value = value; - this.phoneNumberType = phoneNumberType; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The phone number. - */ - @JsonProperty("value") - public Optional getValue() { - return value; - } - - /** - * @return The type of phone number. - *
    - *
  • HOME - HOME
  • - *
  • WORK - WORK
  • - *
  • MOBILE - MOBILE
  • - *
  • SKYPE - SKYPE
  • - *
  • OTHER - OTHER
  • - *
- */ - @JsonProperty("phone_number_type") - public Optional getPhoneNumberType() { - return phoneNumberType; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneNumberRequest && equalTo((PhoneNumberRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PhoneNumberRequest other) { - return value.equals(other.value) - && phoneNumberType.equals(other.phoneNumberType) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value, this.phoneNumberType, this.integrationParams, this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional value = Optional.empty(); - - private Optional phoneNumberType = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PhoneNumberRequest other) { - value(other.getValue()); - phoneNumberType(other.getPhoneNumberType()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public Builder value(Optional value) { - this.value = value; - return this; - } - - public Builder value(String value) { - this.value = Optional.ofNullable(value); - return this; - } - - @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) - public Builder phoneNumberType(Optional phoneNumberType) { - this.phoneNumberType = phoneNumberType; - return this; - } - - public Builder phoneNumberType(PhoneNumberRequestPhoneNumberType phoneNumberType) { - this.phoneNumberType = Optional.ofNullable(phoneNumberType); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public PhoneNumberRequest build() { - return new PhoneNumberRequest( - value, phoneNumberType, integrationParams, linkedAccountParams, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberRequestPhoneNumberType.java b/src/main/java/com/merge/api/resources/ats/types/PhoneNumberRequestPhoneNumberType.java deleted file mode 100644 index 0a60a42d6..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/PhoneNumberRequestPhoneNumberType.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PhoneNumberRequestPhoneNumberType.Deserializer.class) -public final class PhoneNumberRequestPhoneNumberType { - private final Object value; - - private final int type; - - private PhoneNumberRequestPhoneNumberType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PhoneNumberTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneNumberRequestPhoneNumberType && equalTo((PhoneNumberRequestPhoneNumberType) other); - } - - private boolean equalTo(PhoneNumberRequestPhoneNumberType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PhoneNumberRequestPhoneNumberType of(PhoneNumberTypeEnum value) { - return new PhoneNumberRequestPhoneNumberType(value, 0); - } - - public static PhoneNumberRequestPhoneNumberType of(String value) { - return new PhoneNumberRequestPhoneNumberType(value, 1); - } - - public interface Visitor { - T visit(PhoneNumberTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PhoneNumberRequestPhoneNumberType.class); - } - - @java.lang.Override - public PhoneNumberRequestPhoneNumberType deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PhoneNumberTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ReasonEnum.java b/src/main/java/com/merge/api/resources/ats/types/ReasonEnum.java deleted file mode 100644 index 30f513d34..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ReasonEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ReasonEnum { - GENERAL_CUSTOMER_REQUEST("GENERAL_CUSTOMER_REQUEST"), - - GDPR("GDPR"), - - OTHER("OTHER"); - - private final String value; - - ReasonEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteData.java b/src/main/java/com/merge/api/resources/ats/types/RemoteData.java deleted file mode 100644 index 267764792..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteData.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteData.Builder.class) -public final class RemoteData { - private final String path; - - private final Optional data; - - private final Map additionalProperties; - - private RemoteData(String path, Optional data, Map additionalProperties) { - this.path = path; - this.data = data; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API path that is being called. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("data") - public Optional getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteData && equalTo((RemoteData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteData other) { - return path.equals(other.path) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.path, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PathStage builder() { - return new Builder(); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - - Builder from(RemoteData other); - } - - public interface _FinalStage { - RemoteData build(); - - _FinalStage data(Optional data); - - _FinalStage data(JsonNode data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PathStage, _FinalStage { - private String path; - - private Optional data = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteData other) { - path(other.getPath()); - data(other.getData()); - return this; - } - - /** - *

The third-party API path that is being called.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - public _FinalStage data(JsonNode data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - @java.lang.Override - public RemoteData build() { - return new RemoteData(path, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/ats/types/RemoteEndpointInfo.java deleted file mode 100644 index b3f74964a..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteEndpointInfo.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) -public final class RemoteEndpointInfo { - private final String method; - - private final String urlPath; - - private final List fieldTraversalPath; - - private final Map additionalProperties; - - private RemoteEndpointInfo( - String method, - String urlPath, - List fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("url_path") - public String getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public List getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - UrlPathStage method(@NotNull String method); - - Builder from(RemoteEndpointInfo other); - } - - public interface UrlPathStage { - _FinalStage urlPath(@NotNull String urlPath); - } - - public interface _FinalStage { - RemoteEndpointInfo build(); - - _FinalStage fieldTraversalPath(List fieldTraversalPath); - - _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); - - _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { - private String method; - - private String urlPath; - - private List fieldTraversalPath = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public UrlPathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("url_path") - public _FinalStage urlPath(@NotNull String urlPath) { - this.urlPath = urlPath; - return this; - } - - @java.lang.Override - public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { - this.fieldTraversalPath.add(fieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.clear(); - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public RemoteEndpointInfo build() { - return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApi.java b/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApi.java deleted file mode 100644 index df03d4461..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApi.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApi.Builder.class) -public final class RemoteFieldApi { - private final Map schema; - - private final String remoteKeyName; - - private final RemoteEndpointInfo remoteEndpointInfo; - - private final Optional> exampleValues; - - private final Optional advancedMetadata; - - private final Optional coverage; - - private final Map additionalProperties; - - private RemoteFieldApi( - Map schema, - String remoteKeyName, - RemoteEndpointInfo remoteEndpointInfo, - Optional> exampleValues, - Optional advancedMetadata, - Optional coverage, - Map additionalProperties) { - this.schema = schema; - this.remoteKeyName = remoteKeyName; - this.remoteEndpointInfo = remoteEndpointInfo; - this.exampleValues = exampleValues; - this.advancedMetadata = advancedMetadata; - this.coverage = coverage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("schema") - public Map getSchema() { - return schema; - } - - @JsonProperty("remote_key_name") - public String getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("remote_endpoint_info") - public RemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @JsonProperty("example_values") - public Optional> getExampleValues() { - return exampleValues; - } - - @JsonProperty("advanced_metadata") - public Optional getAdvancedMetadata() { - return advancedMetadata; - } - - @JsonProperty("coverage") - public Optional getCoverage() { - return coverage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApi other) { - return schema.equals(other.schema) - && remoteKeyName.equals(other.remoteKeyName) - && remoteEndpointInfo.equals(other.remoteEndpointInfo) - && exampleValues.equals(other.exampleValues) - && advancedMetadata.equals(other.advancedMetadata) - && coverage.equals(other.coverage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.schema, - this.remoteKeyName, - this.remoteEndpointInfo, - this.exampleValues, - this.advancedMetadata, - this.coverage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteKeyNameStage builder() { - return new Builder(); - } - - public interface RemoteKeyNameStage { - RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); - - Builder from(RemoteFieldApi other); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); - } - - public interface _FinalStage { - RemoteFieldApi build(); - - _FinalStage schema(Map schema); - - _FinalStage putAllSchema(Map schema); - - _FinalStage schema(String key, JsonNode value); - - _FinalStage exampleValues(Optional> exampleValues); - - _FinalStage exampleValues(List exampleValues); - - _FinalStage advancedMetadata(Optional advancedMetadata); - - _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); - - _FinalStage coverage(Optional coverage); - - _FinalStage coverage(RemoteFieldApiCoverage coverage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { - private String remoteKeyName; - - private RemoteEndpointInfo remoteEndpointInfo; - - private Optional coverage = Optional.empty(); - - private Optional advancedMetadata = Optional.empty(); - - private Optional> exampleValues = Optional.empty(); - - private Map schema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldApi other) { - schema(other.getSchema()); - remoteKeyName(other.getRemoteKeyName()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - exampleValues(other.getExampleValues()); - advancedMetadata(other.getAdvancedMetadata()); - coverage(other.getCoverage()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_key_name") - public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage coverage(RemoteFieldApiCoverage coverage) { - this.coverage = Optional.ofNullable(coverage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "coverage", nulls = Nulls.SKIP) - public _FinalStage coverage(Optional coverage) { - this.coverage = coverage; - return this; - } - - @java.lang.Override - public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { - this.advancedMetadata = Optional.ofNullable(advancedMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) - public _FinalStage advancedMetadata(Optional advancedMetadata) { - this.advancedMetadata = advancedMetadata; - return this; - } - - @java.lang.Override - public _FinalStage exampleValues(List exampleValues) { - this.exampleValues = Optional.ofNullable(exampleValues); - return this; - } - - @java.lang.Override - @JsonSetter(value = "example_values", nulls = Nulls.SKIP) - public _FinalStage exampleValues(Optional> exampleValues) { - this.exampleValues = exampleValues; - return this; - } - - @java.lang.Override - public _FinalStage schema(String key, JsonNode value) { - this.schema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllSchema(Map schema) { - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Map schema) { - this.schema.clear(); - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - public RemoteFieldApi build() { - return new RemoteFieldApi( - schema, - remoteKeyName, - remoteEndpointInfo, - exampleValues, - advancedMetadata, - coverage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApiCoverage.java deleted file mode 100644 index 902f1c51c..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApiCoverage.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) -public final class RemoteFieldApiCoverage { - private final Object value; - - private final int type; - - private RemoteFieldApiCoverage(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((int) this.value); - } else if (this.type == 1) { - return visitor.visit((double) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); - } - - private boolean equalTo(RemoteFieldApiCoverage other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldApiCoverage of(int value) { - return new RemoteFieldApiCoverage(value, 0); - } - - public static RemoteFieldApiCoverage of(double value) { - return new RemoteFieldApiCoverage(value, 1); - } - - public interface Visitor { - T visit(int value); - - T visit(double value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldApiCoverage.class); - } - - @java.lang.Override - public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - if (value instanceof Integer) { - return of((Integer) value); - } - if (value instanceof Double) { - return of((Double) value); - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApiResponse.java deleted file mode 100644 index 0cb9db7d8..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteFieldApiResponse.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) -public final class RemoteFieldApiResponse { - private final Optional> activity; - - private final Optional> application; - - private final Optional> attachment; - - private final Optional> candidate; - - private final Optional> department; - - private final Optional> eeoc; - - private final Optional> scheduledInterview; - - private final Optional> job; - - private final Optional> jobPosting; - - private final Optional> jobInterviewStage; - - private final Optional> offer; - - private final Optional> office; - - private final Optional> rejectReason; - - private final Optional> scorecard; - - private final Optional> tag; - - private final Optional> remoteUser; - - private final Map additionalProperties; - - private RemoteFieldApiResponse( - Optional> activity, - Optional> application, - Optional> attachment, - Optional> candidate, - Optional> department, - Optional> eeoc, - Optional> scheduledInterview, - Optional> job, - Optional> jobPosting, - Optional> jobInterviewStage, - Optional> offer, - Optional> office, - Optional> rejectReason, - Optional> scorecard, - Optional> tag, - Optional> remoteUser, - Map additionalProperties) { - this.activity = activity; - this.application = application; - this.attachment = attachment; - this.candidate = candidate; - this.department = department; - this.eeoc = eeoc; - this.scheduledInterview = scheduledInterview; - this.job = job; - this.jobPosting = jobPosting; - this.jobInterviewStage = jobInterviewStage; - this.offer = offer; - this.office = office; - this.rejectReason = rejectReason; - this.scorecard = scorecard; - this.tag = tag; - this.remoteUser = remoteUser; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Activity") - public Optional> getActivity() { - return activity; - } - - @JsonProperty("Application") - public Optional> getApplication() { - return application; - } - - @JsonProperty("Attachment") - public Optional> getAttachment() { - return attachment; - } - - @JsonProperty("Candidate") - public Optional> getCandidate() { - return candidate; - } - - @JsonProperty("Department") - public Optional> getDepartment() { - return department; - } - - @JsonProperty("EEOC") - public Optional> getEeoc() { - return eeoc; - } - - @JsonProperty("ScheduledInterview") - public Optional> getScheduledInterview() { - return scheduledInterview; - } - - @JsonProperty("Job") - public Optional> getJob() { - return job; - } - - @JsonProperty("JobPosting") - public Optional> getJobPosting() { - return jobPosting; - } - - @JsonProperty("JobInterviewStage") - public Optional> getJobInterviewStage() { - return jobInterviewStage; - } - - @JsonProperty("Offer") - public Optional> getOffer() { - return offer; - } - - @JsonProperty("Office") - public Optional> getOffice() { - return office; - } - - @JsonProperty("RejectReason") - public Optional> getRejectReason() { - return rejectReason; - } - - @JsonProperty("Scorecard") - public Optional> getScorecard() { - return scorecard; - } - - @JsonProperty("Tag") - public Optional> getTag() { - return tag; - } - - @JsonProperty("RemoteUser") - public Optional> getRemoteUser() { - return remoteUser; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApiResponse other) { - return activity.equals(other.activity) - && application.equals(other.application) - && attachment.equals(other.attachment) - && candidate.equals(other.candidate) - && department.equals(other.department) - && eeoc.equals(other.eeoc) - && scheduledInterview.equals(other.scheduledInterview) - && job.equals(other.job) - && jobPosting.equals(other.jobPosting) - && jobInterviewStage.equals(other.jobInterviewStage) - && offer.equals(other.offer) - && office.equals(other.office) - && rejectReason.equals(other.rejectReason) - && scorecard.equals(other.scorecard) - && tag.equals(other.tag) - && remoteUser.equals(other.remoteUser); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.activity, - this.application, - this.attachment, - this.candidate, - this.department, - this.eeoc, - this.scheduledInterview, - this.job, - this.jobPosting, - this.jobInterviewStage, - this.offer, - this.office, - this.rejectReason, - this.scorecard, - this.tag, - this.remoteUser); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> activity = Optional.empty(); - - private Optional> application = Optional.empty(); - - private Optional> attachment = Optional.empty(); - - private Optional> candidate = Optional.empty(); - - private Optional> department = Optional.empty(); - - private Optional> eeoc = Optional.empty(); - - private Optional> scheduledInterview = Optional.empty(); - - private Optional> job = Optional.empty(); - - private Optional> jobPosting = Optional.empty(); - - private Optional> jobInterviewStage = Optional.empty(); - - private Optional> offer = Optional.empty(); - - private Optional> office = Optional.empty(); - - private Optional> rejectReason = Optional.empty(); - - private Optional> scorecard = Optional.empty(); - - private Optional> tag = Optional.empty(); - - private Optional> remoteUser = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldApiResponse other) { - activity(other.getActivity()); - application(other.getApplication()); - attachment(other.getAttachment()); - candidate(other.getCandidate()); - department(other.getDepartment()); - eeoc(other.getEeoc()); - scheduledInterview(other.getScheduledInterview()); - job(other.getJob()); - jobPosting(other.getJobPosting()); - jobInterviewStage(other.getJobInterviewStage()); - offer(other.getOffer()); - office(other.getOffice()); - rejectReason(other.getRejectReason()); - scorecard(other.getScorecard()); - tag(other.getTag()); - remoteUser(other.getRemoteUser()); - return this; - } - - @JsonSetter(value = "Activity", nulls = Nulls.SKIP) - public Builder activity(Optional> activity) { - this.activity = activity; - return this; - } - - public Builder activity(List activity) { - this.activity = Optional.ofNullable(activity); - return this; - } - - @JsonSetter(value = "Application", nulls = Nulls.SKIP) - public Builder application(Optional> application) { - this.application = application; - return this; - } - - public Builder application(List application) { - this.application = Optional.ofNullable(application); - return this; - } - - @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) - public Builder attachment(Optional> attachment) { - this.attachment = attachment; - return this; - } - - public Builder attachment(List attachment) { - this.attachment = Optional.ofNullable(attachment); - return this; - } - - @JsonSetter(value = "Candidate", nulls = Nulls.SKIP) - public Builder candidate(Optional> candidate) { - this.candidate = candidate; - return this; - } - - public Builder candidate(List candidate) { - this.candidate = Optional.ofNullable(candidate); - return this; - } - - @JsonSetter(value = "Department", nulls = Nulls.SKIP) - public Builder department(Optional> department) { - this.department = department; - return this; - } - - public Builder department(List department) { - this.department = Optional.ofNullable(department); - return this; - } - - @JsonSetter(value = "EEOC", nulls = Nulls.SKIP) - public Builder eeoc(Optional> eeoc) { - this.eeoc = eeoc; - return this; - } - - public Builder eeoc(List eeoc) { - this.eeoc = Optional.ofNullable(eeoc); - return this; - } - - @JsonSetter(value = "ScheduledInterview", nulls = Nulls.SKIP) - public Builder scheduledInterview(Optional> scheduledInterview) { - this.scheduledInterview = scheduledInterview; - return this; - } - - public Builder scheduledInterview(List scheduledInterview) { - this.scheduledInterview = Optional.ofNullable(scheduledInterview); - return this; - } - - @JsonSetter(value = "Job", nulls = Nulls.SKIP) - public Builder job(Optional> job) { - this.job = job; - return this; - } - - public Builder job(List job) { - this.job = Optional.ofNullable(job); - return this; - } - - @JsonSetter(value = "JobPosting", nulls = Nulls.SKIP) - public Builder jobPosting(Optional> jobPosting) { - this.jobPosting = jobPosting; - return this; - } - - public Builder jobPosting(List jobPosting) { - this.jobPosting = Optional.ofNullable(jobPosting); - return this; - } - - @JsonSetter(value = "JobInterviewStage", nulls = Nulls.SKIP) - public Builder jobInterviewStage(Optional> jobInterviewStage) { - this.jobInterviewStage = jobInterviewStage; - return this; - } - - public Builder jobInterviewStage(List jobInterviewStage) { - this.jobInterviewStage = Optional.ofNullable(jobInterviewStage); - return this; - } - - @JsonSetter(value = "Offer", nulls = Nulls.SKIP) - public Builder offer(Optional> offer) { - this.offer = offer; - return this; - } - - public Builder offer(List offer) { - this.offer = Optional.ofNullable(offer); - return this; - } - - @JsonSetter(value = "Office", nulls = Nulls.SKIP) - public Builder office(Optional> office) { - this.office = office; - return this; - } - - public Builder office(List office) { - this.office = Optional.ofNullable(office); - return this; - } - - @JsonSetter(value = "RejectReason", nulls = Nulls.SKIP) - public Builder rejectReason(Optional> rejectReason) { - this.rejectReason = rejectReason; - return this; - } - - public Builder rejectReason(List rejectReason) { - this.rejectReason = Optional.ofNullable(rejectReason); - return this; - } - - @JsonSetter(value = "Scorecard", nulls = Nulls.SKIP) - public Builder scorecard(Optional> scorecard) { - this.scorecard = scorecard; - return this; - } - - public Builder scorecard(List scorecard) { - this.scorecard = Optional.ofNullable(scorecard); - return this; - } - - @JsonSetter(value = "Tag", nulls = Nulls.SKIP) - public Builder tag(Optional> tag) { - this.tag = tag; - return this; - } - - public Builder tag(List tag) { - this.tag = Optional.ofNullable(tag); - return this; - } - - @JsonSetter(value = "RemoteUser", nulls = Nulls.SKIP) - public Builder remoteUser(Optional> remoteUser) { - this.remoteUser = remoteUser; - return this; - } - - public Builder remoteUser(List remoteUser) { - this.remoteUser = Optional.ofNullable(remoteUser); - return this; - } - - public RemoteFieldApiResponse build() { - return new RemoteFieldApiResponse( - activity, - application, - attachment, - candidate, - department, - eeoc, - scheduledInterview, - job, - jobPosting, - jobInterviewStage, - offer, - office, - rejectReason, - scorecard, - tag, - remoteUser, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteKey.java b/src/main/java/com/merge/api/resources/ats/types/RemoteKey.java deleted file mode 100644 index 6dd0358ce..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteKey.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKey.Builder.class) -public final class RemoteKey { - private final String name; - - private final String key; - - private final Map additionalProperties; - - private RemoteKey(String name, String key, Map additionalProperties) { - this.name = name; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("key") - public String getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKey && equalTo((RemoteKey) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKey other) { - return name.equals(other.name) && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - KeyStage name(@NotNull String name); - - Builder from(RemoteKey other); - } - - public interface KeyStage { - _FinalStage key(@NotNull String key); - } - - public interface _FinalStage { - RemoteKey build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, KeyStage, _FinalStage { - private String name; - - private String key; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKey other) { - name(other.getName()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public KeyStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("key") - public _FinalStage key(@NotNull String key) { - this.key = key; - return this; - } - - @java.lang.Override - public RemoteKey build() { - return new RemoteKey(name, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteResponse.java b/src/main/java/com/merge/api/resources/ats/types/RemoteResponse.java deleted file mode 100644 index d8b7727d3..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteResponse.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteResponse.Builder.class) -public final class RemoteResponse { - private final String method; - - private final String path; - - private final int status; - - private final JsonNode response; - - private final Optional> responseHeaders; - - private final Optional responseType; - - private final Optional> headers; - - private final Map additionalProperties; - - private RemoteResponse( - String method, - String path, - int status, - JsonNode response, - Optional> responseHeaders, - Optional responseType, - Optional> headers, - Map additionalProperties) { - this.method = method; - this.path = path; - this.status = status; - this.response = response; - this.responseHeaders = responseHeaders; - this.responseType = responseType; - this.headers = headers; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("status") - public int getStatus() { - return status; - } - - @JsonProperty("response") - public JsonNode getResponse() { - return response; - } - - @JsonProperty("response_headers") - public Optional> getResponseHeaders() { - return responseHeaders; - } - - @JsonProperty("response_type") - public Optional getResponseType() { - return responseType; - } - - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponse && equalTo((RemoteResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteResponse other) { - return method.equals(other.method) - && path.equals(other.path) - && status == other.status - && response.equals(other.response) - && responseHeaders.equals(other.responseHeaders) - && responseType.equals(other.responseType) - && headers.equals(other.headers); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.status, - this.response, - this.responseHeaders, - this.responseType, - this.headers); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull String method); - - Builder from(RemoteResponse other); - } - - public interface PathStage { - StatusStage path(@NotNull String path); - } - - public interface StatusStage { - ResponseStage status(int status); - } - - public interface ResponseStage { - _FinalStage response(@NotNull JsonNode response); - } - - public interface _FinalStage { - RemoteResponse build(); - - _FinalStage responseHeaders(Optional> responseHeaders); - - _FinalStage responseHeaders(Map responseHeaders); - - _FinalStage responseType(Optional responseType); - - _FinalStage responseType(RemoteResponseResponseType responseType); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { - private String method; - - private String path; - - private int status; - - private JsonNode response; - - private Optional> headers = Optional.empty(); - - private Optional responseType = Optional.empty(); - - private Optional> responseHeaders = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteResponse other) { - method(other.getMethod()); - path(other.getPath()); - status(other.getStatus()); - response(other.getResponse()); - responseHeaders(other.getResponseHeaders()); - responseType(other.getResponseType()); - headers(other.getHeaders()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("path") - public StatusStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public ResponseStage status(int status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("response") - public _FinalStage response(@NotNull JsonNode response) { - this.response = response; - return this; - } - - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - @java.lang.Override - public _FinalStage responseType(RemoteResponseResponseType responseType) { - this.responseType = Optional.ofNullable(responseType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_type", nulls = Nulls.SKIP) - public _FinalStage responseType(Optional responseType) { - this.responseType = responseType; - return this; - } - - @java.lang.Override - public _FinalStage responseHeaders(Map responseHeaders) { - this.responseHeaders = Optional.ofNullable(responseHeaders); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) - public _FinalStage responseHeaders(Optional> responseHeaders) { - this.responseHeaders = responseHeaders; - return this; - } - - @java.lang.Override - public RemoteResponse build() { - return new RemoteResponse( - method, path, status, response, responseHeaders, responseType, headers, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteResponseResponseType.java b/src/main/java/com/merge/api/resources/ats/types/RemoteResponseResponseType.java deleted file mode 100644 index a0c5c62b6..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteResponseResponseType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteResponseResponseType.Deserializer.class) -public final class RemoteResponseResponseType { - private final Object value; - - private final int type; - - private RemoteResponseResponseType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ResponseTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponseResponseType && equalTo((RemoteResponseResponseType) other); - } - - private boolean equalTo(RemoteResponseResponseType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteResponseResponseType of(ResponseTypeEnum value) { - return new RemoteResponseResponseType(value, 0); - } - - public static RemoteResponseResponseType of(String value) { - return new RemoteResponseResponseType(value, 1); - } - - public interface Visitor { - T visit(ResponseTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteResponseResponseType.class); - } - - @java.lang.Override - public RemoteResponseResponseType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ResponseTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RemoteUserAccessRole.java b/src/main/java/com/merge/api/resources/ats/types/RemoteUserAccessRole.java deleted file mode 100644 index 92ecb01c1..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RemoteUserAccessRole.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteUserAccessRole.Deserializer.class) -public final class RemoteUserAccessRole { - private final Object value; - - private final int type; - - private RemoteUserAccessRole(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AccessRoleEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteUserAccessRole && equalTo((RemoteUserAccessRole) other); - } - - private boolean equalTo(RemoteUserAccessRole other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteUserAccessRole of(AccessRoleEnum value) { - return new RemoteUserAccessRole(value, 0); - } - - public static RemoteUserAccessRole of(String value) { - return new RemoteUserAccessRole(value, 1); - } - - public interface Visitor { - T visit(AccessRoleEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteUserAccessRole.class); - } - - @java.lang.Override - public RemoteUserAccessRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccessRoleEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RequestFormatEnum.java b/src/main/java/com/merge/api/resources/ats/types/RequestFormatEnum.java deleted file mode 100644 index 10ca9fabd..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RequestFormatEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RequestFormatEnum { - JSON("JSON"), - - XML("XML"), - - MULTIPART("MULTIPART"); - - private final String value; - - RequestFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/resources/ats/types/ResponseTypeEnum.java deleted file mode 100644 index 95b15ed19..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ResponseTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ResponseTypeEnum { - JSON("JSON"), - - BASE_64_GZIP("BASE64_GZIP"); - - private final String value; - - ResponseTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/RoleEnum.java b/src/main/java/com/merge/api/resources/ats/types/RoleEnum.java deleted file mode 100644 index c30636667..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/RoleEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RoleEnum { - ADMIN("ADMIN"), - - DEVELOPER("DEVELOPER"), - - MEMBER("MEMBER"), - - API("API"), - - SYSTEM("SYSTEM"), - - MERGE_TEAM("MERGE_TEAM"); - - private final String value; - - RoleEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewRequestStatus.java b/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewRequestStatus.java deleted file mode 100644 index 7cffbdcae..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewRequestStatus.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ScheduledInterviewRequestStatus.Deserializer.class) -public final class ScheduledInterviewRequestStatus { - private final Object value; - - private final int type; - - private ScheduledInterviewRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ScheduledInterviewStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ScheduledInterviewRequestStatus && equalTo((ScheduledInterviewRequestStatus) other); - } - - private boolean equalTo(ScheduledInterviewRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ScheduledInterviewRequestStatus of(ScheduledInterviewStatusEnum value) { - return new ScheduledInterviewRequestStatus(value, 0); - } - - public static ScheduledInterviewRequestStatus of(String value) { - return new ScheduledInterviewRequestStatus(value, 1); - } - - public interface Visitor { - T visit(ScheduledInterviewStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ScheduledInterviewRequestStatus.class); - } - - @java.lang.Override - public ScheduledInterviewRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ScheduledInterviewStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewStatus.java b/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewStatus.java deleted file mode 100644 index 93c6ccd90..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ScheduledInterviewStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ScheduledInterviewStatus.Deserializer.class) -public final class ScheduledInterviewStatus { - private final Object value; - - private final int type; - - private ScheduledInterviewStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ScheduledInterviewStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ScheduledInterviewStatus && equalTo((ScheduledInterviewStatus) other); - } - - private boolean equalTo(ScheduledInterviewStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ScheduledInterviewStatus of(ScheduledInterviewStatusEnum value) { - return new ScheduledInterviewStatus(value, 0); - } - - public static ScheduledInterviewStatus of(String value) { - return new ScheduledInterviewStatus(value, 1); - } - - public interface Visitor { - T visit(ScheduledInterviewStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ScheduledInterviewStatus.class); - } - - @java.lang.Override - public ScheduledInterviewStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ScheduledInterviewStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ScorecardOverallRecommendation.java b/src/main/java/com/merge/api/resources/ats/types/ScorecardOverallRecommendation.java deleted file mode 100644 index 454b338e2..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ScorecardOverallRecommendation.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ScorecardOverallRecommendation.Deserializer.class) -public final class ScorecardOverallRecommendation { - private final Object value; - - private final int type; - - private ScorecardOverallRecommendation(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((OverallRecommendationEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ScorecardOverallRecommendation && equalTo((ScorecardOverallRecommendation) other); - } - - private boolean equalTo(ScorecardOverallRecommendation other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ScorecardOverallRecommendation of(OverallRecommendationEnum value) { - return new ScorecardOverallRecommendation(value, 0); - } - - public static ScorecardOverallRecommendation of(String value) { - return new ScorecardOverallRecommendation(value, 1); - } - - public interface Visitor { - T visit(OverallRecommendationEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ScorecardOverallRecommendation.class); - } - - @java.lang.Override - public ScorecardOverallRecommendation deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, OverallRecommendationEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionType.java b/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionType.java deleted file mode 100644 index 37d68c9d5..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ScreeningQuestionType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ScreeningQuestionType.Deserializer.class) -public final class ScreeningQuestionType { - private final Object value; - - private final int type; - - private ScreeningQuestionType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ScreeningQuestionTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ScreeningQuestionType && equalTo((ScreeningQuestionType) other); - } - - private boolean equalTo(ScreeningQuestionType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ScreeningQuestionType of(ScreeningQuestionTypeEnum value) { - return new ScreeningQuestionType(value, 0); - } - - public static ScreeningQuestionType of(String value) { - return new ScreeningQuestionType(value, 1); - } - - public interface Visitor { - T visit(ScreeningQuestionTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ScreeningQuestionType.class); - } - - @java.lang.Override - public ScreeningQuestionType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ScreeningQuestionTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/resources/ats/types/SelectiveSyncConfigurationsUsageEnum.java deleted file mode 100644 index d60aad059..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/SelectiveSyncConfigurationsUsageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SelectiveSyncConfigurationsUsageEnum { - IN_NEXT_SYNC("IN_NEXT_SYNC"), - - IN_LAST_SYNC("IN_LAST_SYNC"); - - private final String value; - - SelectiveSyncConfigurationsUsageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/SyncStatus.java b/src/main/java/com/merge/api/resources/ats/types/SyncStatus.java deleted file mode 100644 index 4bb36a817..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/SyncStatus.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatus.Builder.class) -public final class SyncStatus { - private final String modelName; - - private final String modelId; - - private final Optional lastSyncStart; - - private final Optional nextSyncStart; - - private final SyncStatusStatusEnum status; - - private final boolean isInitialSync; - - private final Optional selectiveSyncConfigurationsUsage; - - private final Map additionalProperties; - - private SyncStatus( - String modelName, - String modelId, - Optional lastSyncStart, - Optional nextSyncStart, - SyncStatusStatusEnum status, - boolean isInitialSync, - Optional selectiveSyncConfigurationsUsage, - Map additionalProperties) { - this.modelName = modelName; - this.modelId = modelId; - this.lastSyncStart = lastSyncStart; - this.nextSyncStart = nextSyncStart; - this.status = status; - this.isInitialSync = isInitialSync; - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("last_sync_start") - public Optional getLastSyncStart() { - return lastSyncStart; - } - - @JsonProperty("next_sync_start") - public Optional getNextSyncStart() { - return nextSyncStart; - } - - @JsonProperty("status") - public SyncStatusStatusEnum getStatus() { - return status; - } - - @JsonProperty("is_initial_sync") - public boolean getIsInitialSync() { - return isInitialSync; - } - - @JsonProperty("selective_sync_configurations_usage") - public Optional getSelectiveSyncConfigurationsUsage() { - return selectiveSyncConfigurationsUsage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatus && equalTo((SyncStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatus other) { - return modelName.equals(other.modelName) - && modelId.equals(other.modelId) - && lastSyncStart.equals(other.lastSyncStart) - && nextSyncStart.equals(other.nextSyncStart) - && status.equals(other.status) - && isInitialSync == other.isInitialSync - && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, - this.modelId, - this.lastSyncStart, - this.nextSyncStart, - this.status, - this.isInitialSync, - this.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - ModelIdStage modelName(@NotNull String modelName); - - Builder from(SyncStatus other); - } - - public interface ModelIdStage { - StatusStage modelId(@NotNull String modelId); - } - - public interface StatusStage { - IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status); - } - - public interface IsInitialSyncStage { - _FinalStage isInitialSync(boolean isInitialSync); - } - - public interface _FinalStage { - SyncStatus build(); - - _FinalStage lastSyncStart(Optional lastSyncStart); - - _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); - - _FinalStage nextSyncStart(Optional nextSyncStart); - - _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); - - _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage); - - _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { - private String modelName; - - private String modelId; - - private SyncStatusStatusEnum status; - - private boolean isInitialSync; - - private Optional selectiveSyncConfigurationsUsage = Optional.empty(); - - private Optional nextSyncStart = Optional.empty(); - - private Optional lastSyncStart = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(SyncStatus other) { - modelName(other.getModelName()); - modelId(other.getModelId()); - lastSyncStart(other.getLastSyncStart()); - nextSyncStart(other.getNextSyncStart()); - status(other.getStatus()); - isInitialSync(other.getIsInitialSync()); - selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public ModelIdStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public StatusStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("is_initial_sync") - public _FinalStage isInitialSync(boolean isInitialSync) { - this.isInitialSync = isInitialSync; - return this; - } - - @java.lang.Override - public _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) - public _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - return this; - } - - @java.lang.Override - public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { - this.nextSyncStart = Optional.ofNullable(nextSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) - public _FinalStage nextSyncStart(Optional nextSyncStart) { - this.nextSyncStart = nextSyncStart; - return this; - } - - @java.lang.Override - public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { - this.lastSyncStart = Optional.ofNullable(lastSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) - public _FinalStage lastSyncStart(Optional lastSyncStart) { - this.lastSyncStart = lastSyncStart; - return this; - } - - @java.lang.Override - public SyncStatus build() { - return new SyncStatus( - modelName, - modelId, - lastSyncStart, - nextSyncStart, - status, - isInitialSync, - selectiveSyncConfigurationsUsage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/api/resources/ats/types/SyncStatusStatusEnum.java deleted file mode 100644 index b65741a63..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/SyncStatusStatusEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SyncStatusStatusEnum { - SYNCING("SYNCING"), - - DONE("DONE"), - - FAILED("FAILED"), - - DISABLED("DISABLED"), - - PAUSED("PAUSED"), - - PARTIALLY_SYNCED("PARTIALLY_SYNCED"); - - private final String value; - - SyncStatusStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/Tag.java b/src/main/java/com/merge/api/resources/ats/types/Tag.java deleted file mode 100644 index b7aafc07b..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/Tag.java +++ /dev/null @@ -1,274 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Tag.Builder.class) -public final class Tag { - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional>>> remoteData; - - private final Map additionalProperties; - - private Tag( - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional>>> remoteData, - Map additionalProperties) { - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The tag's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional>>> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Tag && equalTo((Tag) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Tag other) { - return remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional>>> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Tag other) { - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional>>> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List>> remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Tag build() { - return new Tag( - remoteId, - createdAt, - modifiedAt, - name, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/UrlRequestUrlType.java b/src/main/java/com/merge/api/resources/ats/types/UrlRequestUrlType.java deleted file mode 100644 index 26f611800..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/UrlRequestUrlType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = UrlRequestUrlType.Deserializer.class) -public final class UrlRequestUrlType { - private final Object value; - - private final int type; - - private UrlRequestUrlType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((UrlTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UrlRequestUrlType && equalTo((UrlRequestUrlType) other); - } - - private boolean equalTo(UrlRequestUrlType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static UrlRequestUrlType of(UrlTypeEnum value) { - return new UrlRequestUrlType(value, 0); - } - - public static UrlRequestUrlType of(String value) { - return new UrlRequestUrlType(value, 1); - } - - public interface Visitor { - T visit(UrlTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(UrlRequestUrlType.class); - } - - @java.lang.Override - public UrlRequestUrlType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, UrlTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/UrlUrlType.java b/src/main/java/com/merge/api/resources/ats/types/UrlUrlType.java deleted file mode 100644 index debf6dafb..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/UrlUrlType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = UrlUrlType.Deserializer.class) -public final class UrlUrlType { - private final Object value; - - private final int type; - - private UrlUrlType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((UrlTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UrlUrlType && equalTo((UrlUrlType) other); - } - - private boolean equalTo(UrlUrlType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static UrlUrlType of(UrlTypeEnum value) { - return new UrlUrlType(value, 0); - } - - public static UrlUrlType of(String value) { - return new UrlUrlType(value, 1); - } - - public interface Visitor { - T visit(UrlTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(UrlUrlType.class); - } - - @java.lang.Override - public UrlUrlType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, UrlTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/ValidationProblemSource.java b/src/main/java/com/merge/api/resources/ats/types/ValidationProblemSource.java deleted file mode 100644 index 136a5c363..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/ValidationProblemSource.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ValidationProblemSource.Builder.class) -public final class ValidationProblemSource { - private final String pointer; - - private final Map additionalProperties; - - private ValidationProblemSource(String pointer, Map additionalProperties) { - this.pointer = pointer; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("pointer") - public String getPointer() { - return pointer; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidationProblemSource other) { - return pointer.equals(other.pointer); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.pointer); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PointerStage builder() { - return new Builder(); - } - - public interface PointerStage { - _FinalStage pointer(@NotNull String pointer); - - Builder from(ValidationProblemSource other); - } - - public interface _FinalStage { - ValidationProblemSource build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PointerStage, _FinalStage { - private String pointer; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ValidationProblemSource other) { - pointer(other.getPointer()); - return this; - } - - @java.lang.Override - @JsonSetter("pointer") - public _FinalStage pointer(@NotNull String pointer) { - this.pointer = pointer; - return this; - } - - @java.lang.Override - public ValidationProblemSource build() { - return new ValidationProblemSource(pointer, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/WarningValidationProblem.java b/src/main/java/com/merge/api/resources/ats/types/WarningValidationProblem.java deleted file mode 100644 index e0b91d3a4..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/WarningValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WarningValidationProblem.Builder.class) -public final class WarningValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private WarningValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WarningValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(WarningValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - WarningValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WarningValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public WarningValidationProblem build() { - return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/types/WebhookReceiver.java b/src/main/java/com/merge/api/resources/ats/types/WebhookReceiver.java deleted file mode 100644 index 823b12855..000000000 --- a/src/main/java/com/merge/api/resources/ats/types/WebhookReceiver.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiver.Builder.class) -public final class WebhookReceiver { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiver( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiver other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiver other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiver build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiver other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiver build() { - return new WebhookReceiver(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/users/UsersClient.java b/src/main/java/com/merge/api/resources/ats/users/UsersClient.java deleted file mode 100644 index a42894714..000000000 --- a/src/main/java/com/merge/api/resources/ats/users/UsersClient.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.users; - -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.ats.types.PaginatedRemoteUserList; -import com.merge.api.resources.ats.types.RemoteUser; -import com.merge.api.resources.ats.users.requests.UsersListRequest; -import com.merge.api.resources.ats.users.requests.UsersRetrieveRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class UsersClient { - protected final ClientOptions clientOptions; - - public UsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of RemoteUser objects. - */ - public PaginatedRemoteUserList list() { - return list(UsersListRequest.builder().build()); - } - - /** - * Returns a list of RemoteUser objects. - */ - public PaginatedRemoteUserList list(UsersListRequest request) { - return list(request, null); - } - - /** - * Returns a list of RemoteUser objects. - */ - public PaginatedRemoteUserList list(UsersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/users"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmail().isPresent()) { - httpUrl.addQueryParameter("email", request.getEmail().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteUserList.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); - } - } - - /** - * Returns a RemoteUser object with the given id. - */ - public RemoteUser retrieve(String id) { - return retrieve(id, UsersRetrieveRequest.builder().build()); - } - - /** - * Returns a RemoteUser object with the given id. - */ - public RemoteUser retrieve(String id, UsersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a RemoteUser object with the given id. - */ - public RemoteUser retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/users") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RemoteUser.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/users/requests/UsersListRequest.java b/src/main/java/com/merge/api/resources/ats/users/requests/UsersListRequest.java deleted file mode 100644 index 4bfc85daa..000000000 --- a/src/main/java/com/merge/api/resources/ats/users/requests/UsersListRequest.java +++ /dev/null @@ -1,452 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersListRequest.Builder.class) -public final class UsersListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional email; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteFields; - - private final Optional remoteId; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private UsersListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional email, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteFields, - Optional remoteId, - Optional showEnumOrigins, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.email = email; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteFields = remoteFields; - this.remoteId = remoteId; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return remote users with the given email address - */ - @JsonProperty("email") - public Optional getEmail() { - return email; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersListRequest && equalTo((UsersListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && email.equals(other.email) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteFields.equals(other.remoteFields) - && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.email, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteFields, - this.remoteId, - this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional email = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - email(other.getEmail()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteFields(other.getRemoteFields()); - remoteId(other.getRemoteId()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "email", nulls = Nulls.SKIP) - public Builder email(Optional email) { - this.email = email; - return this; - } - - public Builder email(String email) { - this.email = Optional.ofNullable(email); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public UsersListRequest build() { - return new UsersListRequest( - createdAfter, - createdBefore, - cursor, - email, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteFields, - remoteId, - showEnumOrigins, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/api/resources/ats/users/requests/UsersRetrieveRequest.java deleted file mode 100644 index 7ec77bfcf..000000000 --- a/src/main/java/com/merge/api/resources/ats/users/requests/UsersRetrieveRequest.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) -public final class UsersRetrieveRequest { - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private UsersRetrieveRequest( - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public UsersRetrieveRequest build() { - return new UsersRetrieveRequest(includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/api/resources/ats/webhookreceivers/WebhookReceiversClient.java deleted file mode 100644 index 439cc71b3..000000000 --- a/src/main/java/com/merge/api/resources/ats/webhookreceivers/WebhookReceiversClient.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.webhookreceivers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ats.types.WebhookReceiver; -import com.merge.api.resources.ats.webhookreceivers.requests.WebhookReceiverRequest; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class WebhookReceiversClient { - protected final ClientOptions clientOptions; - - public WebhookReceiversClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list() { - return list(null); - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/webhook-receivers") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request) { - return create(request, null); - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ats/v1/webhook-receivers") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), WebhookReceiver.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ats/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/api/resources/ats/webhookreceivers/requests/WebhookReceiverRequest.java deleted file mode 100644 index 612c1d068..000000000 --- a/src/main/java/com/merge/api/resources/ats/webhookreceivers/requests/WebhookReceiverRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ats.webhookreceivers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) -public final class WebhookReceiverRequest { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiverRequest( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiverRequest other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiverRequest other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiverRequest build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiverRequest other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiverRequest build() { - return new WebhookReceiverRequest(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/api/resources/crm/accountdetails/AccountDetailsClient.java deleted file mode 100644 index 8df39fde2..000000000 --- a/src/main/java/com/merge/api/resources/crm/accountdetails/AccountDetailsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.accountdetails; - -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.crm.types.AccountDetails; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountDetailsClient { - protected final ClientOptions clientOptions; - - public AccountDetailsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve() { - return retrieve(null); - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/account-details") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountDetails.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/accounts/AccountsClient.java b/src/main/java/com/merge/api/resources/crm/accounts/AccountsClient.java deleted file mode 100644 index de3b80c7d..000000000 --- a/src/main/java/com/merge/api/resources/crm/accounts/AccountsClient.java +++ /dev/null @@ -1,473 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.accounts; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.accounts.requests.AccountsListRequest; -import com.merge.api.resources.crm.accounts.requests.AccountsRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.accounts.requests.AccountsRetrieveRequest; -import com.merge.api.resources.crm.accounts.requests.CrmAccountEndpointRequest; -import com.merge.api.resources.crm.accounts.requests.PatchedCrmAccountEndpointRequest; -import com.merge.api.resources.crm.types.Account; -import com.merge.api.resources.crm.types.CrmAccountResponse; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.PaginatedAccountList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountsClient { - protected final ClientOptions clientOptions; - - public AccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list() { - return list(AccountsListRequest.builder().build()); - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list(AccountsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list(AccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/accounts"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getName().isPresent()) { - httpUrl.addQueryParameter("name", request.getName().get()); - } - if (request.getOwnerId().isPresent()) { - httpUrl.addQueryParameter("owner_id", request.getOwnerId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountList.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); - } - } - - /** - * Creates an Account object with the given values. - */ - public CrmAccountResponse create(CrmAccountEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Account object with the given values. - */ - public CrmAccountResponse create(CrmAccountEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/accounts"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CrmAccountResponse.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); - } - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id) { - return retrieve(id, AccountsRetrieveRequest.builder().build()); - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id, AccountsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/accounts") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Account.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); - } - } - - /** - * Updates an Account object with the given id. - */ - public CrmAccountResponse partialUpdate(String id, PatchedCrmAccountEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates an Account object with the given id. - */ - public CrmAccountResponse partialUpdate( - String id, PatchedCrmAccountEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/accounts") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CrmAccountResponse.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); - } - } - - /** - * Returns metadata for CRMAccount PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for CRMAccount PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/accounts/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for CRMAccount POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for CRMAccount POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/accounts/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - AccountsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(AccountsRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - AccountsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/accounts/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsListRequest.java b/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsListRequest.java deleted file mode 100644 index 90e50a90b..000000000 --- a/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsListRequest.java +++ /dev/null @@ -1,481 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.accounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsListRequest.Builder.class) -public final class AccountsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional name; - - private final Optional ownerId; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private AccountsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeRemoteFields, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional name, - Optional ownerId, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.name = name; - this.ownerId = ownerId; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return If provided, will only return accounts with this name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return If provided, will only return accounts with this owner. - */ - @JsonProperty("owner_id") - public Optional getOwnerId() { - return ownerId; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && name.equals(other.name) - && ownerId.equals(other.ownerId) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeRemoteFields, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.name, - this.ownerId, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional ownerId = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - name(other.getName()); - ownerId(other.getOwnerId()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "owner_id", nulls = Nulls.SKIP) - public Builder ownerId(Optional ownerId) { - this.ownerId = ownerId; - return this; - } - - public Builder ownerId(String ownerId) { - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public AccountsListRequest build() { - return new AccountsListRequest( - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - modifiedAfter, - modifiedBefore, - name, - ownerId, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsRetrieveRequest.java deleted file mode 100644 index bdeff3e2a..000000000 --- a/src/main/java/com/merge/api/resources/crm/accounts/requests/AccountsRetrieveRequest.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.accounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) -public final class AccountsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private AccountsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public AccountsRetrieveRequest build() { - return new AccountsRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/api/resources/crm/accounttoken/AccountTokenClient.java deleted file mode 100644 index b1bbba148..000000000 --- a/src/main/java/com/merge/api/resources/crm/accounttoken/AccountTokenClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.accounttoken; - -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.crm.types.AccountToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountTokenClient { - protected final ClientOptions clientOptions; - - public AccountTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken) { - return retrieve(publicToken, null); - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/account-token") - .addPathSegment(publicToken) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/associations/AssociationsClient.java b/src/main/java/com/merge/api/resources/crm/associations/AssociationsClient.java deleted file mode 100644 index 803d57942..000000000 --- a/src/main/java/com/merge/api/resources/crm/associations/AssociationsClient.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.associations; - -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.crm.associations.requests.CustomObjectClassesCustomObjectsAssociationsListRequest; -import com.merge.api.resources.crm.associations.requests.CustomObjectClassesCustomObjectsAssociationsUpdateRequest; -import com.merge.api.resources.crm.types.Association; -import com.merge.api.resources.crm.types.PaginatedAssociationList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AssociationsClient { - protected final ClientOptions clientOptions; - - public AssociationsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Association objects. - */ - public PaginatedAssociationList customObjectClassesCustomObjectsAssociationsList( - String customObjectClassId, String objectId) { - return customObjectClassesCustomObjectsAssociationsList( - customObjectClassId, - objectId, - CustomObjectClassesCustomObjectsAssociationsListRequest.builder() - .build()); - } - - /** - * Returns a list of Association objects. - */ - public PaginatedAssociationList customObjectClassesCustomObjectsAssociationsList( - String customObjectClassId, - String objectId, - CustomObjectClassesCustomObjectsAssociationsListRequest request) { - return customObjectClassesCustomObjectsAssociationsList(customObjectClassId, objectId, request, null); - } - - /** - * Returns a list of Association objects. - */ - public PaginatedAssociationList customObjectClassesCustomObjectsAssociationsList( - String customObjectClassId, - String objectId, - CustomObjectClassesCustomObjectsAssociationsListRequest request, - RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("custom-objects") - .addPathSegment(objectId) - .addPathSegments("associations"); - if (request.getAssociationTypeId().isPresent()) { - httpUrl.addQueryParameter( - "association_type_id", request.getAssociationTypeId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAssociationList.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); - } - } - - /** - * Creates an Association between source_object_id and target_object_id of type association_type_id. - */ - public Association customObjectClassesCustomObjectsAssociationsUpdate( - String associationTypeId, - String sourceClassId, - String sourceObjectId, - String targetClassId, - String targetObjectId) { - return customObjectClassesCustomObjectsAssociationsUpdate( - associationTypeId, - sourceClassId, - sourceObjectId, - targetClassId, - targetObjectId, - CustomObjectClassesCustomObjectsAssociationsUpdateRequest.builder() - .build()); - } - - /** - * Creates an Association between source_object_id and target_object_id of type association_type_id. - */ - public Association customObjectClassesCustomObjectsAssociationsUpdate( - String associationTypeId, - String sourceClassId, - String sourceObjectId, - String targetClassId, - String targetObjectId, - CustomObjectClassesCustomObjectsAssociationsUpdateRequest request) { - return customObjectClassesCustomObjectsAssociationsUpdate( - associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId, request, null); - } - - /** - * Creates an Association between source_object_id and target_object_id of type association_type_id. - */ - public Association customObjectClassesCustomObjectsAssociationsUpdate( - String associationTypeId, - String sourceClassId, - String sourceObjectId, - String targetClassId, - String targetObjectId, - CustomObjectClassesCustomObjectsAssociationsUpdateRequest request, - RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(sourceClassId) - .addPathSegments("custom-objects") - .addPathSegment(sourceObjectId) - .addPathSegments("associations") - .addPathSegment(targetClassId) - .addPathSegment(targetObjectId) - .addPathSegment(associationTypeId); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Association.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/associationtypes/AssociationTypesClient.java b/src/main/java/com/merge/api/resources/crm/associationtypes/AssociationTypesClient.java deleted file mode 100644 index 145c5ae89..000000000 --- a/src/main/java/com/merge/api/resources/crm/associationtypes/AssociationTypesClient.java +++ /dev/null @@ -1,301 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.associationtypes; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.associationtypes.requests.CrmAssociationTypeEndpointRequest; -import com.merge.api.resources.crm.associationtypes.requests.CustomObjectClassesAssociationTypesListRequest; -import com.merge.api.resources.crm.associationtypes.requests.CustomObjectClassesAssociationTypesRetrieveRequest; -import com.merge.api.resources.crm.types.AssociationType; -import com.merge.api.resources.crm.types.CrmAssociationTypeResponse; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.PaginatedAssociationTypeList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AssociationTypesClient { - protected final ClientOptions clientOptions; - - public AssociationTypesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of AssociationType objects. - */ - public PaginatedAssociationTypeList customObjectClassesAssociationTypesList(String customObjectClassId) { - return customObjectClassesAssociationTypesList( - customObjectClassId, - CustomObjectClassesAssociationTypesListRequest.builder().build()); - } - - /** - * Returns a list of AssociationType objects. - */ - public PaginatedAssociationTypeList customObjectClassesAssociationTypesList( - String customObjectClassId, CustomObjectClassesAssociationTypesListRequest request) { - return customObjectClassesAssociationTypesList(customObjectClassId, request, null); - } - - /** - * Returns a list of AssociationType objects. - */ - public PaginatedAssociationTypeList customObjectClassesAssociationTypesList( - String customObjectClassId, - CustomObjectClassesAssociationTypesListRequest request, - RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("association-types"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAssociationTypeList.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); - } - } - - /** - * Creates an AssociationType object with the given values. - */ - public CrmAssociationTypeResponse customObjectClassesAssociationTypesCreate( - String customObjectClassId, CrmAssociationTypeEndpointRequest request) { - return customObjectClassesAssociationTypesCreate(customObjectClassId, request, null); - } - - /** - * Creates an AssociationType object with the given values. - */ - public CrmAssociationTypeResponse customObjectClassesAssociationTypesCreate( - String customObjectClassId, CrmAssociationTypeEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("association-types"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CrmAssociationTypeResponse.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); - } - } - - /** - * Returns an AssociationType object with the given id. - */ - public AssociationType customObjectClassesAssociationTypesRetrieve(String customObjectClassId, String id) { - return customObjectClassesAssociationTypesRetrieve( - customObjectClassId, - id, - CustomObjectClassesAssociationTypesRetrieveRequest.builder().build()); - } - - /** - * Returns an AssociationType object with the given id. - */ - public AssociationType customObjectClassesAssociationTypesRetrieve( - String customObjectClassId, String id, CustomObjectClassesAssociationTypesRetrieveRequest request) { - return customObjectClassesAssociationTypesRetrieve(customObjectClassId, id, request, null); - } - - /** - * Returns an AssociationType object with the given id. - */ - public AssociationType customObjectClassesAssociationTypesRetrieve( - String customObjectClassId, - String id, - CustomObjectClassesAssociationTypesRetrieveRequest request, - RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("association-types") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), AssociationType.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); - } - } - - /** - * Returns metadata for CRMAssociationType POSTs. - */ - public MetaResponse customObjectClassesAssociationTypesMetaPostRetrieve(String customObjectClassId) { - return customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, null); - } - - /** - * Returns metadata for CRMAssociationType POSTs. - */ - public MetaResponse customObjectClassesAssociationTypesMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("association-types/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesRetrieveRequest.java deleted file mode 100644 index 9aa3d0894..000000000 --- a/src/main/java/com/merge/api/resources/crm/associationtypes/requests/CustomObjectClassesAssociationTypesRetrieveRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.associationtypes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CustomObjectClassesAssociationTypesRetrieveRequest.Builder.class) -public final class CustomObjectClassesAssociationTypesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private CustomObjectClassesAssociationTypesRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CustomObjectClassesAssociationTypesRetrieveRequest - && equalTo((CustomObjectClassesAssociationTypesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CustomObjectClassesAssociationTypesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CustomObjectClassesAssociationTypesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public CustomObjectClassesAssociationTypesRetrieveRequest build() { - return new CustomObjectClassesAssociationTypesRetrieveRequest( - expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/api/resources/crm/asyncpassthrough/AsyncPassthroughClient.java deleted file mode 100644 index e5f41a231..000000000 --- a/src/main/java/com/merge/api/resources/crm/asyncpassthrough/AsyncPassthroughClient.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.asyncpassthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; -import com.merge.api.resources.crm.types.AsyncPassthroughReciept; -import com.merge.api.resources.crm.types.DataPassthroughRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AsyncPassthroughClient { - protected final ClientOptions clientOptions; - - public AsyncPassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/async-passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), AsyncPassthroughReciept.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); - } - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/async-passthrough") - .addPathSegment(asyncPassthroughReceiptId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AsyncPassthroughRetrieveResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/resources/crm/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java deleted file mode 100644 index 1142a6bcb..000000000 --- a/src/main/java/com/merge/api/resources/crm/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.asyncpassthrough.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.RemoteResponse; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) -public final class AsyncPassthroughRetrieveResponse { - private final Object value; - - private final int type; - - private AsyncPassthroughRetrieveResponse(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RemoteResponse) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); - } - - private boolean equalTo(AsyncPassthroughRetrieveResponse other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { - return new AsyncPassthroughRetrieveResponse(value, 0); - } - - public static AsyncPassthroughRetrieveResponse of(String value) { - return new AsyncPassthroughRetrieveResponse(value, 1); - } - - public interface Visitor { - T visit(RemoteResponse value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AsyncPassthroughRetrieveResponse.class); - } - - @java.lang.Override - public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/audittrail/AuditTrailClient.java b/src/main/java/com/merge/api/resources/crm/audittrail/AuditTrailClient.java deleted file mode 100644 index 03b06c63e..000000000 --- a/src/main/java/com/merge/api/resources/crm/audittrail/AuditTrailClient.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.audittrail; - -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.crm.audittrail.requests.AuditTrailListRequest; -import com.merge.api.resources.crm.types.PaginatedAuditLogEventList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AuditTrailClient { - protected final ClientOptions clientOptions; - - public AuditTrailClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list() { - return list(AuditTrailListRequest.builder().build()); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request) { - return list(request, null); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/audit-trail"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEventType().isPresent()) { - httpUrl.addQueryParameter("event_type", request.getEventType().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getUserEmail().isPresent()) { - httpUrl.addQueryParameter("user_email", request.getUserEmail().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAuditLogEventList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/api/resources/crm/audittrail/requests/AuditTrailListRequest.java deleted file mode 100644 index 7a4fdb54e..000000000 --- a/src/main/java/com/merge/api/resources/crm/audittrail/requests/AuditTrailListRequest.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.audittrail.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) -public final class AuditTrailListRequest { - private final Optional cursor; - - private final Optional endDate; - - private final Optional eventType; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional userEmail; - - private final Map additionalProperties; - - private AuditTrailListRequest( - Optional cursor, - Optional endDate, - Optional eventType, - Optional pageSize, - Optional startDate, - Optional userEmail, - Map additionalProperties) { - this.cursor = cursor; - this.endDate = endDate; - this.eventType = eventType; - this.pageSize = pageSize; - this.startDate = startDate; - this.userEmail = userEmail; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include audit trail events that occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - /** - * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED - */ - @JsonProperty("event_type") - public Optional getEventType() { - return eventType; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include audit trail events that occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditTrailListRequest other) { - return cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && eventType.equals(other.eventType) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && userEmail.equals(other.userEmail); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional eventType = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AuditTrailListRequest other) { - cursor(other.getCursor()); - endDate(other.getEndDate()); - eventType(other.getEventType()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - userEmail(other.getUserEmail()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "event_type", nulls = Nulls.SKIP) - public Builder eventType(Optional eventType) { - this.eventType = eventType; - return this; - } - - public Builder eventType(String eventType) { - this.eventType = Optional.ofNullable(eventType); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public Builder userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - public Builder userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - public AuditTrailListRequest build() { - return new AuditTrailListRequest( - cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/api/resources/crm/availableactions/AvailableActionsClient.java deleted file mode 100644 index abef2ce0e..000000000 --- a/src/main/java/com/merge/api/resources/crm/availableactions/AvailableActionsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.availableactions; - -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.crm.types.AvailableActions; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AvailableActionsClient { - protected final ClientOptions clientOptions; - - public AvailableActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve() { - return retrieve(null); - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/available-actions") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AvailableActions.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/contacts/ContactsClient.java b/src/main/java/com/merge/api/resources/crm/contacts/ContactsClient.java deleted file mode 100644 index af8d47fdf..000000000 --- a/src/main/java/com/merge/api/resources/crm/contacts/ContactsClient.java +++ /dev/null @@ -1,527 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.contacts; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.contacts.requests.ContactsListRequest; -import com.merge.api.resources.crm.contacts.requests.ContactsRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.contacts.requests.ContactsRetrieveRequest; -import com.merge.api.resources.crm.contacts.requests.CrmContactEndpointRequest; -import com.merge.api.resources.crm.contacts.requests.PatchedCrmContactEndpointRequest; -import com.merge.api.resources.crm.types.Contact; -import com.merge.api.resources.crm.types.CrmContactResponse; -import com.merge.api.resources.crm.types.IgnoreCommonModelRequest; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.PaginatedContactList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ContactsClient { - protected final ClientOptions clientOptions; - - public ContactsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list() { - return list(ContactsListRequest.builder().build()); - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list(ContactsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list(ContactsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts"); - if (request.getAccountId().isPresent()) { - httpUrl.addQueryParameter("account_id", request.getAccountId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmailAddresses().isPresent()) { - httpUrl.addQueryParameter( - "email_addresses", request.getEmailAddresses().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getPhoneNumbers().isPresent()) { - httpUrl.addQueryParameter("phone_numbers", request.getPhoneNumbers().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedContactList.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); - } - } - - /** - * Creates a Contact object with the given values. - */ - public CrmContactResponse create(CrmContactEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Contact object with the given values. - */ - public CrmContactResponse create(CrmContactEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CrmContactResponse.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); - } - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id) { - return retrieve(id, ContactsRetrieveRequest.builder().build()); - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id, ContactsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Contact.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); - } - } - - /** - * Updates a Contact object with the given id. - */ - public CrmContactResponse partialUpdate(String id, PatchedCrmContactEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates a Contact object with the given id. - */ - public CrmContactResponse partialUpdate( - String id, PatchedCrmContactEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CrmContactResponse.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); - } - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { - ignoreCreate(modelId, request, null); - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts/ignore") - .addPathSegment(modelId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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; - } - 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); - } - } - - /** - * Returns metadata for CRMContact PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for CRMContact PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for CRMContact POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for CRMContact POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - ContactsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(ContactsRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - ContactsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/contacts/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsListRequest.java b/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsListRequest.java deleted file mode 100644 index adb2099b0..000000000 --- a/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsListRequest.java +++ /dev/null @@ -1,511 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.contacts.types.ContactsListRequestExpand; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsListRequest.Builder.class) -public final class ContactsListRequest { - private final Optional accountId; - - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional emailAddresses; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional phoneNumbers; - - private final Optional remoteId; - - private final Map additionalProperties; - - private ContactsListRequest( - Optional accountId, - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional emailAddresses, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeRemoteFields, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional phoneNumbers, - Optional remoteId, - Map additionalProperties) { - this.accountId = accountId; - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.emailAddresses = emailAddresses; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.phoneNumbers = phoneNumbers; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return contacts with this account. - */ - @JsonProperty("account_id") - public Optional getAccountId() { - return accountId; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. - */ - @JsonProperty("email_addresses") - public Optional getEmailAddresses() { - return emailAddresses; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas. - */ - @JsonProperty("phone_numbers") - public Optional getPhoneNumbers() { - return phoneNumbers; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsListRequest && equalTo((ContactsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsListRequest other) { - return accountId.equals(other.accountId) - && createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && emailAddresses.equals(other.emailAddresses) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && phoneNumbers.equals(other.phoneNumbers) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountId, - this.createdAfter, - this.createdBefore, - this.cursor, - this.emailAddresses, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeRemoteFields, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.phoneNumbers, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountId = Optional.empty(); - - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional emailAddresses = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional phoneNumbers = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsListRequest other) { - accountId(other.getAccountId()); - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - emailAddresses(other.getEmailAddresses()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - phoneNumbers(other.getPhoneNumbers()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "account_id", nulls = Nulls.SKIP) - public Builder accountId(Optional accountId) { - this.accountId = accountId; - return this; - } - - public Builder accountId(String accountId) { - this.accountId = Optional.ofNullable(accountId); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "email_addresses", nulls = Nulls.SKIP) - public Builder emailAddresses(Optional emailAddresses) { - this.emailAddresses = emailAddresses; - return this; - } - - public Builder emailAddresses(String emailAddresses) { - this.emailAddresses = Optional.ofNullable(emailAddresses); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ContactsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - public Builder phoneNumbers(String phoneNumbers) { - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public ContactsListRequest build() { - return new ContactsListRequest( - accountId, - createdAfter, - createdBefore, - cursor, - emailAddresses, - expand, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - phoneNumbers, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsRemoteFieldClassesListRequest.java deleted file mode 100644 index aeb745972..000000000 --- a/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsRemoteFieldClassesListRequest.java +++ /dev/null @@ -1,278 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsRemoteFieldClassesListRequest.Builder.class) -public final class ContactsRemoteFieldClassesListRequest { - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Optional includeShellData; - - private final Optional isCommonModelField; - - private final Optional pageSize; - - private final Map additionalProperties; - - private ContactsRemoteFieldClassesListRequest( - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeRemoteFields, - Optional includeShellData, - Optional isCommonModelField, - Optional pageSize, - Map additionalProperties) { - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.includeShellData = includeShellData; - this.isCommonModelField = isCommonModelField; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, will only return remote field classes with this is_common_model_field value - */ - @JsonProperty("is_common_model_field") - public Optional getIsCommonModelField() { - return isCommonModelField; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsRemoteFieldClassesListRequest - && equalTo((ContactsRemoteFieldClassesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsRemoteFieldClassesListRequest other) { - return cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields) - && includeShellData.equals(other.includeShellData) - && isCommonModelField.equals(other.isCommonModelField) - && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeRemoteFields, - this.includeShellData, - this.isCommonModelField, - this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional isCommonModelField = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsRemoteFieldClassesListRequest other) { - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - includeShellData(other.getIncludeShellData()); - isCommonModelField(other.getIsCommonModelField()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) - public Builder isCommonModelField(Optional isCommonModelField) { - this.isCommonModelField = isCommonModelField; - return this; - } - - public Builder isCommonModelField(Boolean isCommonModelField) { - this.isCommonModelField = Optional.ofNullable(isCommonModelField); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public ContactsRemoteFieldClassesListRequest build() { - return new ContactsRemoteFieldClassesListRequest( - cursor, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - isCommonModelField, - pageSize, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsRetrieveRequest.java deleted file mode 100644 index 420058c7f..000000000 --- a/src/main/java/com/merge/api/resources/crm/contacts/requests/ContactsRetrieveRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.contacts.types.ContactsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsRetrieveRequest.Builder.class) -public final class ContactsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private ContactsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsRetrieveRequest && equalTo((ContactsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(ContactsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public ContactsRetrieveRequest build() { - return new ContactsRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/contacts/types/ContactsListRequestExpand.java b/src/main/java/com/merge/api/resources/crm/contacts/types/ContactsListRequestExpand.java deleted file mode 100644 index 610e19be7..000000000 --- a/src/main/java/com/merge/api/resources/crm/contacts/types/ContactsListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.contacts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ContactsListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_OWNER("account,owner"), - - OWNER("owner"); - - private final String value; - - ContactsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/contacts/types/ContactsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/crm/contacts/types/ContactsRetrieveRequestExpand.java deleted file mode 100644 index ceecee706..000000000 --- a/src/main/java/com/merge/api/resources/crm/contacts/types/ContactsRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.contacts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ContactsRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_OWNER("account,owner"), - - OWNER("owner"); - - private final String value; - - ContactsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/customobjectclasses/CustomObjectClassesClient.java b/src/main/java/com/merge/api/resources/crm/customobjectclasses/CustomObjectClassesClient.java deleted file mode 100644 index 3984e41c6..000000000 --- a/src/main/java/com/merge/api/resources/crm/customobjectclasses/CustomObjectClassesClient.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.customobjectclasses; - -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.crm.customobjectclasses.requests.CustomObjectClassesListRequest; -import com.merge.api.resources.crm.customobjectclasses.requests.CustomObjectClassesRetrieveRequest; -import com.merge.api.resources.crm.types.CustomObjectClass; -import com.merge.api.resources.crm.types.PaginatedCustomObjectClassList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CustomObjectClassesClient { - protected final ClientOptions clientOptions; - - public CustomObjectClassesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of CustomObjectClass objects. - */ - public PaginatedCustomObjectClassList list() { - return list(CustomObjectClassesListRequest.builder().build()); - } - - /** - * Returns a list of CustomObjectClass objects. - */ - public PaginatedCustomObjectClassList list(CustomObjectClassesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of CustomObjectClass objects. - */ - public PaginatedCustomObjectClassList list(CustomObjectClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCustomObjectClassList.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); - } - } - - /** - * Returns a CustomObjectClass object with the given id. - */ - public CustomObjectClass retrieve(String id) { - return retrieve(id, CustomObjectClassesRetrieveRequest.builder().build()); - } - - /** - * Returns a CustomObjectClass object with the given id. - */ - public CustomObjectClass retrieve(String id, CustomObjectClassesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a CustomObjectClass object with the given id. - */ - public CustomObjectClass retrieve( - String id, CustomObjectClassesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CustomObjectClass.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/customobjectclasses/requests/CustomObjectClassesRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/customobjectclasses/requests/CustomObjectClassesRetrieveRequest.java deleted file mode 100644 index 1a029bafd..000000000 --- a/src/main/java/com/merge/api/resources/crm/customobjectclasses/requests/CustomObjectClassesRetrieveRequest.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.customobjectclasses.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CustomObjectClassesRetrieveRequest.Builder.class) -public final class CustomObjectClassesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private CustomObjectClassesRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CustomObjectClassesRetrieveRequest - && equalTo((CustomObjectClassesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CustomObjectClassesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CustomObjectClassesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public CustomObjectClassesRetrieveRequest build() { - return new CustomObjectClassesRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/customobjects/CustomObjectsClient.java b/src/main/java/com/merge/api/resources/crm/customobjects/CustomObjectsClient.java deleted file mode 100644 index 5905653a2..000000000 --- a/src/main/java/com/merge/api/resources/crm/customobjects/CustomObjectsClient.java +++ /dev/null @@ -1,387 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.customobjects; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.customobjects.requests.CrmCustomObjectEndpointRequest; -import com.merge.api.resources.crm.customobjects.requests.CustomObjectClassesCustomObjectsListRequest; -import com.merge.api.resources.crm.customobjects.requests.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.customobjects.requests.CustomObjectClassesCustomObjectsRetrieveRequest; -import com.merge.api.resources.crm.types.CrmCustomObjectResponse; -import com.merge.api.resources.crm.types.CustomObject; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.PaginatedCustomObjectList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CustomObjectsClient { - protected final ClientOptions clientOptions; - - public CustomObjectsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of CustomObject objects. - */ - public PaginatedCustomObjectList customObjectClassesCustomObjectsList(String customObjectClassId) { - return customObjectClassesCustomObjectsList( - customObjectClassId, - CustomObjectClassesCustomObjectsListRequest.builder().build()); - } - - /** - * Returns a list of CustomObject objects. - */ - public PaginatedCustomObjectList customObjectClassesCustomObjectsList( - String customObjectClassId, CustomObjectClassesCustomObjectsListRequest request) { - return customObjectClassesCustomObjectsList(customObjectClassId, request, null); - } - - /** - * Returns a list of CustomObject objects. - */ - public PaginatedCustomObjectList customObjectClassesCustomObjectsList( - String customObjectClassId, - CustomObjectClassesCustomObjectsListRequest request, - RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("custom-objects"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCustomObjectList.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); - } - } - - /** - * Creates a CustomObject object with the given values. - */ - public CrmCustomObjectResponse customObjectClassesCustomObjectsCreate( - String customObjectClassId, CrmCustomObjectEndpointRequest request) { - return customObjectClassesCustomObjectsCreate(customObjectClassId, request, null); - } - - /** - * Creates a CustomObject object with the given values. - */ - public CrmCustomObjectResponse customObjectClassesCustomObjectsCreate( - String customObjectClassId, CrmCustomObjectEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("custom-objects"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CrmCustomObjectResponse.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); - } - } - - /** - * Returns a CustomObject object with the given id. - */ - public CustomObject customObjectClassesCustomObjectsRetrieve(String customObjectClassId, String id) { - return customObjectClassesCustomObjectsRetrieve( - customObjectClassId, - id, - CustomObjectClassesCustomObjectsRetrieveRequest.builder().build()); - } - - /** - * Returns a CustomObject object with the given id. - */ - public CustomObject customObjectClassesCustomObjectsRetrieve( - String customObjectClassId, String id, CustomObjectClassesCustomObjectsRetrieveRequest request) { - return customObjectClassesCustomObjectsRetrieve(customObjectClassId, id, request, null); - } - - /** - * Returns a CustomObject object with the given id. - */ - public CustomObject customObjectClassesCustomObjectsRetrieve( - String customObjectClassId, - String id, - CustomObjectClassesCustomObjectsRetrieveRequest request, - RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("custom-objects") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CustomObject.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); - } - } - - /** - * Returns metadata for CRMCustomObject POSTs. - */ - public MetaResponse customObjectClassesCustomObjectsMetaPostRetrieve(String customObjectClassId) { - return customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, null); - } - - /** - * Returns metadata for CRMCustomObject POSTs. - */ - public MetaResponse customObjectClassesCustomObjectsMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes") - .addPathSegment(customObjectClassId) - .addPathSegments("custom-objects/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList customObjectClassesCustomObjectsRemoteFieldClassesList() { - return customObjectClassesCustomObjectsRemoteFieldClassesList( - CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() - .build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList customObjectClassesCustomObjectsRemoteFieldClassesList( - CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request) { - return customObjectClassesCustomObjectsRemoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList customObjectClassesCustomObjectsRemoteFieldClassesList( - CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/custom-object-classes/custom-objects/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/api/resources/crm/deleteaccount/DeleteAccountClient.java deleted file mode 100644 index 4742cea8a..000000000 --- a/src/main/java/com/merge/api/resources/crm/deleteaccount/DeleteAccountClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.deleteaccount; - -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 java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DeleteAccountClient { - protected final ClientOptions clientOptions; - - public DeleteAccountClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Delete a linked account. - */ - public void delete() { - delete(null); - } - - /** - * Delete a linked account. - */ - public void delete(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/delete-account") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .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; - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/engagements/EngagementsClient.java b/src/main/java/com/merge/api/resources/crm/engagements/EngagementsClient.java deleted file mode 100644 index 90d90bc21..000000000 --- a/src/main/java/com/merge/api/resources/crm/engagements/EngagementsClient.java +++ /dev/null @@ -1,475 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.engagements; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.engagements.requests.EngagementEndpointRequest; -import com.merge.api.resources.crm.engagements.requests.EngagementsListRequest; -import com.merge.api.resources.crm.engagements.requests.EngagementsRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.engagements.requests.EngagementsRetrieveRequest; -import com.merge.api.resources.crm.engagements.requests.PatchedEngagementEndpointRequest; -import com.merge.api.resources.crm.types.Engagement; -import com.merge.api.resources.crm.types.EngagementResponse; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.PaginatedEngagementList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EngagementsClient { - protected final ClientOptions clientOptions; - - public EngagementsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Engagement objects. - */ - public PaginatedEngagementList list() { - return list(EngagementsListRequest.builder().build()); - } - - /** - * Returns a list of Engagement objects. - */ - public PaginatedEngagementList list(EngagementsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Engagement objects. - */ - public PaginatedEngagementList list(EngagementsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagements"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getStartedAfter().isPresent()) { - httpUrl.addQueryParameter( - "started_after", request.getStartedAfter().get().toString()); - } - if (request.getStartedBefore().isPresent()) { - httpUrl.addQueryParameter( - "started_before", request.getStartedBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEngagementList.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); - } - } - - /** - * Creates an Engagement object with the given values. - */ - public EngagementResponse create(EngagementEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Engagement object with the given values. - */ - public EngagementResponse create(EngagementEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagements"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), EngagementResponse.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); - } - } - - /** - * Returns an Engagement object with the given id. - */ - public Engagement retrieve(String id) { - return retrieve(id, EngagementsRetrieveRequest.builder().build()); - } - - /** - * Returns an Engagement object with the given id. - */ - public Engagement retrieve(String id, EngagementsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Engagement object with the given id. - */ - public Engagement retrieve(String id, EngagementsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagements") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Engagement.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); - } - } - - /** - * Updates an Engagement object with the given id. - */ - public EngagementResponse partialUpdate(String id, PatchedEngagementEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates an Engagement object with the given id. - */ - public EngagementResponse partialUpdate( - String id, PatchedEngagementEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagements") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), EngagementResponse.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); - } - } - - /** - * Returns metadata for Engagement PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for Engagement PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagements/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for Engagement POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Engagement POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagements/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - EngagementsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(EngagementsRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - EngagementsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagements/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsRetrieveRequest.java deleted file mode 100644 index 8c10a3b9c..000000000 --- a/src/main/java/com/merge/api/resources/crm/engagements/requests/EngagementsRetrieveRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.engagements.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.engagements.types.EngagementsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EngagementsRetrieveRequest.Builder.class) -public final class EngagementsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private EngagementsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EngagementsRetrieveRequest && equalTo((EngagementsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EngagementsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EngagementsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EngagementsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public EngagementsRetrieveRequest build() { - return new EngagementsRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/engagements/types/EngagementsListRequestExpand.java b/src/main/java/com/merge/api/resources/crm/engagements/types/EngagementsListRequestExpand.java deleted file mode 100644 index 312834677..000000000 --- a/src/main/java/com/merge/api/resources/crm/engagements/types/EngagementsListRequestExpand.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.engagements.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EngagementsListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ENGAGEMENT_TYPE("account,engagement_type"), - - CONTACTS("contacts"), - - CONTACTS_ACCOUNT("contacts,account"), - - CONTACTS_ACCOUNT_ENGAGEMENT_TYPE("contacts,account,engagement_type"), - - CONTACTS_ENGAGEMENT_TYPE("contacts,engagement_type"), - - CONTACTS_OWNER("contacts,owner"), - - CONTACTS_OWNER_ACCOUNT("contacts,owner,account"), - - CONTACTS_OWNER_ACCOUNT_ENGAGEMENT_TYPE("contacts,owner,account,engagement_type"), - - CONTACTS_OWNER_ENGAGEMENT_TYPE("contacts,owner,engagement_type"), - - ENGAGEMENT_TYPE("engagement_type"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_ACCOUNT_ENGAGEMENT_TYPE("owner,account,engagement_type"), - - OWNER_ENGAGEMENT_TYPE("owner,engagement_type"); - - private final String value; - - EngagementsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/engagements/types/EngagementsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/crm/engagements/types/EngagementsRetrieveRequestExpand.java deleted file mode 100644 index 78f693e77..000000000 --- a/src/main/java/com/merge/api/resources/crm/engagements/types/EngagementsRetrieveRequestExpand.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.engagements.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EngagementsRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_ENGAGEMENT_TYPE("account,engagement_type"), - - CONTACTS("contacts"), - - CONTACTS_ACCOUNT("contacts,account"), - - CONTACTS_ACCOUNT_ENGAGEMENT_TYPE("contacts,account,engagement_type"), - - CONTACTS_ENGAGEMENT_TYPE("contacts,engagement_type"), - - CONTACTS_OWNER("contacts,owner"), - - CONTACTS_OWNER_ACCOUNT("contacts,owner,account"), - - CONTACTS_OWNER_ACCOUNT_ENGAGEMENT_TYPE("contacts,owner,account,engagement_type"), - - CONTACTS_OWNER_ENGAGEMENT_TYPE("contacts,owner,engagement_type"), - - ENGAGEMENT_TYPE("engagement_type"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_ACCOUNT_ENGAGEMENT_TYPE("owner,account,engagement_type"), - - OWNER_ENGAGEMENT_TYPE("owner,engagement_type"); - - private final String value; - - EngagementsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/engagementtypes/EngagementTypesClient.java b/src/main/java/com/merge/api/resources/crm/engagementtypes/EngagementTypesClient.java deleted file mode 100644 index 2ac6c7e4b..000000000 --- a/src/main/java/com/merge/api/resources/crm/engagementtypes/EngagementTypesClient.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.engagementtypes; - -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.crm.engagementtypes.requests.EngagementTypesListRequest; -import com.merge.api.resources.crm.engagementtypes.requests.EngagementTypesRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.engagementtypes.requests.EngagementTypesRetrieveRequest; -import com.merge.api.resources.crm.types.EngagementType; -import com.merge.api.resources.crm.types.PaginatedEngagementTypeList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EngagementTypesClient { - protected final ClientOptions clientOptions; - - public EngagementTypesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of EngagementType objects. - */ - public PaginatedEngagementTypeList list() { - return list(EngagementTypesListRequest.builder().build()); - } - - /** - * Returns a list of EngagementType objects. - */ - public PaginatedEngagementTypeList list(EngagementTypesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of EngagementType objects. - */ - public PaginatedEngagementTypeList list(EngagementTypesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagement-types"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEngagementTypeList.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); - } - } - - /** - * Returns an EngagementType object with the given id. - */ - public EngagementType retrieve(String id) { - return retrieve(id, EngagementTypesRetrieveRequest.builder().build()); - } - - /** - * Returns an EngagementType object with the given id. - */ - public EngagementType retrieve(String id, EngagementTypesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an EngagementType object with the given id. - */ - public EngagementType retrieve(String id, EngagementTypesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagement-types") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), EngagementType.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - EngagementTypesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(EngagementTypesRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - EngagementTypesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/engagement-types/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/api/resources/crm/fieldmapping/FieldMappingClient.java deleted file mode 100644 index 0ada00e54..000000000 --- a/src/main/java/com/merge/api/resources/crm/fieldmapping/FieldMappingClient.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.fieldmapping; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.fieldmapping.requests.CreateFieldMappingRequest; -import com.merge.api.resources.crm.fieldmapping.requests.FieldMappingsRetrieveRequest; -import com.merge.api.resources.crm.fieldmapping.requests.PatchedEditFieldMappingRequest; -import com.merge.api.resources.crm.fieldmapping.requests.RemoteFieldsRetrieveRequest; -import com.merge.api.resources.crm.types.ExternalTargetFieldApiResponse; -import com.merge.api.resources.crm.types.FieldMappingApiInstanceResponse; -import com.merge.api.resources.crm.types.FieldMappingInstanceResponse; -import com.merge.api.resources.crm.types.RemoteFieldApiResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FieldMappingClient { - protected final ClientOptions clientOptions; - - public FieldMappingClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { - return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { - return fieldMappingsRetrieve(request, null); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve( - FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingApiInstanceResponse.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); - } - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { - return fieldMappingsCreate(request, null); - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate( - CreateFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { - return fieldMappingsPartialUpdate( - fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request) { - return fieldMappingsPartialUpdate(fieldMappingId, request, null); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve() { - return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { - return remoteFieldsRetrieve(request, null); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve( - RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/remote-fields"); - if (request.getCommonModels().isPresent()) { - httpUrl.addQueryParameter("common_models", request.getCommonModels().get()); - } - if (request.getIncludeExampleValues().isPresent()) { - httpUrl.addQueryParameter( - "include_example_values", request.getIncludeExampleValues().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RemoteFieldApiResponse.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); - } - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve() { - return targetFieldsRetrieve(null); - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/target-fields") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), ExternalTargetFieldApiResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/CreateFieldMappingRequest.java deleted file mode 100644 index 3d04931aa..000000000 --- a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/CreateFieldMappingRequest.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) -public final class CreateFieldMappingRequest { - private final Optional excludeRemoteFieldMetadata; - - private final String targetFieldName; - - private final String targetFieldDescription; - - private final List remoteFieldTraversalPath; - - private final String remoteMethod; - - private final String remoteUrlPath; - - private final String commonModelName; - - private final Map additionalProperties; - - private CreateFieldMappingRequest( - Optional excludeRemoteFieldMetadata, - String targetFieldName, - String targetFieldDescription, - List remoteFieldTraversalPath, - String remoteMethod, - String remoteUrlPath, - String commonModelName, - Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.targetFieldName = targetFieldName; - this.targetFieldDescription = targetFieldDescription; - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.commonModelName = commonModelName; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - /** - * @return The name of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_name") - public String getTargetFieldName() { - return targetFieldName; - } - - /** - * @return The description of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_description") - public String getTargetFieldDescription() { - return targetFieldDescription; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public List getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public String getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public String getRemoteUrlPath() { - return remoteUrlPath; - } - - /** - * @return The name of the Common Model that the remote field corresponds to in a given category. - */ - @JsonProperty("common_model_name") - public String getCommonModelName() { - return commonModelName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateFieldMappingRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) - && targetFieldName.equals(other.targetFieldName) - && targetFieldDescription.equals(other.targetFieldDescription) - && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.excludeRemoteFieldMetadata, - this.targetFieldName, - this.targetFieldDescription, - this.remoteFieldTraversalPath, - this.remoteMethod, - this.remoteUrlPath, - this.commonModelName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TargetFieldNameStage builder() { - return new Builder(); - } - - public interface TargetFieldNameStage { - TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); - - Builder from(CreateFieldMappingRequest other); - } - - public interface TargetFieldDescriptionStage { - RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); - } - - public interface RemoteMethodStage { - RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); - } - - public interface RemoteUrlPathStage { - CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); - } - - public interface CommonModelNameStage { - _FinalStage commonModelName(@NotNull String commonModelName); - } - - public interface _FinalStage { - CreateFieldMappingRequest build(); - - _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); - - _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); - - _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); - - _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); - - _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements TargetFieldNameStage, - TargetFieldDescriptionStage, - RemoteMethodStage, - RemoteUrlPathStage, - CommonModelNameStage, - _FinalStage { - private String targetFieldName; - - private String targetFieldDescription; - - private String remoteMethod; - - private String remoteUrlPath; - - private String commonModelName; - - private List remoteFieldTraversalPath = new ArrayList<>(); - - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateFieldMappingRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - targetFieldName(other.getTargetFieldName()); - targetFieldDescription(other.getTargetFieldDescription()); - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - commonModelName(other.getCommonModelName()); - return this; - } - - /** - *

The name of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_name") - public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { - this.targetFieldName = targetFieldName; - return this; - } - - /** - *

The description of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_description") - public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { - this.targetFieldDescription = targetFieldDescription; - return this; - } - - /** - *

The method of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_method") - public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - /** - *

The path of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_url_path") - public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - /** - *

The name of the Common Model that the remote field corresponds to in a given category.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("common_model_name") - public _FinalStage commonModelName(@NotNull String commonModelName) { - this.commonModelName = commonModelName; - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.clear(); - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - @java.lang.Override - public CreateFieldMappingRequest build() { - return new CreateFieldMappingRequest( - excludeRemoteFieldMetadata, - targetFieldName, - targetFieldDescription, - remoteFieldTraversalPath, - remoteMethod, - remoteUrlPath, - commonModelName, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/FieldMappingsRetrieveRequest.java deleted file mode 100644 index ce1748dce..000000000 --- a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/FieldMappingsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) -public final class FieldMappingsRetrieveRequest { - private final Optional excludeRemoteFieldMetadata; - - private final Map additionalProperties; - - private FieldMappingsRetrieveRequest( - Optional excludeRemoteFieldMetadata, Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingsRetrieveRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingsRetrieveRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - return this; - } - - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - public FieldMappingsRetrieveRequest build() { - return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/PatchedEditFieldMappingRequest.java deleted file mode 100644 index a4fd0e222..000000000 --- a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/PatchedEditFieldMappingRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) -public final class PatchedEditFieldMappingRequest { - private final Optional> remoteFieldTraversalPath; - - private final Optional remoteMethod; - - private final Optional remoteUrlPath; - - private final Map additionalProperties; - - private PatchedEditFieldMappingRequest( - Optional> remoteFieldTraversalPath, - Optional remoteMethod, - Optional remoteUrlPath, - Map additionalProperties) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.additionalProperties = additionalProperties; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public Optional> getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public Optional getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public Optional getRemoteUrlPath() { - return remoteUrlPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> remoteFieldTraversalPath = Optional.empty(); - - private Optional remoteMethod = Optional.empty(); - - private Optional remoteUrlPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PatchedEditFieldMappingRequest other) { - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - return this; - } - - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - return this; - } - - public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); - return this; - } - - @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) - public Builder remoteMethod(Optional remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - public Builder remoteMethod(String remoteMethod) { - this.remoteMethod = Optional.ofNullable(remoteMethod); - return this; - } - - @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) - public Builder remoteUrlPath(Optional remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - public Builder remoteUrlPath(String remoteUrlPath) { - this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); - return this; - } - - public PatchedEditFieldMappingRequest build() { - return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/RemoteFieldsRetrieveRequest.java deleted file mode 100644 index 5d76b50c1..000000000 --- a/src/main/java/com/merge/api/resources/crm/fieldmapping/requests/RemoteFieldsRetrieveRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) -public final class RemoteFieldsRetrieveRequest { - private final Optional commonModels; - - private final Optional includeExampleValues; - - private final Map additionalProperties; - - private RemoteFieldsRetrieveRequest( - Optional commonModels, - Optional includeExampleValues, - Map additionalProperties) { - this.commonModels = commonModels; - this.includeExampleValues = includeExampleValues; - this.additionalProperties = additionalProperties; - } - - /** - * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. - */ - @JsonProperty("common_models") - public Optional getCommonModels() { - return commonModels; - } - - /** - * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. - */ - @JsonProperty("include_example_values") - public Optional getIncludeExampleValues() { - return includeExampleValues; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldsRetrieveRequest other) { - return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels, this.includeExampleValues); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional commonModels = Optional.empty(); - - private Optional includeExampleValues = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldsRetrieveRequest other) { - commonModels(other.getCommonModels()); - includeExampleValues(other.getIncludeExampleValues()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(Optional commonModels) { - this.commonModels = commonModels; - return this; - } - - public Builder commonModels(String commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) - public Builder includeExampleValues(Optional includeExampleValues) { - this.includeExampleValues = includeExampleValues; - return this; - } - - public Builder includeExampleValues(String includeExampleValues) { - this.includeExampleValues = Optional.ofNullable(includeExampleValues); - return this; - } - - public RemoteFieldsRetrieveRequest build() { - return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/forceresync/ForceResyncClient.java b/src/main/java/com/merge/api/resources/crm/forceresync/ForceResyncClient.java deleted file mode 100644 index 3a4e64883..000000000 --- a/src/main/java/com/merge/api/resources/crm/forceresync/ForceResyncClient.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.forceresync; - -import com.fasterxml.jackson.core.type.TypeReference; -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.crm.types.SyncStatus; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ForceResyncClient { - protected final ClientOptions clientOptions; - - public ForceResyncClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate() { - return syncStatusResyncCreate(null); - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/sync-status/resync") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/api/resources/crm/generatekey/GenerateKeyClient.java deleted file mode 100644 index 442220b6e..000000000 --- a/src/main/java/com/merge/api/resources/crm/generatekey/GenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.generatekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.generatekey.requests.GenerateRemoteKeyRequest; -import com.merge.api.resources.crm.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GenerateKeyClient { - protected final ClientOptions clientOptions; - - public GenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request) { - return create(request, null); - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/generate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/resources/crm/generatekey/requests/GenerateRemoteKeyRequest.java deleted file mode 100644 index 691546b5f..000000000 --- a/src/main/java/com/merge/api/resources/crm/generatekey/requests/GenerateRemoteKeyRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.generatekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) -public final class GenerateRemoteKeyRequest { - private final String name; - - private final Map additionalProperties; - - private GenerateRemoteKeyRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GenerateRemoteKeyRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(GenerateRemoteKeyRequest other); - } - - public interface _FinalStage { - GenerateRemoteKeyRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GenerateRemoteKeyRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public GenerateRemoteKeyRequest build() { - return new GenerateRemoteKeyRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/issues/IssuesClient.java b/src/main/java/com/merge/api/resources/crm/issues/IssuesClient.java deleted file mode 100644 index db1593212..000000000 --- a/src/main/java/com/merge/api/resources/crm/issues/IssuesClient.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.issues; - -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.crm.issues.requests.IssuesListRequest; -import com.merge.api.resources.crm.types.Issue; -import com.merge.api.resources.crm.types.PaginatedIssueList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuesClient { - protected final ClientOptions clientOptions; - - public IssuesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list() { - return list(IssuesListRequest.builder().build()); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request) { - return list(request, null); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/issues"); - if (request.getAccountToken().isPresent()) { - httpUrl.addQueryParameter("account_token", request.getAccountToken().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getFirstIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_after", - request.getFirstIncidentTimeAfter().get().toString()); - } - if (request.getFirstIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_before", - request.getFirstIncidentTimeBefore().get().toString()); - } - if (request.getIncludeMuted().isPresent()) { - httpUrl.addQueryParameter("include_muted", request.getIncludeMuted().get()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getLastIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_after", - request.getLastIncidentTimeAfter().get().toString()); - } - if (request.getLastIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_before", - request.getLastIncidentTimeBefore().get().toString()); - } - if (request.getLinkedAccountId().isPresent()) { - httpUrl.addQueryParameter( - "linked_account_id", request.getLinkedAccountId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedIssueList.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); - } - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id) { - return retrieve(id, null); - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/issues") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), Issue.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/api/resources/crm/issues/requests/IssuesListRequest.java deleted file mode 100644 index 36548c36b..000000000 --- a/src/main/java/com/merge/api/resources/crm/issues/requests/IssuesListRequest.java +++ /dev/null @@ -1,477 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.issues.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.issues.types.IssuesListRequestStatus; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IssuesListRequest.Builder.class) -public final class IssuesListRequest { - private final Optional accountToken; - - private final Optional cursor; - - private final Optional endDate; - - private final Optional endUserOrganizationName; - - private final Optional firstIncidentTimeAfter; - - private final Optional firstIncidentTimeBefore; - - private final Optional includeMuted; - - private final Optional integrationName; - - private final Optional lastIncidentTimeAfter; - - private final Optional lastIncidentTimeBefore; - - private final Optional linkedAccountId; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional status; - - private final Map additionalProperties; - - private IssuesListRequest( - Optional accountToken, - Optional cursor, - Optional endDate, - Optional endUserOrganizationName, - Optional firstIncidentTimeAfter, - Optional firstIncidentTimeBefore, - Optional includeMuted, - Optional integrationName, - Optional lastIncidentTimeAfter, - Optional lastIncidentTimeBefore, - Optional linkedAccountId, - Optional pageSize, - Optional startDate, - Optional status, - Map additionalProperties) { - this.accountToken = accountToken; - this.cursor = cursor; - this.endDate = endDate; - this.endUserOrganizationName = endUserOrganizationName; - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - this.includeMuted = includeMuted; - this.integrationName = integrationName; - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - this.linkedAccountId = linkedAccountId; - this.pageSize = pageSize; - this.startDate = startDate; - this.status = status; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public Optional getAccountToken() { - return accountToken; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include issues whose most recent action occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return issues whose first incident time was after this datetime. - */ - @JsonProperty("first_incident_time_after") - public Optional getFirstIncidentTimeAfter() { - return firstIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose first incident time was before this datetime. - */ - @JsonProperty("first_incident_time_before") - public Optional getFirstIncidentTimeBefore() { - return firstIncidentTimeBefore; - } - - /** - * @return If true, will include muted issues - */ - @JsonProperty("include_muted") - public Optional getIncludeMuted() { - return includeMuted; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If provided, will only return issues whose last incident time was after this datetime. - */ - @JsonProperty("last_incident_time_after") - public Optional getLastIncidentTimeAfter() { - return lastIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose last incident time was before this datetime. - */ - @JsonProperty("last_incident_time_before") - public Optional getLastIncidentTimeBefore() { - return lastIncidentTimeBefore; - } - - /** - * @return If provided, will only include issues pertaining to the linked account passed in. - */ - @JsonProperty("linked_account_id") - public Optional getLinkedAccountId() { - return linkedAccountId; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include issues whose most recent action occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IssuesListRequest other) { - return accountToken.equals(other.accountToken) - && cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) - && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) - && includeMuted.equals(other.includeMuted) - && integrationName.equals(other.integrationName) - && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) - && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) - && linkedAccountId.equals(other.linkedAccountId) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountToken, - this.cursor, - this.endDate, - this.endUserOrganizationName, - this.firstIncidentTimeAfter, - this.firstIncidentTimeBefore, - this.includeMuted, - this.integrationName, - this.lastIncidentTimeAfter, - this.lastIncidentTimeBefore, - this.linkedAccountId, - this.pageSize, - this.startDate, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountToken = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional firstIncidentTimeAfter = Optional.empty(); - - private Optional firstIncidentTimeBefore = Optional.empty(); - - private Optional includeMuted = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional lastIncidentTimeAfter = Optional.empty(); - - private Optional lastIncidentTimeBefore = Optional.empty(); - - private Optional linkedAccountId = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(IssuesListRequest other) { - accountToken(other.getAccountToken()); - cursor(other.getCursor()); - endDate(other.getEndDate()); - endUserOrganizationName(other.getEndUserOrganizationName()); - firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); - firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); - includeMuted(other.getIncludeMuted()); - integrationName(other.getIntegrationName()); - lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); - lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); - linkedAccountId(other.getLinkedAccountId()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "account_token", nulls = Nulls.SKIP) - public Builder accountToken(Optional accountToken) { - this.accountToken = accountToken; - return this; - } - - public Builder accountToken(String accountToken) { - this.accountToken = Optional.ofNullable(accountToken); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) - public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - return this; - } - - public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) - public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - return this; - } - - public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) - public Builder includeMuted(Optional includeMuted) { - this.includeMuted = includeMuted; - return this; - } - - public Builder includeMuted(String includeMuted) { - this.includeMuted = Optional.ofNullable(includeMuted); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) - public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - return this; - } - - public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) - public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - return this; - } - - public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) - public Builder linkedAccountId(Optional linkedAccountId) { - this.linkedAccountId = linkedAccountId; - return this; - } - - public Builder linkedAccountId(String linkedAccountId) { - this.linkedAccountId = Optional.ofNullable(linkedAccountId); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(IssuesListRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - public IssuesListRequest build() { - return new IssuesListRequest( - accountToken, - cursor, - endDate, - endUserOrganizationName, - firstIncidentTimeAfter, - firstIncidentTimeBefore, - includeMuted, - integrationName, - lastIncidentTimeAfter, - lastIncidentTimeBefore, - linkedAccountId, - pageSize, - startDate, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/resources/crm/issues/types/IssuesListRequestStatus.java deleted file mode 100644 index cd179408c..000000000 --- a/src/main/java/com/merge/api/resources/crm/issues/types/IssuesListRequestStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.issues.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssuesListRequestStatus { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssuesListRequestStatus(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/leads/LeadsClient.java b/src/main/java/com/merge/api/resources/crm/leads/LeadsClient.java deleted file mode 100644 index 96ed22061..000000000 --- a/src/main/java/com/merge/api/resources/crm/leads/LeadsClient.java +++ /dev/null @@ -1,384 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.leads; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.leads.requests.LeadEndpointRequest; -import com.merge.api.resources.crm.leads.requests.LeadsListRequest; -import com.merge.api.resources.crm.leads.requests.LeadsRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.leads.requests.LeadsRetrieveRequest; -import com.merge.api.resources.crm.types.Lead; -import com.merge.api.resources.crm.types.LeadResponse; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.PaginatedLeadList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LeadsClient { - protected final ClientOptions clientOptions; - - public LeadsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Lead objects. - */ - public PaginatedLeadList list() { - return list(LeadsListRequest.builder().build()); - } - - /** - * Returns a list of Lead objects. - */ - public PaginatedLeadList list(LeadsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Lead objects. - */ - public PaginatedLeadList list(LeadsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/leads"); - if (request.getConvertedAccountId().isPresent()) { - httpUrl.addQueryParameter( - "converted_account_id", request.getConvertedAccountId().get()); - } - if (request.getConvertedContactId().isPresent()) { - httpUrl.addQueryParameter( - "converted_contact_id", request.getConvertedContactId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmailAddresses().isPresent()) { - httpUrl.addQueryParameter( - "email_addresses", request.getEmailAddresses().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOwnerId().isPresent()) { - httpUrl.addQueryParameter("owner_id", request.getOwnerId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getPhoneNumbers().isPresent()) { - httpUrl.addQueryParameter("phone_numbers", request.getPhoneNumbers().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedLeadList.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); - } - } - - /** - * Creates a Lead object with the given values. - */ - public LeadResponse create(LeadEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Lead object with the given values. - */ - public LeadResponse create(LeadEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/leads"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), LeadResponse.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); - } - } - - /** - * Returns a Lead object with the given id. - */ - public Lead retrieve(String id) { - return retrieve(id, LeadsRetrieveRequest.builder().build()); - } - - /** - * Returns a Lead object with the given id. - */ - public Lead retrieve(String id, LeadsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Lead object with the given id. - */ - public Lead retrieve(String id, LeadsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/leads") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Lead.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); - } - } - - /** - * Returns metadata for Lead POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Lead POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/leads/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - LeadsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(LeadsRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - LeadsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/leads/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadsRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/leads/requests/LeadsRetrieveRequest.java deleted file mode 100644 index f2bcc2488..000000000 --- a/src/main/java/com/merge/api/resources/crm/leads/requests/LeadsRetrieveRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.leads.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.leads.types.LeadsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LeadsRetrieveRequest.Builder.class) -public final class LeadsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private LeadsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LeadsRetrieveRequest && equalTo((LeadsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LeadsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LeadsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(LeadsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public LeadsRetrieveRequest build() { - return new LeadsRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/leads/types/LeadsListRequestExpand.java b/src/main/java/com/merge/api/resources/crm/leads/types/LeadsListRequestExpand.java deleted file mode 100644 index 77762ad40..000000000 --- a/src/main/java/com/merge/api/resources/crm/leads/types/LeadsListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.leads.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LeadsListRequestExpand { - CONVERTED_ACCOUNT("converted_account"), - - CONVERTED_CONTACT("converted_contact"), - - CONVERTED_CONTACT_CONVERTED_ACCOUNT("converted_contact,converted_account"), - - OWNER("owner"), - - OWNER_CONVERTED_ACCOUNT("owner,converted_account"), - - OWNER_CONVERTED_CONTACT("owner,converted_contact"), - - OWNER_CONVERTED_CONTACT_CONVERTED_ACCOUNT("owner,converted_contact,converted_account"); - - private final String value; - - LeadsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/leads/types/LeadsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/crm/leads/types/LeadsRetrieveRequestExpand.java deleted file mode 100644 index d3d33603b..000000000 --- a/src/main/java/com/merge/api/resources/crm/leads/types/LeadsRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.leads.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LeadsRetrieveRequestExpand { - CONVERTED_ACCOUNT("converted_account"), - - CONVERTED_CONTACT("converted_contact"), - - CONVERTED_CONTACT_CONVERTED_ACCOUNT("converted_contact,converted_account"), - - OWNER("owner"), - - OWNER_CONVERTED_ACCOUNT("owner,converted_account"), - - OWNER_CONVERTED_CONTACT("owner,converted_contact"), - - OWNER_CONVERTED_CONTACT_CONVERTED_ACCOUNT("owner,converted_contact,converted_account"); - - private final String value; - - LeadsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/api/resources/crm/linkedaccounts/LinkedAccountsClient.java deleted file mode 100644 index 1125fcb7a..000000000 --- a/src/main/java/com/merge/api/resources/crm/linkedaccounts/LinkedAccountsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.linkedaccounts; - -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.crm.linkedaccounts.requests.LinkedAccountsListRequest; -import com.merge.api.resources.crm.types.PaginatedAccountDetailsAndActionsList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkedAccountsClient { - protected final ClientOptions clientOptions; - - public LinkedAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list() { - return list(LinkedAccountsListRequest.builder().build()); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list(LinkedAccountsListRequest request) { - return list(request, null); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list( - LinkedAccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/linked-accounts"); - if (request.getCategory().isPresent()) { - httpUrl.addQueryParameter("category", request.getCategory().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndUserEmailAddress().isPresent()) { - httpUrl.addQueryParameter( - "end_user_email_address", request.getEndUserEmailAddress().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getEndUserOriginId().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_id", request.getEndUserOriginId().get()); - } - if (request.getEndUserOriginIds().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_ids", request.getEndUserOriginIds().get()); - } - if (request.getId().isPresent()) { - httpUrl.addQueryParameter("id", request.getId().get()); - } - if (request.getIds().isPresent()) { - httpUrl.addQueryParameter("ids", request.getIds().get()); - } - if (request.getIncludeDuplicates().isPresent()) { - httpUrl.addQueryParameter( - "include_duplicates", request.getIncludeDuplicates().get().toString()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getIsTestAccount().isPresent()) { - httpUrl.addQueryParameter( - "is_test_account", request.getIsTestAccount().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountDetailsAndActionsList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/resources/crm/linkedaccounts/requests/LinkedAccountsListRequest.java deleted file mode 100644 index 0b462572b..000000000 --- a/src/main/java/com/merge/api/resources/crm/linkedaccounts/requests/LinkedAccountsListRequest.java +++ /dev/null @@ -1,458 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.linkedaccounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.linkedaccounts.types.LinkedAccountsListRequestCategory; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) -public final class LinkedAccountsListRequest { - private final Optional category; - - private final Optional cursor; - - private final Optional endUserEmailAddress; - - private final Optional endUserOrganizationName; - - private final Optional endUserOriginId; - - private final Optional endUserOriginIds; - - private final Optional id; - - private final Optional ids; - - private final Optional includeDuplicates; - - private final Optional integrationName; - - private final Optional isTestAccount; - - private final Optional pageSize; - - private final Optional status; - - private final Map additionalProperties; - - private LinkedAccountsListRequest( - Optional category, - Optional cursor, - Optional endUserEmailAddress, - Optional endUserOrganizationName, - Optional endUserOriginId, - Optional endUserOriginIds, - Optional id, - Optional ids, - Optional includeDuplicates, - Optional integrationName, - Optional isTestAccount, - Optional pageSize, - Optional status, - Map additionalProperties) { - this.category = category; - this.cursor = cursor; - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.endUserOriginIds = endUserOriginIds; - this.id = id; - this.ids = ids; - this.includeDuplicates = includeDuplicates; - this.integrationName = integrationName; - this.isTestAccount = isTestAccount; - this.pageSize = pageSize; - this.status = status; - this.additionalProperties = additionalProperties; - } - - /** - * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing - *
    - *
  • hris - hris
  • - *
  • ats - ats
  • - *
  • accounting - accounting
  • - *
  • ticketing - ticketing
  • - *
  • crm - crm
  • - *
  • mktg - mktg
  • - *
  • filestorage - filestorage
  • - *
- */ - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return linked accounts associated with the given email address. - */ - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return If provided, will only return linked accounts associated with the given organization name. - */ - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return linked accounts associated with the given origin ID. - */ - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. - */ - @JsonProperty("end_user_origin_ids") - public Optional getEndUserOriginIds() { - return endUserOriginIds; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. - */ - @JsonProperty("ids") - public Optional getIds() { - return ids; - } - - /** - * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. - */ - @JsonProperty("include_duplicates") - public Optional getIncludeDuplicates() { - return includeDuplicates; - } - - /** - * @return If provided, will only return linked accounts associated with the given integration name. - */ - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. - */ - @JsonProperty("is_test_account") - public Optional getIsTestAccount() { - return isTestAccount; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountsListRequest other) { - return category.equals(other.category) - && cursor.equals(other.cursor) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOriginIds.equals(other.endUserOriginIds) - && id.equals(other.id) - && ids.equals(other.ids) - && includeDuplicates.equals(other.includeDuplicates) - && integrationName.equals(other.integrationName) - && isTestAccount.equals(other.isTestAccount) - && pageSize.equals(other.pageSize) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.category, - this.cursor, - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.endUserOriginIds, - this.id, - this.ids, - this.includeDuplicates, - this.integrationName, - this.isTestAccount, - this.pageSize, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional category = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOriginIds = Optional.empty(); - - private Optional id = Optional.empty(); - - private Optional ids = Optional.empty(); - - private Optional includeDuplicates = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional isTestAccount = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountsListRequest other) { - category(other.getCategory()); - cursor(other.getCursor()); - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - endUserOriginIds(other.getEndUserOriginIds()); - id(other.getId()); - ids(other.getIds()); - includeDuplicates(other.getIncludeDuplicates()); - integrationName(other.getIntegrationName()); - isTestAccount(other.getIsTestAccount()); - pageSize(other.getPageSize()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(LinkedAccountsListRequestCategory category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) - public Builder endUserOriginIds(Optional endUserOriginIds) { - this.endUserOriginIds = endUserOriginIds; - return this; - } - - public Builder endUserOriginIds(String endUserOriginIds) { - this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "ids", nulls = Nulls.SKIP) - public Builder ids(Optional ids) { - this.ids = ids; - return this; - } - - public Builder ids(String ids) { - this.ids = Optional.ofNullable(ids); - return this; - } - - @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) - public Builder includeDuplicates(Optional includeDuplicates) { - this.includeDuplicates = includeDuplicates; - return this; - } - - public Builder includeDuplicates(Boolean includeDuplicates) { - this.includeDuplicates = Optional.ofNullable(includeDuplicates); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) - public Builder isTestAccount(Optional isTestAccount) { - this.isTestAccount = isTestAccount; - return this; - } - - public Builder isTestAccount(String isTestAccount) { - this.isTestAccount = Optional.ofNullable(isTestAccount); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - public LinkedAccountsListRequest build() { - return new LinkedAccountsListRequest( - category, - cursor, - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - endUserOriginIds, - id, - ids, - includeDuplicates, - integrationName, - isTestAccount, - pageSize, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/resources/crm/linkedaccounts/types/LinkedAccountsListRequestCategory.java deleted file mode 100644 index fe054e414..000000000 --- a/src/main/java/com/merge/api/resources/crm/linkedaccounts/types/LinkedAccountsListRequestCategory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.linkedaccounts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LinkedAccountsListRequestCategory { - ACCOUNTING("accounting"), - - ATS("ats"), - - CRM("crm"), - - FILESTORAGE("filestorage"), - - HRIS("hris"), - - MKTG("mktg"), - - TICKETING("ticketing"); - - private final String value; - - LinkedAccountsListRequestCategory(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/linktoken/LinkTokenClient.java b/src/main/java/com/merge/api/resources/crm/linktoken/LinkTokenClient.java deleted file mode 100644 index 73be11092..000000000 --- a/src/main/java/com/merge/api/resources/crm/linktoken/LinkTokenClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.linktoken; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.linktoken.requests.EndUserDetailsRequest; -import com.merge.api.resources.crm.types.LinkToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkTokenClient { - protected final ClientOptions clientOptions; - - public LinkTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request) { - return create(request, null); - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/link-token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), LinkToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/api/resources/crm/linktoken/requests/EndUserDetailsRequest.java deleted file mode 100644 index 5a8157e5e..000000000 --- a/src/main/java/com/merge/api/resources/crm/linktoken/requests/EndUserDetailsRequest.java +++ /dev/null @@ -1,611 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.linktoken.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.CategoriesEnum; -import com.merge.api.resources.crm.types.CommonModelScopesBodyRequest; -import com.merge.api.resources.crm.types.IndividualCommonModelScopeDeserializerRequest; -import com.merge.api.resources.crm.types.LanguageEnum; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) -public final class EndUserDetailsRequest { - private final String endUserEmailAddress; - - private final String endUserOrganizationName; - - private final String endUserOriginId; - - private final List categories; - - private final Optional integration; - - private final Optional linkExpiryMins; - - private final Optional shouldCreateMagicLinkUrl; - - private final Optional hideAdminMagicLink; - - private final Optional> commonModels; - - private final Optional>>> - categoryCommonModelScopes; - - private final Optional language; - - private final Optional areSyncsDisabled; - - private final Optional> integrationSpecificConfig; - - private final Map additionalProperties; - - private EndUserDetailsRequest( - String endUserEmailAddress, - String endUserOrganizationName, - String endUserOriginId, - List categories, - Optional integration, - Optional linkExpiryMins, - Optional shouldCreateMagicLinkUrl, - Optional hideAdminMagicLink, - Optional> commonModels, - Optional>>> - categoryCommonModelScopes, - Optional language, - Optional areSyncsDisabled, - Optional> integrationSpecificConfig, - Map additionalProperties) { - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.categories = categories; - this.integration = integration; - this.linkExpiryMins = linkExpiryMins; - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - this.hideAdminMagicLink = hideAdminMagicLink; - this.commonModels = commonModels; - this.categoryCommonModelScopes = categoryCommonModelScopes; - this.language = language; - this.areSyncsDisabled = areSyncsDisabled; - this.integrationSpecificConfig = integrationSpecificConfig; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. - */ - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return Your end user's organization. - */ - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. - */ - @JsonProperty("end_user_origin_id") - public String getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return The integration categories to show in Merge Link. - */ - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - /** - * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. - */ - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - /** - * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. - */ - @JsonProperty("link_expiry_mins") - public Optional getLinkExpiryMins() { - return linkExpiryMins; - } - - /** - * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("should_create_magic_link_url") - public Optional getShouldCreateMagicLinkUrl() { - return shouldCreateMagicLinkUrl; - } - - /** - * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("hide_admin_magic_link") - public Optional getHideAdminMagicLink() { - return hideAdminMagicLink; - } - - /** - * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. - */ - @JsonProperty("common_models") - public Optional> getCommonModels() { - return commonModels; - } - - /** - * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. - */ - @JsonProperty("category_common_model_scopes") - public Optional>>> - getCategoryCommonModelScopes() { - return categoryCommonModelScopes; - } - - /** - * @return The following subset of IETF language tags can be used to configure localization. - *
    - *
  • en - en
  • - *
  • de - de
  • - *
- */ - @JsonProperty("language") - public Optional getLanguage() { - return language; - } - - /** - * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. - */ - @JsonProperty("are_syncs_disabled") - public Optional getAreSyncsDisabled() { - return areSyncsDisabled; - } - - /** - * @return A JSON object containing integration-specific configuration options. - */ - @JsonProperty("integration_specific_config") - public Optional> getIntegrationSpecificConfig() { - return integrationSpecificConfig; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EndUserDetailsRequest other) { - return endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && categories.equals(other.categories) - && integration.equals(other.integration) - && linkExpiryMins.equals(other.linkExpiryMins) - && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) - && hideAdminMagicLink.equals(other.hideAdminMagicLink) - && commonModels.equals(other.commonModels) - && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) - && language.equals(other.language) - && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.categories, - this.integration, - this.linkExpiryMins, - this.shouldCreateMagicLinkUrl, - this.hideAdminMagicLink, - this.commonModels, - this.categoryCommonModelScopes, - this.language, - this.areSyncsDisabled, - this.integrationSpecificConfig); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EndUserEmailAddressStage builder() { - return new Builder(); - } - - public interface EndUserEmailAddressStage { - EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); - - Builder from(EndUserDetailsRequest other); - } - - public interface EndUserOrganizationNameStage { - EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserOriginIdStage { - _FinalStage endUserOriginId(@NotNull String endUserOriginId); - } - - public interface _FinalStage { - EndUserDetailsRequest build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage integration(Optional integration); - - _FinalStage integration(String integration); - - _FinalStage linkExpiryMins(Optional linkExpiryMins); - - _FinalStage linkExpiryMins(Integer linkExpiryMins); - - _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); - - _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); - - _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); - - _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); - - _FinalStage commonModels(Optional> commonModels); - - _FinalStage commonModels(List commonModels); - - _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes); - - _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes); - - _FinalStage language(Optional language); - - _FinalStage language(LanguageEnum language); - - _FinalStage areSyncsDisabled(Optional areSyncsDisabled); - - _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); - - _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); - - _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { - private String endUserEmailAddress; - - private String endUserOrganizationName; - - private String endUserOriginId; - - private Optional> integrationSpecificConfig = Optional.empty(); - - private Optional areSyncsDisabled = Optional.empty(); - - private Optional language = Optional.empty(); - - private Optional>>> - categoryCommonModelScopes = Optional.empty(); - - private Optional> commonModels = Optional.empty(); - - private Optional hideAdminMagicLink = Optional.empty(); - - private Optional shouldCreateMagicLinkUrl = Optional.empty(); - - private Optional linkExpiryMins = Optional.empty(); - - private Optional integration = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EndUserDetailsRequest other) { - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - categories(other.getCategories()); - integration(other.getIntegration()); - linkExpiryMins(other.getLinkExpiryMins()); - shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); - hideAdminMagicLink(other.getHideAdminMagicLink()); - commonModels(other.getCommonModels()); - categoryCommonModelScopes(other.getCategoryCommonModelScopes()); - language(other.getLanguage()); - areSyncsDisabled(other.getAreSyncsDisabled()); - integrationSpecificConfig(other.getIntegrationSpecificConfig()); - return this; - } - - /** - *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_email_address") - public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - /** - *

Your end user's organization.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - /** - *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_origin_id") - public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - /** - *

A JSON object containing integration-specific configuration options.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { - this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) - public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { - this.integrationSpecificConfig = integrationSpecificConfig; - return this; - } - - /** - *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { - this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) - public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { - this.areSyncsDisabled = areSyncsDisabled; - return this; - } - - /** - *

The following subset of IETF language tags can be used to configure localization.

- *
    - *
  • en - en
  • - *
  • de - de
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage language(LanguageEnum language) { - this.language = Optional.ofNullable(language); - return this; - } - - @java.lang.Override - @JsonSetter(value = "language", nulls = Nulls.SKIP) - public _FinalStage language(Optional language) { - this.language = language; - return this; - } - - /** - *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes) { - this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) - public _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes) { - this.categoryCommonModelScopes = categoryCommonModelScopes; - return this; - } - - /** - *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage commonModels(List commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @java.lang.Override - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public _FinalStage commonModels(Optional> commonModels) { - this.commonModels = commonModels; - return this; - } - - /** - *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { - this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); - return this; - } - - @java.lang.Override - @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) - public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { - this.hideAdminMagicLink = hideAdminMagicLink; - return this; - } - - /** - *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) - public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - return this; - } - - /** - *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage linkExpiryMins(Integer linkExpiryMins) { - this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); - return this; - } - - @java.lang.Override - @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) - public _FinalStage linkExpiryMins(Optional linkExpiryMins) { - this.linkExpiryMins = linkExpiryMins; - return this; - } - - /** - *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public EndUserDetailsRequest build() { - return new EndUserDetailsRequest( - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - categories, - integration, - linkExpiryMins, - shouldCreateMagicLinkUrl, - hideAdminMagicLink, - commonModels, - categoryCommonModelScopes, - language, - areSyncsDisabled, - integrationSpecificConfig, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/notes/NotesClient.java b/src/main/java/com/merge/api/resources/crm/notes/NotesClient.java deleted file mode 100644 index 15a603cca..000000000 --- a/src/main/java/com/merge/api/resources/crm/notes/NotesClient.java +++ /dev/null @@ -1,379 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.notes; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.notes.requests.NoteEndpointRequest; -import com.merge.api.resources.crm.notes.requests.NotesListRequest; -import com.merge.api.resources.crm.notes.requests.NotesRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.notes.requests.NotesRetrieveRequest; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.Note; -import com.merge.api.resources.crm.types.NoteResponse; -import com.merge.api.resources.crm.types.PaginatedNoteList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class NotesClient { - protected final ClientOptions clientOptions; - - public NotesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Note objects. - */ - public PaginatedNoteList list() { - return list(NotesListRequest.builder().build()); - } - - /** - * Returns a list of Note objects. - */ - public PaginatedNoteList list(NotesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Note objects. - */ - public PaginatedNoteList list(NotesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/notes"); - if (request.getAccountId().isPresent()) { - httpUrl.addQueryParameter("account_id", request.getAccountId().get()); - } - if (request.getContactId().isPresent()) { - httpUrl.addQueryParameter("contact_id", request.getContactId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOpportunityId().isPresent()) { - httpUrl.addQueryParameter( - "opportunity_id", request.getOpportunityId().get()); - } - if (request.getOwnerId().isPresent()) { - httpUrl.addQueryParameter("owner_id", request.getOwnerId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedNoteList.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); - } - } - - /** - * Creates a Note object with the given values. - */ - public NoteResponse create(NoteEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Note object with the given values. - */ - public NoteResponse create(NoteEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/notes"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), NoteResponse.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); - } - } - - /** - * Returns a Note object with the given id. - */ - public Note retrieve(String id) { - return retrieve(id, NotesRetrieveRequest.builder().build()); - } - - /** - * Returns a Note object with the given id. - */ - public Note retrieve(String id, NotesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Note object with the given id. - */ - public Note retrieve(String id, NotesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/notes") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Note.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); - } - } - - /** - * Returns metadata for Note POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Note POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/notes/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - NotesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(NotesRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - NotesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/notes/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/notes/requests/NotesRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/notes/requests/NotesRetrieveRequest.java deleted file mode 100644 index 56513563e..000000000 --- a/src/main/java/com/merge/api/resources/crm/notes/requests/NotesRetrieveRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.notes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.notes.types.NotesRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = NotesRetrieveRequest.Builder.class) -public final class NotesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private NotesRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof NotesRetrieveRequest && equalTo((NotesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(NotesRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(NotesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(NotesRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public NotesRetrieveRequest build() { - return new NotesRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/notes/types/NotesListRequestExpand.java b/src/main/java/com/merge/api/resources/crm/notes/types/NotesListRequestExpand.java deleted file mode 100644 index 69d41ebda..000000000 --- a/src/main/java/com/merge/api/resources/crm/notes/types/NotesListRequestExpand.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.notes.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum NotesListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_OPPORTUNITY("account,opportunity"), - - CONTACT("contact"), - - CONTACT_ACCOUNT("contact,account"), - - CONTACT_ACCOUNT_OPPORTUNITY("contact,account,opportunity"), - - CONTACT_OPPORTUNITY("contact,opportunity"), - - OPPORTUNITY("opportunity"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_ACCOUNT_OPPORTUNITY("owner,account,opportunity"), - - OWNER_CONTACT("owner,contact"), - - OWNER_CONTACT_ACCOUNT("owner,contact,account"), - - OWNER_CONTACT_ACCOUNT_OPPORTUNITY("owner,contact,account,opportunity"), - - OWNER_CONTACT_OPPORTUNITY("owner,contact,opportunity"), - - OWNER_OPPORTUNITY("owner,opportunity"); - - private final String value; - - NotesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/notes/types/NotesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/crm/notes/types/NotesRetrieveRequestExpand.java deleted file mode 100644 index edca42556..000000000 --- a/src/main/java/com/merge/api/resources/crm/notes/types/NotesRetrieveRequestExpand.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.notes.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum NotesRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_OPPORTUNITY("account,opportunity"), - - CONTACT("contact"), - - CONTACT_ACCOUNT("contact,account"), - - CONTACT_ACCOUNT_OPPORTUNITY("contact,account,opportunity"), - - CONTACT_OPPORTUNITY("contact,opportunity"), - - OPPORTUNITY("opportunity"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_ACCOUNT_OPPORTUNITY("owner,account,opportunity"), - - OWNER_CONTACT("owner,contact"), - - OWNER_CONTACT_ACCOUNT("owner,contact,account"), - - OWNER_CONTACT_ACCOUNT_OPPORTUNITY("owner,contact,account,opportunity"), - - OWNER_CONTACT_OPPORTUNITY("owner,contact,opportunity"), - - OWNER_OPPORTUNITY("owner,opportunity"); - - private final String value; - - NotesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/OpportunitiesClient.java b/src/main/java/com/merge/api/resources/crm/opportunities/OpportunitiesClient.java deleted file mode 100644 index f81ea59cb..000000000 --- a/src/main/java/com/merge/api/resources/crm/opportunities/OpportunitiesClient.java +++ /dev/null @@ -1,498 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.opportunities; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.opportunities.requests.OpportunitiesListRequest; -import com.merge.api.resources.crm.opportunities.requests.OpportunitiesRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.opportunities.requests.OpportunitiesRetrieveRequest; -import com.merge.api.resources.crm.opportunities.requests.OpportunityEndpointRequest; -import com.merge.api.resources.crm.opportunities.requests.PatchedOpportunityEndpointRequest; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.Opportunity; -import com.merge.api.resources.crm.types.OpportunityResponse; -import com.merge.api.resources.crm.types.PaginatedOpportunityList; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class OpportunitiesClient { - protected final ClientOptions clientOptions; - - public OpportunitiesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Opportunity objects. - */ - public PaginatedOpportunityList list() { - return list(OpportunitiesListRequest.builder().build()); - } - - /** - * Returns a list of Opportunity objects. - */ - public PaginatedOpportunityList list(OpportunitiesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Opportunity objects. - */ - public PaginatedOpportunityList list(OpportunitiesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/opportunities"); - if (request.getAccountId().isPresent()) { - httpUrl.addQueryParameter("account_id", request.getAccountId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOwnerId().isPresent()) { - httpUrl.addQueryParameter("owner_id", request.getOwnerId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "remote_created_after", - request.getRemoteCreatedAfter().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - if (request.getStageId().isPresent()) { - httpUrl.addQueryParameter("stage_id", request.getStageId().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedOpportunityList.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); - } - } - - /** - * Creates an Opportunity object with the given values. - */ - public OpportunityResponse create(OpportunityEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Opportunity object with the given values. - */ - public OpportunityResponse create(OpportunityEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/opportunities"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), OpportunityResponse.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); - } - } - - /** - * Returns an Opportunity object with the given id. - */ - public Opportunity retrieve(String id) { - return retrieve(id, OpportunitiesRetrieveRequest.builder().build()); - } - - /** - * Returns an Opportunity object with the given id. - */ - public Opportunity retrieve(String id, OpportunitiesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Opportunity object with the given id. - */ - public Opportunity retrieve(String id, OpportunitiesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/opportunities") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Opportunity.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); - } - } - - /** - * Updates an Opportunity object with the given id. - */ - public OpportunityResponse partialUpdate(String id, PatchedOpportunityEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates an Opportunity object with the given id. - */ - public OpportunityResponse partialUpdate( - String id, PatchedOpportunityEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/opportunities") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), OpportunityResponse.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); - } - } - - /** - * Returns metadata for Opportunity PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for Opportunity PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/opportunities/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for Opportunity POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Opportunity POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/opportunities/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - OpportunitiesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(OpportunitiesRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - OpportunitiesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/opportunities/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesListRequestExpand.java b/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesListRequestExpand.java deleted file mode 100644 index 99c24d474..000000000 --- a/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.opportunities.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum OpportunitiesListRequestExpand { - ACCOUNT("account"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_STAGE("owner,stage"), - - OWNER_STAGE_ACCOUNT("owner,stage,account"), - - STAGE("stage"), - - STAGE_ACCOUNT("stage,account"); - - private final String value; - - OpportunitiesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesRetrieveRequestExpand.java deleted file mode 100644 index 8fc257217..000000000 --- a/src/main/java/com/merge/api/resources/crm/opportunities/types/OpportunitiesRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.opportunities.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum OpportunitiesRetrieveRequestExpand { - ACCOUNT("account"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_STAGE("owner,stage"), - - OWNER_STAGE_ACCOUNT("owner,stage,account"), - - STAGE("stage"), - - STAGE_ACCOUNT("stage,account"); - - private final String value; - - OpportunitiesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/passthrough/PassthroughClient.java b/src/main/java/com/merge/api/resources/crm/passthrough/PassthroughClient.java deleted file mode 100644 index 568aae753..000000000 --- a/src/main/java/com/merge/api/resources/crm/passthrough/PassthroughClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.passthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.types.DataPassthroughRequest; -import com.merge.api.resources.crm.types.RemoteResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PassthroughClient { - protected final ClientOptions clientOptions; - - public PassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), RemoteResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/api/resources/crm/regeneratekey/RegenerateKeyClient.java deleted file mode 100644 index 539f5931f..000000000 --- a/src/main/java/com/merge/api/resources/crm/regeneratekey/RegenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.regeneratekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.regeneratekey.requests.RemoteKeyForRegenerationRequest; -import com.merge.api.resources.crm.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RegenerateKeyClient { - protected final ClientOptions clientOptions; - - public RegenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request) { - return create(request, null); - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/regenerate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/resources/crm/regeneratekey/requests/RemoteKeyForRegenerationRequest.java deleted file mode 100644 index 33f777c39..000000000 --- a/src/main/java/com/merge/api/resources/crm/regeneratekey/requests/RemoteKeyForRegenerationRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.regeneratekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) -public final class RemoteKeyForRegenerationRequest { - private final String name; - - private final Map additionalProperties; - - private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKeyForRegenerationRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(RemoteKeyForRegenerationRequest other); - } - - public interface _FinalStage { - RemoteKeyForRegenerationRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKeyForRegenerationRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public RemoteKeyForRegenerationRequest build() { - return new RemoteKeyForRegenerationRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/scopes/ScopesClient.java b/src/main/java/com/merge/api/resources/crm/scopes/ScopesClient.java deleted file mode 100644 index 72e59d1d9..000000000 --- a/src/main/java/com/merge/api/resources/crm/scopes/ScopesClient.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.scopes; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; -import com.merge.api.resources.crm.types.CommonModelScopeApi; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ScopesClient { - protected final ClientOptions clientOptions; - - public ScopesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve() { - return defaultScopesRetrieve(null); - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/default-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve() { - return linkedAccountScopesRetrieve(null); - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/linked-account-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { - return linkedAccountScopesCreate(request, null); - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate( - LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/linked-account-scopes") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/crm/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 1fb3d9e9c..000000000 --- a/src/main/java/com/merge/api/resources/crm/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.scopes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.types.IndividualCommonModelScopeDeserializerRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) -public final class LinkedAccountCommonModelScopeDeserializerRequest { - private final List commonModels; - - private final Map additionalProperties; - - private LinkedAccountCommonModelScopeDeserializerRequest( - List commonModels, - Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountCommonModelScopeDeserializerRequest - && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public LinkedAccountCommonModelScopeDeserializerRequest build() { - return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/stages/StagesClient.java b/src/main/java/com/merge/api/resources/crm/stages/StagesClient.java deleted file mode 100644 index 33eb9e634..000000000 --- a/src/main/java/com/merge/api/resources/crm/stages/StagesClient.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.stages; - -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.crm.stages.requests.StagesListRequest; -import com.merge.api.resources.crm.stages.requests.StagesRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.stages.requests.StagesRetrieveRequest; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import com.merge.api.resources.crm.types.PaginatedStageList; -import com.merge.api.resources.crm.types.Stage; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class StagesClient { - protected final ClientOptions clientOptions; - - public StagesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Stage objects. - */ - public PaginatedStageList list() { - return list(StagesListRequest.builder().build()); - } - - /** - * Returns a list of Stage objects. - */ - public PaginatedStageList list(StagesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Stage objects. - */ - public PaginatedStageList list(StagesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/stages"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedStageList.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); - } - } - - /** - * Returns a Stage object with the given id. - */ - public Stage retrieve(String id) { - return retrieve(id, StagesRetrieveRequest.builder().build()); - } - - /** - * Returns a Stage object with the given id. - */ - public Stage retrieve(String id, StagesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Stage object with the given id. - */ - public Stage retrieve(String id, StagesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/stages") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Stage.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - StagesRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(StagesRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - StagesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/stages/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/api/resources/crm/syncstatus/SyncStatusClient.java deleted file mode 100644 index 7082f55f6..000000000 --- a/src/main/java/com/merge/api/resources/crm/syncstatus/SyncStatusClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.syncstatus; - -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.crm.syncstatus.requests.SyncStatusListRequest; -import com.merge.api.resources.crm.types.PaginatedSyncStatusList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SyncStatusClient { - protected final ClientOptions clientOptions; - - public SyncStatusClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list() { - return list(SyncStatusListRequest.builder().build()); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request) { - return list(request, null); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/sync-status"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedSyncStatusList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/api/resources/crm/syncstatus/requests/SyncStatusListRequest.java deleted file mode 100644 index fc4df1ce6..000000000 --- a/src/main/java/com/merge/api/resources/crm/syncstatus/requests/SyncStatusListRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.syncstatus.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) -public final class SyncStatusListRequest { - private final Optional cursor; - - private final Optional pageSize; - - private final Map additionalProperties; - - private SyncStatusListRequest( - Optional cursor, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatusListRequest other) { - return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(SyncStatusListRequest other) { - cursor(other.getCursor()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public SyncStatusListRequest build() { - return new SyncStatusListRequest(cursor, pageSize, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/tasks/TasksClient.java b/src/main/java/com/merge/api/resources/crm/tasks/TasksClient.java deleted file mode 100644 index 6cf1f27ab..000000000 --- a/src/main/java/com/merge/api/resources/crm/tasks/TasksClient.java +++ /dev/null @@ -1,466 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.tasks; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.tasks.requests.PatchedTaskEndpointRequest; -import com.merge.api.resources.crm.tasks.requests.TaskEndpointRequest; -import com.merge.api.resources.crm.tasks.requests.TasksListRequest; -import com.merge.api.resources.crm.tasks.requests.TasksRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.tasks.requests.TasksRetrieveRequest; -import com.merge.api.resources.crm.types.MetaResponse; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import com.merge.api.resources.crm.types.PaginatedTaskList; -import com.merge.api.resources.crm.types.Task; -import com.merge.api.resources.crm.types.TaskResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TasksClient { - protected final ClientOptions clientOptions; - - public TasksClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Task objects. - */ - public PaginatedTaskList list() { - return list(TasksListRequest.builder().build()); - } - - /** - * Returns a list of Task objects. - */ - public PaginatedTaskList list(TasksListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Task objects. - */ - public PaginatedTaskList list(TasksListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/tasks"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTaskList.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); - } - } - - /** - * Creates a Task object with the given values. - */ - public TaskResponse create(TaskEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Task object with the given values. - */ - public TaskResponse create(TaskEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/tasks"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TaskResponse.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); - } - } - - /** - * Returns a Task object with the given id. - */ - public Task retrieve(String id) { - return retrieve(id, TasksRetrieveRequest.builder().build()); - } - - /** - * Returns a Task object with the given id. - */ - public Task retrieve(String id, TasksRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Task object with the given id. - */ - public Task retrieve(String id, TasksRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/tasks") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Task.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); - } - } - - /** - * Updates a Task object with the given id. - */ - public TaskResponse partialUpdate(String id, PatchedTaskEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates a Task object with the given id. - */ - public TaskResponse partialUpdate(String id, PatchedTaskEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/tasks") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TaskResponse.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); - } - } - - /** - * Returns metadata for Task PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for Task PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/tasks/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for Task POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Task POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/tasks/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - TasksRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(TasksRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - TasksRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/tasks/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/tasks/requests/TasksRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/tasks/requests/TasksRetrieveRequest.java deleted file mode 100644 index 22c705fa9..000000000 --- a/src/main/java/com/merge/api/resources/crm/tasks/requests/TasksRetrieveRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.tasks.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.crm.tasks.types.TasksRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TasksRetrieveRequest.Builder.class) -public final class TasksRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private TasksRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TasksRetrieveRequest && equalTo((TasksRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TasksRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TasksRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(TasksRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public TasksRetrieveRequest build() { - return new TasksRetrieveRequest(expand, includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/tasks/types/TasksListRequestExpand.java b/src/main/java/com/merge/api/resources/crm/tasks/types/TasksListRequestExpand.java deleted file mode 100644 index 3a4905527..000000000 --- a/src/main/java/com/merge/api/resources/crm/tasks/types/TasksListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.tasks.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TasksListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_OPPORTUNITY("account,opportunity"), - - OPPORTUNITY("opportunity"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_ACCOUNT_OPPORTUNITY("owner,account,opportunity"), - - OWNER_OPPORTUNITY("owner,opportunity"); - - private final String value; - - TasksListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/tasks/types/TasksRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/crm/tasks/types/TasksRetrieveRequestExpand.java deleted file mode 100644 index 5c828d586..000000000 --- a/src/main/java/com/merge/api/resources/crm/tasks/types/TasksRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.tasks.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TasksRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_OPPORTUNITY("account,opportunity"), - - OPPORTUNITY("opportunity"), - - OWNER("owner"), - - OWNER_ACCOUNT("owner,account"), - - OWNER_ACCOUNT_OPPORTUNITY("owner,account,opportunity"), - - OWNER_OPPORTUNITY("owner,opportunity"); - - private final String value; - - TasksRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/Account.java b/src/main/java/com/merge/api/resources/crm/types/Account.java deleted file mode 100644 index 7b50b6274..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/Account.java +++ /dev/null @@ -1,610 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Account.Builder.class) -public final class Account { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional owner; - - private final Optional name; - - private final Optional description; - - private final Optional industry; - - private final Optional website; - - private final Optional numberOfEmployees; - - private final Optional> addresses; - - private final Optional> phoneNumbers; - - private final Optional lastActivityAt; - - private final Optional remoteUpdatedAt; - - private final Optional remoteCreatedAt; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Optional> remoteFields; - - private final Map additionalProperties; - - private Account( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional owner, - Optional name, - Optional description, - Optional industry, - Optional website, - Optional numberOfEmployees, - Optional> addresses, - Optional> phoneNumbers, - Optional lastActivityAt, - Optional remoteUpdatedAt, - Optional remoteCreatedAt, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Optional> remoteFields, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.owner = owner; - this.name = name; - this.description = description; - this.industry = industry; - this.website = website; - this.numberOfEmployees = numberOfEmployees; - this.addresses = addresses; - this.phoneNumbers = phoneNumbers; - this.lastActivityAt = lastActivityAt; - this.remoteUpdatedAt = remoteUpdatedAt; - this.remoteCreatedAt = remoteCreatedAt; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.remoteFields = remoteFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The account's owner. - */ - @JsonProperty("owner") - public Optional getOwner() { - return owner; - } - - /** - * @return The account's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The account's description. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return The account's industry. - */ - @JsonProperty("industry") - public Optional getIndustry() { - return industry; - } - - /** - * @return The account's website. - */ - @JsonProperty("website") - public Optional getWebsite() { - return website; - } - - /** - * @return The account's number of employees. - */ - @JsonProperty("number_of_employees") - public Optional getNumberOfEmployees() { - return numberOfEmployees; - } - - @JsonProperty("addresses") - public Optional> getAddresses() { - return addresses; - } - - @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { - return phoneNumbers; - } - - /** - * @return The last date (either most recent or furthest in the future) of when an activity occurs in an account. - */ - @JsonProperty("last_activity_at") - public Optional getLastActivityAt() { - return lastActivityAt; - } - - /** - * @return When the CRM system account data was last modified by a user with a login. - */ - @JsonProperty("remote_updated_at") - public Optional getRemoteUpdatedAt() { - return remoteUpdatedAt; - } - - /** - * @return When the third party's account was created. - */ - @JsonProperty("remote_created_at") - public Optional getRemoteCreatedAt() { - return remoteCreatedAt; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @JsonProperty("remote_fields") - public Optional> getRemoteFields() { - return remoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Account && equalTo((Account) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Account other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && owner.equals(other.owner) - && name.equals(other.name) - && description.equals(other.description) - && industry.equals(other.industry) - && website.equals(other.website) - && numberOfEmployees.equals(other.numberOfEmployees) - && addresses.equals(other.addresses) - && phoneNumbers.equals(other.phoneNumbers) - && lastActivityAt.equals(other.lastActivityAt) - && remoteUpdatedAt.equals(other.remoteUpdatedAt) - && remoteCreatedAt.equals(other.remoteCreatedAt) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData) - && remoteFields.equals(other.remoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.owner, - this.name, - this.description, - this.industry, - this.website, - this.numberOfEmployees, - this.addresses, - this.phoneNumbers, - this.lastActivityAt, - this.remoteUpdatedAt, - this.remoteCreatedAt, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData, - this.remoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional owner = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional industry = Optional.empty(); - - private Optional website = Optional.empty(); - - private Optional numberOfEmployees = Optional.empty(); - - private Optional> addresses = Optional.empty(); - - private Optional> phoneNumbers = Optional.empty(); - - private Optional lastActivityAt = Optional.empty(); - - private Optional remoteUpdatedAt = Optional.empty(); - - private Optional remoteCreatedAt = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - private Optional> remoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Account other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - owner(other.getOwner()); - name(other.getName()); - description(other.getDescription()); - industry(other.getIndustry()); - website(other.getWebsite()); - numberOfEmployees(other.getNumberOfEmployees()); - addresses(other.getAddresses()); - phoneNumbers(other.getPhoneNumbers()); - lastActivityAt(other.getLastActivityAt()); - remoteUpdatedAt(other.getRemoteUpdatedAt()); - remoteCreatedAt(other.getRemoteCreatedAt()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - remoteFields(other.getRemoteFields()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "owner", nulls = Nulls.SKIP) - public Builder owner(Optional owner) { - this.owner = owner; - return this; - } - - public Builder owner(AccountOwner owner) { - this.owner = Optional.ofNullable(owner); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "industry", nulls = Nulls.SKIP) - public Builder industry(Optional industry) { - this.industry = industry; - return this; - } - - public Builder industry(String industry) { - this.industry = Optional.ofNullable(industry); - return this; - } - - @JsonSetter(value = "website", nulls = Nulls.SKIP) - public Builder website(Optional website) { - this.website = website; - return this; - } - - public Builder website(String website) { - this.website = Optional.ofNullable(website); - return this; - } - - @JsonSetter(value = "number_of_employees", nulls = Nulls.SKIP) - public Builder numberOfEmployees(Optional numberOfEmployees) { - this.numberOfEmployees = numberOfEmployees; - return this; - } - - public Builder numberOfEmployees(Integer numberOfEmployees) { - this.numberOfEmployees = Optional.ofNullable(numberOfEmployees); - return this; - } - - @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional> addresses) { - this.addresses = addresses; - return this; - } - - public Builder addresses(List
addresses) { - this.addresses = Optional.ofNullable(addresses); - return this; - } - - @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - public Builder phoneNumbers(List phoneNumbers) { - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) - public Builder lastActivityAt(Optional lastActivityAt) { - this.lastActivityAt = lastActivityAt; - return this; - } - - public Builder lastActivityAt(OffsetDateTime lastActivityAt) { - this.lastActivityAt = Optional.ofNullable(lastActivityAt); - return this; - } - - @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) - public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { - this.remoteUpdatedAt = remoteUpdatedAt; - return this; - } - - public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { - this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); - return this; - } - - @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) - public Builder remoteCreatedAt(Optional remoteCreatedAt) { - this.remoteCreatedAt = remoteCreatedAt; - return this; - } - - public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { - this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional> remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(List remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - public Account build() { - return new Account( - id, - remoteId, - createdAt, - modifiedAt, - owner, - name, - description, - industry, - website, - numberOfEmployees, - addresses, - phoneNumbers, - lastActivityAt, - remoteUpdatedAt, - remoteCreatedAt, - remoteWasDeleted, - fieldMappings, - remoteData, - remoteFields, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountDetails.java b/src/main/java/com/merge/api/resources/crm/types/AccountDetails.java deleted file mode 100644 index fb28e5165..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AccountDetails.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetails.Builder.class) -public final class AccountDetails { - private final Optional id; - - private final Optional integration; - - private final Optional integrationSlug; - - private final Optional category; - - private final Optional endUserOriginId; - - private final Optional endUserOrganizationName; - - private final Optional endUserEmailAddress; - - private final Optional status; - - private final Optional webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional accountType; - - private final Optional completedAt; - - private final Map additionalProperties; - - private AccountDetails( - Optional id, - Optional integration, - Optional integrationSlug, - Optional category, - Optional endUserOriginId, - Optional endUserOrganizationName, - Optional endUserEmailAddress, - Optional status, - Optional webhookListenerUrl, - Optional isDuplicate, - Optional accountType, - Optional completedAt, - Map additionalProperties) { - this.id = id; - this.integration = integration; - this.integrationSlug = integrationSlug; - this.category = category; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.status = status; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("integration_slug") - public Optional getIntegrationSlug() { - return integrationSlug; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("webhook_listener_url") - public Optional getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The time at which account completes the linking flow. - */ - @JsonProperty("completed_at") - public Optional getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetails && equalTo((AccountDetails) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetails other) { - return id.equals(other.id) - && integration.equals(other.integration) - && integrationSlug.equals(other.integrationSlug) - && category.equals(other.category) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && status.equals(other.status) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.integration, - this.integrationSlug, - this.category, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.status, - this.webhookListenerUrl, - this.isDuplicate, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional integration = Optional.empty(); - - private Optional integrationSlug = Optional.empty(); - - private Optional category = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional webhookListenerUrl = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional completedAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountDetails other) { - id(other.getId()); - integration(other.getIntegration()); - integrationSlug(other.getIntegrationSlug()); - category(other.getCategory()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - status(other.getStatus()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public Builder integration(Optional integration) { - this.integration = integration; - return this; - } - - public Builder integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) - public Builder integrationSlug(Optional integrationSlug) { - this.integrationSlug = integrationSlug; - return this; - } - - public Builder integrationSlug(String integrationSlug) { - this.integrationSlug = Optional.ofNullable(integrationSlug); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) - public Builder webhookListenerUrl(Optional webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - public Builder webhookListenerUrl(String webhookListenerUrl) { - this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); - return this; - } - - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public Builder isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - public Builder isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(String accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) - public Builder completedAt(Optional completedAt) { - this.completedAt = completedAt; - return this; - } - - public Builder completedAt(OffsetDateTime completedAt) { - this.completedAt = Optional.ofNullable(completedAt); - return this; - } - - public AccountDetails build() { - return new AccountDetails( - id, - integration, - integrationSlug, - category, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - status, - webhookListenerUrl, - isDuplicate, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActions.java deleted file mode 100644 index acbe0a580..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActions.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) -public final class AccountDetailsAndActions { - private final String id; - - private final Optional category; - - private final AccountDetailsAndActionsStatusEnum status; - - private final Optional statusDetail; - - private final Optional endUserOriginId; - - private final String endUserOrganizationName; - - private final String endUserEmailAddress; - - private final Optional subdomain; - - private final String webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional integration; - - private final String accountType; - - private final OffsetDateTime completedAt; - - private final Map additionalProperties; - - private AccountDetailsAndActions( - String id, - Optional category, - AccountDetailsAndActionsStatusEnum status, - Optional statusDetail, - Optional endUserOriginId, - String endUserOrganizationName, - String endUserEmailAddress, - Optional subdomain, - String webhookListenerUrl, - Optional isDuplicate, - Optional integration, - String accountType, - OffsetDateTime completedAt, - Map additionalProperties) { - this.id = id; - this.category = category; - this.status = status; - this.statusDetail = statusDetail; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.subdomain = subdomain; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.integration = integration; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("status") - public AccountDetailsAndActionsStatusEnum getStatus() { - return status; - } - - @JsonProperty("status_detail") - public Optional getStatusDetail() { - return statusDetail; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return The tenant or domain the customer has provided access to. - */ - @JsonProperty("subdomain") - public Optional getSubdomain() { - return subdomain; - } - - @JsonProperty("webhook_listener_url") - public String getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("account_type") - public String getAccountType() { - return accountType; - } - - @JsonProperty("completed_at") - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActions other) { - return id.equals(other.id) - && category.equals(other.category) - && status.equals(other.status) - && statusDetail.equals(other.statusDetail) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && subdomain.equals(other.subdomain) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && integration.equals(other.integration) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.category, - this.status, - this.statusDetail, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.subdomain, - this.webhookListenerUrl, - this.isDuplicate, - this.integration, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - StatusStage id(@NotNull String id); - - Builder from(AccountDetailsAndActions other); - } - - public interface StatusStage { - EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); - } - - public interface EndUserOrganizationNameStage { - EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserEmailAddressStage { - WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); - } - - public interface WebhookListenerUrlStage { - AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); - } - - public interface AccountTypeStage { - CompletedAtStage accountType(@NotNull String accountType); - } - - public interface CompletedAtStage { - _FinalStage completedAt(@NotNull OffsetDateTime completedAt); - } - - public interface _FinalStage { - AccountDetailsAndActions build(); - - _FinalStage category(Optional category); - - _FinalStage category(CategoryEnum category); - - _FinalStage statusDetail(Optional statusDetail); - - _FinalStage statusDetail(String statusDetail); - - _FinalStage endUserOriginId(Optional endUserOriginId); - - _FinalStage endUserOriginId(String endUserOriginId); - - _FinalStage subdomain(Optional subdomain); - - _FinalStage subdomain(String subdomain); - - _FinalStage isDuplicate(Optional isDuplicate); - - _FinalStage isDuplicate(Boolean isDuplicate); - - _FinalStage integration(Optional integration); - - _FinalStage integration(AccountDetailsAndActionsIntegration integration); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements IdStage, - StatusStage, - EndUserOrganizationNameStage, - EndUserEmailAddressStage, - WebhookListenerUrlStage, - AccountTypeStage, - CompletedAtStage, - _FinalStage { - private String id; - - private AccountDetailsAndActionsStatusEnum status; - - private String endUserOrganizationName; - - private String endUserEmailAddress; - - private String webhookListenerUrl; - - private String accountType; - - private OffsetDateTime completedAt; - - private Optional integration = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional subdomain = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional statusDetail = Optional.empty(); - - private Optional category = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActions other) { - id(other.getId()); - category(other.getCategory()); - status(other.getStatus()); - statusDetail(other.getStatusDetail()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - subdomain(other.getSubdomain()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - integration(other.getIntegration()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public StatusStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_email_address") - public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - @java.lang.Override - @JsonSetter("webhook_listener_url") - public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - @java.lang.Override - @JsonSetter("account_type") - public CompletedAtStage accountType(@NotNull String accountType) { - this.accountType = accountType; - return this; - } - - @java.lang.Override - @JsonSetter("completed_at") - public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - @java.lang.Override - public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public _FinalStage isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - /** - *

The tenant or domain the customer has provided access to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage subdomain(String subdomain) { - this.subdomain = Optional.ofNullable(subdomain); - return this; - } - - @java.lang.Override - @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) - public _FinalStage subdomain(Optional subdomain) { - this.subdomain = subdomain; - return this; - } - - @java.lang.Override - public _FinalStage endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public _FinalStage endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - @java.lang.Override - public _FinalStage statusDetail(String statusDetail) { - this.statusDetail = Optional.ofNullable(statusDetail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) - public _FinalStage statusDetail(Optional statusDetail) { - this.statusDetail = statusDetail; - return this; - } - - @java.lang.Override - public _FinalStage category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public _FinalStage category(Optional category) { - this.category = category; - return this; - } - - @java.lang.Override - public AccountDetailsAndActions build() { - return new AccountDetailsAndActions( - id, - category, - status, - statusDetail, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - subdomain, - webhookListenerUrl, - isDuplicate, - integration, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActionsIntegration.java deleted file mode 100644 index 5d9e39f6b..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActionsIntegration.java +++ /dev/null @@ -1,328 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) -public final class AccountDetailsAndActionsIntegration { - private final String name; - - private final List categories; - - private final Optional image; - - private final Optional squareImage; - - private final String color; - - private final String slug; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AccountDetailsAndActionsIntegration( - String name, - List categories, - Optional image, - Optional squareImage, - String color, - String slug, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.name = name; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - @JsonProperty("image") - public Optional getImage() { - return image; - } - - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - @JsonProperty("color") - public String getColor() { - return color; - } - - @JsonProperty("slug") - public String getSlug() { - return slug; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActionsIntegration - && equalTo((AccountDetailsAndActionsIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActionsIntegration other) { - return name.equals(other.name) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.passthroughAvailable, - this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - ColorStage name(@NotNull String name); - - Builder from(AccountDetailsAndActionsIntegration other); - } - - public interface ColorStage { - SlugStage color(@NotNull String color); - } - - public interface SlugStage { - PassthroughAvailableStage slug(@NotNull String slug); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AccountDetailsAndActionsIntegration build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { - private String name; - - private String color; - - private String slug; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActionsIntegration other) { - name(other.getName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public ColorStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("color") - public SlugStage color(@NotNull String color) { - this.color = color; - return this; - } - - @java.lang.Override - @JsonSetter("slug") - public PassthroughAvailableStage slug(@NotNull String slug) { - this.slug = slug; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public AccountDetailsAndActionsIntegration build() { - return new AccountDetailsAndActionsIntegration( - name, - categories, - image, - squareImage, - color, - slug, - passthroughAvailable, - availableModelOperations, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActionsStatusEnum.java deleted file mode 100644 index e279ef9ca..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AccountDetailsAndActionsStatusEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AccountDetailsAndActionsStatusEnum { - COMPLETE("COMPLETE"), - - INCOMPLETE("INCOMPLETE"), - - RELINK_NEEDED("RELINK_NEEDED"), - - IDLE("IDLE"); - - private final String value; - - AccountDetailsAndActionsStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountIntegration.java b/src/main/java/com/merge/api/resources/crm/types/AccountIntegration.java deleted file mode 100644 index 3789c4fa5..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AccountIntegration.java +++ /dev/null @@ -1,463 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountIntegration.Builder.class) -public final class AccountIntegration { - private final String name; - - private final Optional abbreviatedName; - - private final Optional> categories; - - private final Optional image; - - private final Optional squareImage; - - private final Optional color; - - private final Optional slug; - - private final Optional> apiEndpointsToDocumentationUrls; - - private final Optional webhookSetupGuideUrl; - - private final Optional> categoryBetaStatus; - - private final Map additionalProperties; - - private AccountIntegration( - String name, - Optional abbreviatedName, - Optional> categories, - Optional image, - Optional squareImage, - Optional color, - Optional slug, - Optional> apiEndpointsToDocumentationUrls, - Optional webhookSetupGuideUrl, - Optional> categoryBetaStatus, - Map additionalProperties) { - this.name = name; - this.abbreviatedName = abbreviatedName; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - this.categoryBetaStatus = categoryBetaStatus; - this.additionalProperties = additionalProperties; - } - - /** - * @return Company name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> - */ - @JsonProperty("abbreviated_name") - public Optional getAbbreviatedName() { - return abbreviatedName; - } - - /** - * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. - */ - @JsonProperty("categories") - public Optional> getCategories() { - return categories; - } - - /** - * @return Company logo in rectangular shape. - */ - @JsonProperty("image") - public Optional getImage() { - return image; - } - - /** - * @return Company logo in square shape. - */ - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - /** - * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> - */ - @JsonProperty("color") - public Optional getColor() { - return color; - } - - @JsonProperty("slug") - public Optional getSlug() { - return slug; - } - - /** - * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} - */ - @JsonProperty("api_endpoints_to_documentation_urls") - public Optional> getApiEndpointsToDocumentationUrls() { - return apiEndpointsToDocumentationUrls; - } - - /** - * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. - */ - @JsonProperty("webhook_setup_guide_url") - public Optional getWebhookSetupGuideUrl() { - return webhookSetupGuideUrl; - } - - /** - * @return Category or categories this integration is in beta status for. - */ - @JsonProperty("category_beta_status") - public Optional> getCategoryBetaStatus() { - return categoryBetaStatus; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountIntegration && equalTo((AccountIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountIntegration other) { - return name.equals(other.name) - && abbreviatedName.equals(other.abbreviatedName) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) - && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) - && categoryBetaStatus.equals(other.categoryBetaStatus); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.abbreviatedName, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.apiEndpointsToDocumentationUrls, - this.webhookSetupGuideUrl, - this.categoryBetaStatus); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(AccountIntegration other); - } - - public interface _FinalStage { - AccountIntegration build(); - - _FinalStage abbreviatedName(Optional abbreviatedName); - - _FinalStage abbreviatedName(String abbreviatedName); - - _FinalStage categories(Optional> categories); - - _FinalStage categories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage color(Optional color); - - _FinalStage color(String color); - - _FinalStage slug(Optional slug); - - _FinalStage slug(String slug); - - _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); - - _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); - - _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); - - _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); - - _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); - - _FinalStage categoryBetaStatus(Map categoryBetaStatus); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - private Optional> categoryBetaStatus = Optional.empty(); - - private Optional webhookSetupGuideUrl = Optional.empty(); - - private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); - - private Optional slug = Optional.empty(); - - private Optional color = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private Optional> categories = Optional.empty(); - - private Optional abbreviatedName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountIntegration other) { - name(other.getName()); - abbreviatedName(other.getAbbreviatedName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); - webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); - categoryBetaStatus(other.getCategoryBetaStatus()); - return this; - } - - /** - *

Company name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

Category or categories this integration is in beta status for.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { - this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) - public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { - this.categoryBetaStatus = categoryBetaStatus; - return this; - } - - /** - *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) - public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - return this; - } - - /** - *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); - return this; - } - - @java.lang.Override - @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) - public _FinalStage apiEndpointsToDocumentationUrls( - Optional> apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - return this; - } - - @java.lang.Override - public _FinalStage slug(String slug) { - this.slug = Optional.ofNullable(slug); - return this; - } - - @java.lang.Override - @JsonSetter(value = "slug", nulls = Nulls.SKIP) - public _FinalStage slug(Optional slug) { - this.slug = slug; - return this; - } - - /** - *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage color(String color) { - this.color = Optional.ofNullable(color); - return this; - } - - @java.lang.Override - @JsonSetter(value = "color", nulls = Nulls.SKIP) - public _FinalStage color(Optional color) { - this.color = color; - return this; - } - - /** - *

Company logo in square shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - /** - *

Company logo in rectangular shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - /** - *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categories(List categories) { - this.categories = Optional.ofNullable(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(Optional> categories) { - this.categories = categories; - return this; - } - - /** - *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage abbreviatedName(String abbreviatedName) { - this.abbreviatedName = Optional.ofNullable(abbreviatedName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) - public _FinalStage abbreviatedName(Optional abbreviatedName) { - this.abbreviatedName = abbreviatedName; - return this; - } - - @java.lang.Override - public AccountIntegration build() { - return new AccountIntegration( - name, - abbreviatedName, - categories, - image, - squareImage, - color, - slug, - apiEndpointsToDocumentationUrls, - webhookSetupGuideUrl, - categoryBetaStatus, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountRequest.java b/src/main/java/com/merge/api/resources/crm/types/AccountRequest.java deleted file mode 100644 index 924eb1e22..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AccountRequest.java +++ /dev/null @@ -1,384 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountRequest.Builder.class) -public final class AccountRequest { - private final Optional owner; - - private final Optional name; - - private final Optional description; - - private final Optional industry; - - private final Optional website; - - private final Optional numberOfEmployees; - - private final Optional> addresses; - - private final Optional lastActivityAt; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Optional> remoteFields; - - private final Map additionalProperties; - - private AccountRequest( - Optional owner, - Optional name, - Optional description, - Optional industry, - Optional website, - Optional numberOfEmployees, - Optional> addresses, - Optional lastActivityAt, - Optional> integrationParams, - Optional> linkedAccountParams, - Optional> remoteFields, - Map additionalProperties) { - this.owner = owner; - this.name = name; - this.description = description; - this.industry = industry; - this.website = website; - this.numberOfEmployees = numberOfEmployees; - this.addresses = addresses; - this.lastActivityAt = lastActivityAt; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.remoteFields = remoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return The account's owner. - */ - @JsonProperty("owner") - public Optional getOwner() { - return owner; - } - - /** - * @return The account's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The account's description. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return The account's industry. - */ - @JsonProperty("industry") - public Optional getIndustry() { - return industry; - } - - /** - * @return The account's website. - */ - @JsonProperty("website") - public Optional getWebsite() { - return website; - } - - /** - * @return The account's number of employees. - */ - @JsonProperty("number_of_employees") - public Optional getNumberOfEmployees() { - return numberOfEmployees; - } - - @JsonProperty("addresses") - public Optional> getAddresses() { - return addresses; - } - - /** - * @return The last date (either most recent or furthest in the future) of when an activity occurs in an account. - */ - @JsonProperty("last_activity_at") - public Optional getLastActivityAt() { - return lastActivityAt; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @JsonProperty("remote_fields") - public Optional> getRemoteFields() { - return remoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountRequest && equalTo((AccountRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountRequest other) { - return owner.equals(other.owner) - && name.equals(other.name) - && description.equals(other.description) - && industry.equals(other.industry) - && website.equals(other.website) - && numberOfEmployees.equals(other.numberOfEmployees) - && addresses.equals(other.addresses) - && lastActivityAt.equals(other.lastActivityAt) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams) - && remoteFields.equals(other.remoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.owner, - this.name, - this.description, - this.industry, - this.website, - this.numberOfEmployees, - this.addresses, - this.lastActivityAt, - this.integrationParams, - this.linkedAccountParams, - this.remoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional owner = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional industry = Optional.empty(); - - private Optional website = Optional.empty(); - - private Optional numberOfEmployees = Optional.empty(); - - private Optional> addresses = Optional.empty(); - - private Optional lastActivityAt = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - private Optional> remoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountRequest other) { - owner(other.getOwner()); - name(other.getName()); - description(other.getDescription()); - industry(other.getIndustry()); - website(other.getWebsite()); - numberOfEmployees(other.getNumberOfEmployees()); - addresses(other.getAddresses()); - lastActivityAt(other.getLastActivityAt()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - remoteFields(other.getRemoteFields()); - return this; - } - - @JsonSetter(value = "owner", nulls = Nulls.SKIP) - public Builder owner(Optional owner) { - this.owner = owner; - return this; - } - - public Builder owner(AccountRequestOwner owner) { - this.owner = Optional.ofNullable(owner); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "industry", nulls = Nulls.SKIP) - public Builder industry(Optional industry) { - this.industry = industry; - return this; - } - - public Builder industry(String industry) { - this.industry = Optional.ofNullable(industry); - return this; - } - - @JsonSetter(value = "website", nulls = Nulls.SKIP) - public Builder website(Optional website) { - this.website = website; - return this; - } - - public Builder website(String website) { - this.website = Optional.ofNullable(website); - return this; - } - - @JsonSetter(value = "number_of_employees", nulls = Nulls.SKIP) - public Builder numberOfEmployees(Optional numberOfEmployees) { - this.numberOfEmployees = numberOfEmployees; - return this; - } - - public Builder numberOfEmployees(Integer numberOfEmployees) { - this.numberOfEmployees = Optional.ofNullable(numberOfEmployees); - return this; - } - - @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional> addresses) { - this.addresses = addresses; - return this; - } - - public Builder addresses(List addresses) { - this.addresses = Optional.ofNullable(addresses); - return this; - } - - @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) - public Builder lastActivityAt(Optional lastActivityAt) { - this.lastActivityAt = lastActivityAt; - return this; - } - - public Builder lastActivityAt(OffsetDateTime lastActivityAt) { - this.lastActivityAt = Optional.ofNullable(lastActivityAt); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional> remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(List remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - public AccountRequest build() { - return new AccountRequest( - owner, - name, - description, - industry, - website, - numberOfEmployees, - addresses, - lastActivityAt, - integrationParams, - linkedAccountParams, - remoteFields, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AccountToken.java b/src/main/java/com/merge/api/resources/crm/types/AccountToken.java deleted file mode 100644 index cbcddd0be..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AccountToken.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountToken.Builder.class) -public final class AccountToken { - private final String accountToken; - - private final AccountIntegration integration; - - private final Map additionalProperties; - - private AccountToken( - String accountToken, AccountIntegration integration, Map additionalProperties) { - this.accountToken = accountToken; - this.integration = integration; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public String getAccountToken() { - return accountToken; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountToken && equalTo((AccountToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountToken other) { - return accountToken.equals(other.accountToken) && integration.equals(other.integration); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.accountToken, this.integration); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccountTokenStage builder() { - return new Builder(); - } - - public interface AccountTokenStage { - IntegrationStage accountToken(@NotNull String accountToken); - - Builder from(AccountToken other); - } - - public interface IntegrationStage { - _FinalStage integration(@NotNull AccountIntegration integration); - } - - public interface _FinalStage { - AccountToken build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountTokenStage, IntegrationStage, _FinalStage { - private String accountToken; - - private AccountIntegration integration; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountToken other) { - accountToken(other.getAccountToken()); - integration(other.getIntegration()); - return this; - } - - @java.lang.Override - @JsonSetter("account_token") - public IntegrationStage accountToken(@NotNull String accountToken) { - this.accountToken = accountToken; - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public _FinalStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - public AccountToken build() { - return new AccountToken(accountToken, integration, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ActivityTypeEnum.java b/src/main/java/com/merge/api/resources/crm/types/ActivityTypeEnum.java deleted file mode 100644 index bb20916a5..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ActivityTypeEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ActivityTypeEnum { - CALL("CALL"), - - MEETING("MEETING"), - - EMAIL("EMAIL"); - - private final String value; - - ActivityTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/Address.java b/src/main/java/com/merge/api/resources/crm/types/Address.java deleted file mode 100644 index 98ddb49c8..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/Address.java +++ /dev/null @@ -1,591 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Address.Builder.class) -public final class Address { - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional street1; - - private final Optional street2; - - private final Optional city; - - private final Optional state; - - private final Optional postalCode; - - private final Optional country; - - private final Optional addressType; - - private final Map additionalProperties; - - private Address( - Optional createdAt, - Optional modifiedAt, - Optional street1, - Optional street2, - Optional city, - Optional state, - Optional postalCode, - Optional country, - Optional addressType, - Map additionalProperties) { - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.street1 = street1; - this.street2 = street2; - this.city = city; - this.state = state; - this.postalCode = postalCode; - this.country = country; - this.addressType = addressType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return Line 1 of the address's street. - */ - @JsonProperty("street_1") - public Optional getStreet1() { - return street1; - } - - /** - * @return Line 2 of the address's street. - */ - @JsonProperty("street_2") - public Optional getStreet2() { - return street2; - } - - /** - * @return The address's city. - */ - @JsonProperty("city") - public Optional getCity() { - return city; - } - - /** - * @return The address's state. - */ - @JsonProperty("state") - public Optional getState() { - return state; - } - - /** - * @return The address's postal code. - */ - @JsonProperty("postal_code") - public Optional getPostalCode() { - return postalCode; - } - - /** - * @return The address's country. - *
    - *
  • AF - Afghanistan
  • - *
  • AX - Ã…land Islands
  • - *
  • AL - Albania
  • - *
  • DZ - Algeria
  • - *
  • AS - American Samoa
  • - *
  • AD - Andorra
  • - *
  • AO - Angola
  • - *
  • AI - Anguilla
  • - *
  • AQ - Antarctica
  • - *
  • AG - Antigua and Barbuda
  • - *
  • AR - Argentina
  • - *
  • AM - Armenia
  • - *
  • AW - Aruba
  • - *
  • AU - Australia
  • - *
  • AT - Austria
  • - *
  • AZ - Azerbaijan
  • - *
  • BS - Bahamas
  • - *
  • BH - Bahrain
  • - *
  • BD - Bangladesh
  • - *
  • BB - Barbados
  • - *
  • BY - Belarus
  • - *
  • BE - Belgium
  • - *
  • BZ - Belize
  • - *
  • BJ - Benin
  • - *
  • BM - Bermuda
  • - *
  • BT - Bhutan
  • - *
  • BO - Bolivia
  • - *
  • BQ - Bonaire, Sint Eustatius and Saba
  • - *
  • BA - Bosnia and Herzegovina
  • - *
  • BW - Botswana
  • - *
  • BV - Bouvet Island
  • - *
  • BR - Brazil
  • - *
  • IO - British Indian Ocean Territory
  • - *
  • BN - Brunei
  • - *
  • BG - Bulgaria
  • - *
  • BF - Burkina Faso
  • - *
  • BI - Burundi
  • - *
  • CV - Cabo Verde
  • - *
  • KH - Cambodia
  • - *
  • CM - Cameroon
  • - *
  • CA - Canada
  • - *
  • KY - Cayman Islands
  • - *
  • CF - Central African Republic
  • - *
  • TD - Chad
  • - *
  • CL - Chile
  • - *
  • CN - China
  • - *
  • CX - Christmas Island
  • - *
  • CC - Cocos (Keeling) Islands
  • - *
  • CO - Colombia
  • - *
  • KM - Comoros
  • - *
  • CG - Congo
  • - *
  • CD - Congo (the Democratic Republic of the)
  • - *
  • CK - Cook Islands
  • - *
  • CR - Costa Rica
  • - *
  • CI - Côte d'Ivoire
  • - *
  • HR - Croatia
  • - *
  • CU - Cuba
  • - *
  • CW - Curaçao
  • - *
  • CY - Cyprus
  • - *
  • CZ - Czechia
  • - *
  • DK - Denmark
  • - *
  • DJ - Djibouti
  • - *
  • DM - Dominica
  • - *
  • DO - Dominican Republic
  • - *
  • EC - Ecuador
  • - *
  • EG - Egypt
  • - *
  • SV - El Salvador
  • - *
  • GQ - Equatorial Guinea
  • - *
  • ER - Eritrea
  • - *
  • EE - Estonia
  • - *
  • SZ - Eswatini
  • - *
  • ET - Ethiopia
  • - *
  • FK - Falkland Islands (Malvinas)
  • - *
  • FO - Faroe Islands
  • - *
  • FJ - Fiji
  • - *
  • FI - Finland
  • - *
  • FR - France
  • - *
  • GF - French Guiana
  • - *
  • PF - French Polynesia
  • - *
  • TF - French Southern Territories
  • - *
  • GA - Gabon
  • - *
  • GM - Gambia
  • - *
  • GE - Georgia
  • - *
  • DE - Germany
  • - *
  • GH - Ghana
  • - *
  • GI - Gibraltar
  • - *
  • GR - Greece
  • - *
  • GL - Greenland
  • - *
  • GD - Grenada
  • - *
  • GP - Guadeloupe
  • - *
  • GU - Guam
  • - *
  • GT - Guatemala
  • - *
  • GG - Guernsey
  • - *
  • GN - Guinea
  • - *
  • GW - Guinea-Bissau
  • - *
  • GY - Guyana
  • - *
  • HT - Haiti
  • - *
  • HM - Heard Island and McDonald Islands
  • - *
  • VA - Holy See
  • - *
  • HN - Honduras
  • - *
  • HK - Hong Kong
  • - *
  • HU - Hungary
  • - *
  • IS - Iceland
  • - *
  • IN - India
  • - *
  • ID - Indonesia
  • - *
  • IR - Iran
  • - *
  • IQ - Iraq
  • - *
  • IE - Ireland
  • - *
  • IM - Isle of Man
  • - *
  • IL - Israel
  • - *
  • IT - Italy
  • - *
  • JM - Jamaica
  • - *
  • JP - Japan
  • - *
  • JE - Jersey
  • - *
  • JO - Jordan
  • - *
  • KZ - Kazakhstan
  • - *
  • KE - Kenya
  • - *
  • KI - Kiribati
  • - *
  • KW - Kuwait
  • - *
  • KG - Kyrgyzstan
  • - *
  • LA - Laos
  • - *
  • LV - Latvia
  • - *
  • LB - Lebanon
  • - *
  • LS - Lesotho
  • - *
  • LR - Liberia
  • - *
  • LY - Libya
  • - *
  • LI - Liechtenstein
  • - *
  • LT - Lithuania
  • - *
  • LU - Luxembourg
  • - *
  • MO - Macao
  • - *
  • MG - Madagascar
  • - *
  • MW - Malawi
  • - *
  • MY - Malaysia
  • - *
  • MV - Maldives
  • - *
  • ML - Mali
  • - *
  • MT - Malta
  • - *
  • MH - Marshall Islands
  • - *
  • MQ - Martinique
  • - *
  • MR - Mauritania
  • - *
  • MU - Mauritius
  • - *
  • YT - Mayotte
  • - *
  • MX - Mexico
  • - *
  • FM - Micronesia (Federated States of)
  • - *
  • MD - Moldova
  • - *
  • MC - Monaco
  • - *
  • MN - Mongolia
  • - *
  • ME - Montenegro
  • - *
  • MS - Montserrat
  • - *
  • MA - Morocco
  • - *
  • MZ - Mozambique
  • - *
  • MM - Myanmar
  • - *
  • NA - Namibia
  • - *
  • NR - Nauru
  • - *
  • NP - Nepal
  • - *
  • NL - Netherlands
  • - *
  • NC - New Caledonia
  • - *
  • NZ - New Zealand
  • - *
  • NI - Nicaragua
  • - *
  • NE - Niger
  • - *
  • NG - Nigeria
  • - *
  • NU - Niue
  • - *
  • NF - Norfolk Island
  • - *
  • KP - North Korea
  • - *
  • MK - North Macedonia
  • - *
  • MP - Northern Mariana Islands
  • - *
  • NO - Norway
  • - *
  • OM - Oman
  • - *
  • PK - Pakistan
  • - *
  • PW - Palau
  • - *
  • PS - Palestine, State of
  • - *
  • PA - Panama
  • - *
  • PG - Papua New Guinea
  • - *
  • PY - Paraguay
  • - *
  • PE - Peru
  • - *
  • PH - Philippines
  • - *
  • PN - Pitcairn
  • - *
  • PL - Poland
  • - *
  • PT - Portugal
  • - *
  • PR - Puerto Rico
  • - *
  • QA - Qatar
  • - *
  • RE - Réunion
  • - *
  • RO - Romania
  • - *
  • RU - Russia
  • - *
  • RW - Rwanda
  • - *
  • BL - Saint Barthélemy
  • - *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • - *
  • KN - Saint Kitts and Nevis
  • - *
  • LC - Saint Lucia
  • - *
  • MF - Saint Martin (French part)
  • - *
  • PM - Saint Pierre and Miquelon
  • - *
  • VC - Saint Vincent and the Grenadines
  • - *
  • WS - Samoa
  • - *
  • SM - San Marino
  • - *
  • ST - Sao Tome and Principe
  • - *
  • SA - Saudi Arabia
  • - *
  • SN - Senegal
  • - *
  • RS - Serbia
  • - *
  • SC - Seychelles
  • - *
  • SL - Sierra Leone
  • - *
  • SG - Singapore
  • - *
  • SX - Sint Maarten (Dutch part)
  • - *
  • SK - Slovakia
  • - *
  • SI - Slovenia
  • - *
  • SB - Solomon Islands
  • - *
  • SO - Somalia
  • - *
  • ZA - South Africa
  • - *
  • GS - South Georgia and the South Sandwich Islands
  • - *
  • KR - South Korea
  • - *
  • SS - South Sudan
  • - *
  • ES - Spain
  • - *
  • LK - Sri Lanka
  • - *
  • SD - Sudan
  • - *
  • SR - Suriname
  • - *
  • SJ - Svalbard and Jan Mayen
  • - *
  • SE - Sweden
  • - *
  • CH - Switzerland
  • - *
  • SY - Syria
  • - *
  • TW - Taiwan
  • - *
  • TJ - Tajikistan
  • - *
  • TZ - Tanzania
  • - *
  • TH - Thailand
  • - *
  • TL - Timor-Leste
  • - *
  • TG - Togo
  • - *
  • TK - Tokelau
  • - *
  • TO - Tonga
  • - *
  • TT - Trinidad and Tobago
  • - *
  • TN - Tunisia
  • - *
  • TR - Turkey
  • - *
  • TM - Turkmenistan
  • - *
  • TC - Turks and Caicos Islands
  • - *
  • TV - Tuvalu
  • - *
  • UG - Uganda
  • - *
  • UA - Ukraine
  • - *
  • AE - United Arab Emirates
  • - *
  • GB - United Kingdom
  • - *
  • UM - United States Minor Outlying Islands
  • - *
  • US - United States of America
  • - *
  • UY - Uruguay
  • - *
  • UZ - Uzbekistan
  • - *
  • VU - Vanuatu
  • - *
  • VE - Venezuela
  • - *
  • VN - Vietnam
  • - *
  • VG - Virgin Islands (British)
  • - *
  • VI - Virgin Islands (U.S.)
  • - *
  • WF - Wallis and Futuna
  • - *
  • EH - Western Sahara
  • - *
  • YE - Yemen
  • - *
  • ZM - Zambia
  • - *
  • ZW - Zimbabwe
  • - *
- */ - @JsonProperty("country") - public Optional getCountry() { - return country; - } - - /** - * @return The address type. - *
    - *
  • BILLING - BILLING
  • - *
  • SHIPPING - SHIPPING
  • - *
- */ - @JsonProperty("address_type") - public Optional getAddressType() { - return addressType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Address && equalTo((Address) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Address other) { - return createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && street1.equals(other.street1) - && street2.equals(other.street2) - && city.equals(other.city) - && state.equals(other.state) - && postalCode.equals(other.postalCode) - && country.equals(other.country) - && addressType.equals(other.addressType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAt, - this.modifiedAt, - this.street1, - this.street2, - this.city, - this.state, - this.postalCode, - this.country, - this.addressType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional street1 = Optional.empty(); - - private Optional street2 = Optional.empty(); - - private Optional city = Optional.empty(); - - private Optional state = Optional.empty(); - - private Optional postalCode = Optional.empty(); - - private Optional country = Optional.empty(); - - private Optional addressType = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Address other) { - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - street1(other.getStreet1()); - street2(other.getStreet2()); - city(other.getCity()); - state(other.getState()); - postalCode(other.getPostalCode()); - country(other.getCountry()); - addressType(other.getAddressType()); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "street_1", nulls = Nulls.SKIP) - public Builder street1(Optional street1) { - this.street1 = street1; - return this; - } - - public Builder street1(String street1) { - this.street1 = Optional.ofNullable(street1); - return this; - } - - @JsonSetter(value = "street_2", nulls = Nulls.SKIP) - public Builder street2(Optional street2) { - this.street2 = street2; - return this; - } - - public Builder street2(String street2) { - this.street2 = Optional.ofNullable(street2); - return this; - } - - @JsonSetter(value = "city", nulls = Nulls.SKIP) - public Builder city(Optional city) { - this.city = city; - return this; - } - - public Builder city(String city) { - this.city = Optional.ofNullable(city); - return this; - } - - @JsonSetter(value = "state", nulls = Nulls.SKIP) - public Builder state(Optional state) { - this.state = state; - return this; - } - - public Builder state(String state) { - this.state = Optional.ofNullable(state); - return this; - } - - @JsonSetter(value = "postal_code", nulls = Nulls.SKIP) - public Builder postalCode(Optional postalCode) { - this.postalCode = postalCode; - return this; - } - - public Builder postalCode(String postalCode) { - this.postalCode = Optional.ofNullable(postalCode); - return this; - } - - @JsonSetter(value = "country", nulls = Nulls.SKIP) - public Builder country(Optional country) { - this.country = country; - return this; - } - - public Builder country(AddressCountry country) { - this.country = Optional.ofNullable(country); - return this; - } - - @JsonSetter(value = "address_type", nulls = Nulls.SKIP) - public Builder addressType(Optional addressType) { - this.addressType = addressType; - return this; - } - - public Builder addressType(AddressAddressType addressType) { - this.addressType = Optional.ofNullable(addressType); - return this; - } - - public Address build() { - return new Address( - createdAt, - modifiedAt, - street1, - street2, - city, - state, - postalCode, - country, - addressType, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AddressAddressType.java b/src/main/java/com/merge/api/resources/crm/types/AddressAddressType.java deleted file mode 100644 index 1e4194254..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AddressAddressType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressAddressType.Deserializer.class) -public final class AddressAddressType { - private final Object value; - - private final int type; - - private AddressAddressType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AddressTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressAddressType && equalTo((AddressAddressType) other); - } - - private boolean equalTo(AddressAddressType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressAddressType of(AddressTypeEnum value) { - return new AddressAddressType(value, 0); - } - - public static AddressAddressType of(String value) { - return new AddressAddressType(value, 1); - } - - public interface Visitor { - T visit(AddressTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressAddressType.class); - } - - @java.lang.Override - public AddressAddressType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AddressTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AddressCountry.java b/src/main/java/com/merge/api/resources/crm/types/AddressCountry.java deleted file mode 100644 index 5b2be98d1..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AddressCountry.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressCountry.Deserializer.class) -public final class AddressCountry { - private final Object value; - - private final int type; - - private AddressCountry(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CountryEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressCountry && equalTo((AddressCountry) other); - } - - private boolean equalTo(AddressCountry other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressCountry of(CountryEnum value) { - return new AddressCountry(value, 0); - } - - public static AddressCountry of(String value) { - return new AddressCountry(value, 1); - } - - public interface Visitor { - T visit(CountryEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressCountry.class); - } - - @java.lang.Override - public AddressCountry deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CountryEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AddressRequest.java b/src/main/java/com/merge/api/resources/crm/types/AddressRequest.java deleted file mode 100644 index 3473fed69..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AddressRequest.java +++ /dev/null @@ -1,585 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AddressRequest.Builder.class) -public final class AddressRequest { - private final Optional street1; - - private final Optional street2; - - private final Optional city; - - private final Optional state; - - private final Optional postalCode; - - private final Optional country; - - private final Optional addressType; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private AddressRequest( - Optional street1, - Optional street2, - Optional city, - Optional state, - Optional postalCode, - Optional country, - Optional addressType, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.street1 = street1; - this.street2 = street2; - this.city = city; - this.state = state; - this.postalCode = postalCode; - this.country = country; - this.addressType = addressType; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return Line 1 of the address's street. - */ - @JsonProperty("street_1") - public Optional getStreet1() { - return street1; - } - - /** - * @return Line 2 of the address's street. - */ - @JsonProperty("street_2") - public Optional getStreet2() { - return street2; - } - - /** - * @return The address's city. - */ - @JsonProperty("city") - public Optional getCity() { - return city; - } - - /** - * @return The address's state. - */ - @JsonProperty("state") - public Optional getState() { - return state; - } - - /** - * @return The address's postal code. - */ - @JsonProperty("postal_code") - public Optional getPostalCode() { - return postalCode; - } - - /** - * @return The address's country. - *
    - *
  • AF - Afghanistan
  • - *
  • AX - Ã…land Islands
  • - *
  • AL - Albania
  • - *
  • DZ - Algeria
  • - *
  • AS - American Samoa
  • - *
  • AD - Andorra
  • - *
  • AO - Angola
  • - *
  • AI - Anguilla
  • - *
  • AQ - Antarctica
  • - *
  • AG - Antigua and Barbuda
  • - *
  • AR - Argentina
  • - *
  • AM - Armenia
  • - *
  • AW - Aruba
  • - *
  • AU - Australia
  • - *
  • AT - Austria
  • - *
  • AZ - Azerbaijan
  • - *
  • BS - Bahamas
  • - *
  • BH - Bahrain
  • - *
  • BD - Bangladesh
  • - *
  • BB - Barbados
  • - *
  • BY - Belarus
  • - *
  • BE - Belgium
  • - *
  • BZ - Belize
  • - *
  • BJ - Benin
  • - *
  • BM - Bermuda
  • - *
  • BT - Bhutan
  • - *
  • BO - Bolivia
  • - *
  • BQ - Bonaire, Sint Eustatius and Saba
  • - *
  • BA - Bosnia and Herzegovina
  • - *
  • BW - Botswana
  • - *
  • BV - Bouvet Island
  • - *
  • BR - Brazil
  • - *
  • IO - British Indian Ocean Territory
  • - *
  • BN - Brunei
  • - *
  • BG - Bulgaria
  • - *
  • BF - Burkina Faso
  • - *
  • BI - Burundi
  • - *
  • CV - Cabo Verde
  • - *
  • KH - Cambodia
  • - *
  • CM - Cameroon
  • - *
  • CA - Canada
  • - *
  • KY - Cayman Islands
  • - *
  • CF - Central African Republic
  • - *
  • TD - Chad
  • - *
  • CL - Chile
  • - *
  • CN - China
  • - *
  • CX - Christmas Island
  • - *
  • CC - Cocos (Keeling) Islands
  • - *
  • CO - Colombia
  • - *
  • KM - Comoros
  • - *
  • CG - Congo
  • - *
  • CD - Congo (the Democratic Republic of the)
  • - *
  • CK - Cook Islands
  • - *
  • CR - Costa Rica
  • - *
  • CI - Côte d'Ivoire
  • - *
  • HR - Croatia
  • - *
  • CU - Cuba
  • - *
  • CW - Curaçao
  • - *
  • CY - Cyprus
  • - *
  • CZ - Czechia
  • - *
  • DK - Denmark
  • - *
  • DJ - Djibouti
  • - *
  • DM - Dominica
  • - *
  • DO - Dominican Republic
  • - *
  • EC - Ecuador
  • - *
  • EG - Egypt
  • - *
  • SV - El Salvador
  • - *
  • GQ - Equatorial Guinea
  • - *
  • ER - Eritrea
  • - *
  • EE - Estonia
  • - *
  • SZ - Eswatini
  • - *
  • ET - Ethiopia
  • - *
  • FK - Falkland Islands (Malvinas)
  • - *
  • FO - Faroe Islands
  • - *
  • FJ - Fiji
  • - *
  • FI - Finland
  • - *
  • FR - France
  • - *
  • GF - French Guiana
  • - *
  • PF - French Polynesia
  • - *
  • TF - French Southern Territories
  • - *
  • GA - Gabon
  • - *
  • GM - Gambia
  • - *
  • GE - Georgia
  • - *
  • DE - Germany
  • - *
  • GH - Ghana
  • - *
  • GI - Gibraltar
  • - *
  • GR - Greece
  • - *
  • GL - Greenland
  • - *
  • GD - Grenada
  • - *
  • GP - Guadeloupe
  • - *
  • GU - Guam
  • - *
  • GT - Guatemala
  • - *
  • GG - Guernsey
  • - *
  • GN - Guinea
  • - *
  • GW - Guinea-Bissau
  • - *
  • GY - Guyana
  • - *
  • HT - Haiti
  • - *
  • HM - Heard Island and McDonald Islands
  • - *
  • VA - Holy See
  • - *
  • HN - Honduras
  • - *
  • HK - Hong Kong
  • - *
  • HU - Hungary
  • - *
  • IS - Iceland
  • - *
  • IN - India
  • - *
  • ID - Indonesia
  • - *
  • IR - Iran
  • - *
  • IQ - Iraq
  • - *
  • IE - Ireland
  • - *
  • IM - Isle of Man
  • - *
  • IL - Israel
  • - *
  • IT - Italy
  • - *
  • JM - Jamaica
  • - *
  • JP - Japan
  • - *
  • JE - Jersey
  • - *
  • JO - Jordan
  • - *
  • KZ - Kazakhstan
  • - *
  • KE - Kenya
  • - *
  • KI - Kiribati
  • - *
  • KW - Kuwait
  • - *
  • KG - Kyrgyzstan
  • - *
  • LA - Laos
  • - *
  • LV - Latvia
  • - *
  • LB - Lebanon
  • - *
  • LS - Lesotho
  • - *
  • LR - Liberia
  • - *
  • LY - Libya
  • - *
  • LI - Liechtenstein
  • - *
  • LT - Lithuania
  • - *
  • LU - Luxembourg
  • - *
  • MO - Macao
  • - *
  • MG - Madagascar
  • - *
  • MW - Malawi
  • - *
  • MY - Malaysia
  • - *
  • MV - Maldives
  • - *
  • ML - Mali
  • - *
  • MT - Malta
  • - *
  • MH - Marshall Islands
  • - *
  • MQ - Martinique
  • - *
  • MR - Mauritania
  • - *
  • MU - Mauritius
  • - *
  • YT - Mayotte
  • - *
  • MX - Mexico
  • - *
  • FM - Micronesia (Federated States of)
  • - *
  • MD - Moldova
  • - *
  • MC - Monaco
  • - *
  • MN - Mongolia
  • - *
  • ME - Montenegro
  • - *
  • MS - Montserrat
  • - *
  • MA - Morocco
  • - *
  • MZ - Mozambique
  • - *
  • MM - Myanmar
  • - *
  • NA - Namibia
  • - *
  • NR - Nauru
  • - *
  • NP - Nepal
  • - *
  • NL - Netherlands
  • - *
  • NC - New Caledonia
  • - *
  • NZ - New Zealand
  • - *
  • NI - Nicaragua
  • - *
  • NE - Niger
  • - *
  • NG - Nigeria
  • - *
  • NU - Niue
  • - *
  • NF - Norfolk Island
  • - *
  • KP - North Korea
  • - *
  • MK - North Macedonia
  • - *
  • MP - Northern Mariana Islands
  • - *
  • NO - Norway
  • - *
  • OM - Oman
  • - *
  • PK - Pakistan
  • - *
  • PW - Palau
  • - *
  • PS - Palestine, State of
  • - *
  • PA - Panama
  • - *
  • PG - Papua New Guinea
  • - *
  • PY - Paraguay
  • - *
  • PE - Peru
  • - *
  • PH - Philippines
  • - *
  • PN - Pitcairn
  • - *
  • PL - Poland
  • - *
  • PT - Portugal
  • - *
  • PR - Puerto Rico
  • - *
  • QA - Qatar
  • - *
  • RE - Réunion
  • - *
  • RO - Romania
  • - *
  • RU - Russia
  • - *
  • RW - Rwanda
  • - *
  • BL - Saint Barthélemy
  • - *
  • SH - Saint Helena, Ascension and Tristan da Cunha
  • - *
  • KN - Saint Kitts and Nevis
  • - *
  • LC - Saint Lucia
  • - *
  • MF - Saint Martin (French part)
  • - *
  • PM - Saint Pierre and Miquelon
  • - *
  • VC - Saint Vincent and the Grenadines
  • - *
  • WS - Samoa
  • - *
  • SM - San Marino
  • - *
  • ST - Sao Tome and Principe
  • - *
  • SA - Saudi Arabia
  • - *
  • SN - Senegal
  • - *
  • RS - Serbia
  • - *
  • SC - Seychelles
  • - *
  • SL - Sierra Leone
  • - *
  • SG - Singapore
  • - *
  • SX - Sint Maarten (Dutch part)
  • - *
  • SK - Slovakia
  • - *
  • SI - Slovenia
  • - *
  • SB - Solomon Islands
  • - *
  • SO - Somalia
  • - *
  • ZA - South Africa
  • - *
  • GS - South Georgia and the South Sandwich Islands
  • - *
  • KR - South Korea
  • - *
  • SS - South Sudan
  • - *
  • ES - Spain
  • - *
  • LK - Sri Lanka
  • - *
  • SD - Sudan
  • - *
  • SR - Suriname
  • - *
  • SJ - Svalbard and Jan Mayen
  • - *
  • SE - Sweden
  • - *
  • CH - Switzerland
  • - *
  • SY - Syria
  • - *
  • TW - Taiwan
  • - *
  • TJ - Tajikistan
  • - *
  • TZ - Tanzania
  • - *
  • TH - Thailand
  • - *
  • TL - Timor-Leste
  • - *
  • TG - Togo
  • - *
  • TK - Tokelau
  • - *
  • TO - Tonga
  • - *
  • TT - Trinidad and Tobago
  • - *
  • TN - Tunisia
  • - *
  • TR - Turkey
  • - *
  • TM - Turkmenistan
  • - *
  • TC - Turks and Caicos Islands
  • - *
  • TV - Tuvalu
  • - *
  • UG - Uganda
  • - *
  • UA - Ukraine
  • - *
  • AE - United Arab Emirates
  • - *
  • GB - United Kingdom
  • - *
  • UM - United States Minor Outlying Islands
  • - *
  • US - United States of America
  • - *
  • UY - Uruguay
  • - *
  • UZ - Uzbekistan
  • - *
  • VU - Vanuatu
  • - *
  • VE - Venezuela
  • - *
  • VN - Vietnam
  • - *
  • VG - Virgin Islands (British)
  • - *
  • VI - Virgin Islands (U.S.)
  • - *
  • WF - Wallis and Futuna
  • - *
  • EH - Western Sahara
  • - *
  • YE - Yemen
  • - *
  • ZM - Zambia
  • - *
  • ZW - Zimbabwe
  • - *
- */ - @JsonProperty("country") - public Optional getCountry() { - return country; - } - - /** - * @return The address type. - *
    - *
  • BILLING - BILLING
  • - *
  • SHIPPING - SHIPPING
  • - *
- */ - @JsonProperty("address_type") - public Optional getAddressType() { - return addressType; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressRequest && equalTo((AddressRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AddressRequest other) { - return street1.equals(other.street1) - && street2.equals(other.street2) - && city.equals(other.city) - && state.equals(other.state) - && postalCode.equals(other.postalCode) - && country.equals(other.country) - && addressType.equals(other.addressType) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.street1, - this.street2, - this.city, - this.state, - this.postalCode, - this.country, - this.addressType, - this.integrationParams, - this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional street1 = Optional.empty(); - - private Optional street2 = Optional.empty(); - - private Optional city = Optional.empty(); - - private Optional state = Optional.empty(); - - private Optional postalCode = Optional.empty(); - - private Optional country = Optional.empty(); - - private Optional addressType = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AddressRequest other) { - street1(other.getStreet1()); - street2(other.getStreet2()); - city(other.getCity()); - state(other.getState()); - postalCode(other.getPostalCode()); - country(other.getCountry()); - addressType(other.getAddressType()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "street_1", nulls = Nulls.SKIP) - public Builder street1(Optional street1) { - this.street1 = street1; - return this; - } - - public Builder street1(String street1) { - this.street1 = Optional.ofNullable(street1); - return this; - } - - @JsonSetter(value = "street_2", nulls = Nulls.SKIP) - public Builder street2(Optional street2) { - this.street2 = street2; - return this; - } - - public Builder street2(String street2) { - this.street2 = Optional.ofNullable(street2); - return this; - } - - @JsonSetter(value = "city", nulls = Nulls.SKIP) - public Builder city(Optional city) { - this.city = city; - return this; - } - - public Builder city(String city) { - this.city = Optional.ofNullable(city); - return this; - } - - @JsonSetter(value = "state", nulls = Nulls.SKIP) - public Builder state(Optional state) { - this.state = state; - return this; - } - - public Builder state(String state) { - this.state = Optional.ofNullable(state); - return this; - } - - @JsonSetter(value = "postal_code", nulls = Nulls.SKIP) - public Builder postalCode(Optional postalCode) { - this.postalCode = postalCode; - return this; - } - - public Builder postalCode(String postalCode) { - this.postalCode = Optional.ofNullable(postalCode); - return this; - } - - @JsonSetter(value = "country", nulls = Nulls.SKIP) - public Builder country(Optional country) { - this.country = country; - return this; - } - - public Builder country(AddressRequestCountry country) { - this.country = Optional.ofNullable(country); - return this; - } - - @JsonSetter(value = "address_type", nulls = Nulls.SKIP) - public Builder addressType(Optional addressType) { - this.addressType = addressType; - return this; - } - - public Builder addressType(AddressRequestAddressType addressType) { - this.addressType = Optional.ofNullable(addressType); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public AddressRequest build() { - return new AddressRequest( - street1, - street2, - city, - state, - postalCode, - country, - addressType, - integrationParams, - linkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AddressRequestAddressType.java b/src/main/java/com/merge/api/resources/crm/types/AddressRequestAddressType.java deleted file mode 100644 index 9af166933..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AddressRequestAddressType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressRequestAddressType.Deserializer.class) -public final class AddressRequestAddressType { - private final Object value; - - private final int type; - - private AddressRequestAddressType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AddressTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressRequestAddressType && equalTo((AddressRequestAddressType) other); - } - - private boolean equalTo(AddressRequestAddressType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressRequestAddressType of(AddressTypeEnum value) { - return new AddressRequestAddressType(value, 0); - } - - public static AddressRequestAddressType of(String value) { - return new AddressRequestAddressType(value, 1); - } - - public interface Visitor { - T visit(AddressTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressRequestAddressType.class); - } - - @java.lang.Override - public AddressRequestAddressType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AddressTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AddressRequestCountry.java b/src/main/java/com/merge/api/resources/crm/types/AddressRequestCountry.java deleted file mode 100644 index 90ed1d278..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AddressRequestCountry.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AddressRequestCountry.Deserializer.class) -public final class AddressRequestCountry { - private final Object value; - - private final int type; - - private AddressRequestCountry(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CountryEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AddressRequestCountry && equalTo((AddressRequestCountry) other); - } - - private boolean equalTo(AddressRequestCountry other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AddressRequestCountry of(CountryEnum value) { - return new AddressRequestCountry(value, 0); - } - - public static AddressRequestCountry of(String value) { - return new AddressRequestCountry(value, 1); - } - - public interface Visitor { - T visit(CountryEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AddressRequestCountry.class); - } - - @java.lang.Override - public AddressRequestCountry deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CountryEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AddressTypeEnum.java b/src/main/java/com/merge/api/resources/crm/types/AddressTypeEnum.java deleted file mode 100644 index f808fce0e..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AddressTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AddressTypeEnum { - BILLING("BILLING"), - - SHIPPING("SHIPPING"); - - private final String value; - - AddressTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AdvancedMetadata.java b/src/main/java/com/merge/api/resources/crm/types/AdvancedMetadata.java deleted file mode 100644 index b3943a233..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AdvancedMetadata.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedMetadata.Builder.class) -public final class AdvancedMetadata { - private final String id; - - private final Optional displayName; - - private final Optional description; - - private final Optional isRequired; - - private final Optional isCustom; - - private final Optional> fieldChoices; - - private final Map additionalProperties; - - private AdvancedMetadata( - String id, - Optional displayName, - Optional description, - Optional isRequired, - Optional isCustom, - Optional> fieldChoices, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.description = description; - this.isRequired = isRequired; - this.isCustom = isCustom; - this.fieldChoices = fieldChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedMetadata other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && description.equals(other.description) - && isRequired.equals(other.isRequired) - && isCustom.equals(other.isCustom) - && fieldChoices.equals(other.fieldChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - _FinalStage id(@NotNull String id); - - Builder from(AdvancedMetadata other); - } - - public interface _FinalStage { - AdvancedMetadata build(); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage description(Optional description); - - _FinalStage description(String description); - - _FinalStage isRequired(Optional isRequired); - - _FinalStage isRequired(Boolean isRequired); - - _FinalStage isCustom(Optional isCustom); - - _FinalStage isCustom(Boolean isCustom); - - _FinalStage fieldChoices(Optional> fieldChoices); - - _FinalStage fieldChoices(List fieldChoices); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, _FinalStage { - private String id; - - private Optional> fieldChoices = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedMetadata other) { - id(other.getId()); - displayName(other.getDisplayName()); - description(other.getDescription()); - isRequired(other.getIsRequired()); - isCustom(other.getIsCustom()); - fieldChoices(other.getFieldChoices()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public _FinalStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - public _FinalStage fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public _FinalStage fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - @java.lang.Override - public _FinalStage isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public _FinalStage isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - @java.lang.Override - public _FinalStage isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public _FinalStage isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - @java.lang.Override - public _FinalStage description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @java.lang.Override - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public _FinalStage description(Optional description) { - this.description = description; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - @java.lang.Override - public AdvancedMetadata build() { - return new AdvancedMetadata( - id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AssociationTypeCardinality.java b/src/main/java/com/merge/api/resources/crm/types/AssociationTypeCardinality.java deleted file mode 100644 index 1f72efcff..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AssociationTypeCardinality.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AssociationTypeCardinality.Deserializer.class) -public final class AssociationTypeCardinality { - private final Object value; - - private final int type; - - private AssociationTypeCardinality(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CardinalityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AssociationTypeCardinality && equalTo((AssociationTypeCardinality) other); - } - - private boolean equalTo(AssociationTypeCardinality other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AssociationTypeCardinality of(CardinalityEnum value) { - return new AssociationTypeCardinality(value, 0); - } - - public static AssociationTypeCardinality of(String value) { - return new AssociationTypeCardinality(value, 1); - } - - public interface Visitor { - T visit(CardinalityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AssociationTypeCardinality.class); - } - - @java.lang.Override - public AssociationTypeCardinality deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CardinalityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/resources/crm/types/AsyncPassthroughReciept.java deleted file mode 100644 index 777530118..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AsyncPassthroughReciept.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) -public final class AsyncPassthroughReciept { - private final String asyncPassthroughReceiptId; - - private final Map additionalProperties; - - private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("async_passthrough_receipt_id") - public String getAsyncPassthroughReceiptId() { - return asyncPassthroughReceiptId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AsyncPassthroughReciept other) { - return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncPassthroughReceiptId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AsyncPassthroughReceiptIdStage builder() { - return new Builder(); - } - - public interface AsyncPassthroughReceiptIdStage { - _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); - - Builder from(AsyncPassthroughReciept other); - } - - public interface _FinalStage { - AsyncPassthroughReciept build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { - private String asyncPassthroughReceiptId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AsyncPassthroughReciept other) { - asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); - return this; - } - - @java.lang.Override - @JsonSetter("async_passthrough_receipt_id") - public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - return this; - } - - @java.lang.Override - public AsyncPassthroughReciept build() { - return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AuditLogEvent.java b/src/main/java/com/merge/api/resources/crm/types/AuditLogEvent.java deleted file mode 100644 index 0cb9917e9..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AuditLogEvent.java +++ /dev/null @@ -1,447 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditLogEvent.Builder.class) -public final class AuditLogEvent { - private final Optional id; - - private final Optional userName; - - private final Optional userEmail; - - private final AuditLogEventRole role; - - private final String ipAddress; - - private final AuditLogEventEventType eventType; - - private final String eventDescription; - - private final Optional createdAt; - - private final Map additionalProperties; - - private AuditLogEvent( - Optional id, - Optional userName, - Optional userEmail, - AuditLogEventRole role, - String ipAddress, - AuditLogEventEventType eventType, - String eventDescription, - Optional createdAt, - Map additionalProperties) { - this.id = id; - this.userName = userName; - this.userEmail = userEmail; - this.role = role; - this.ipAddress = ipAddress; - this.eventType = eventType; - this.eventDescription = eventDescription; - this.createdAt = createdAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The User's full name at the time of this Event occurring. - */ - @JsonProperty("user_name") - public Optional getUserName() { - return userName; - } - - /** - * @return The User's email at the time of this Event occurring. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - /** - * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. - *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- */ - @JsonProperty("role") - public AuditLogEventRole getRole() { - return role; - } - - @JsonProperty("ip_address") - public String getIpAddress() { - return ipAddress; - } - - /** - * @return Designates the type of event that occurred. - *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- */ - @JsonProperty("event_type") - public AuditLogEventEventType getEventType() { - return eventType; - } - - @JsonProperty("event_description") - public String getEventDescription() { - return eventDescription; - } - - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditLogEvent other) { - return id.equals(other.id) - && userName.equals(other.userName) - && userEmail.equals(other.userEmail) - && role.equals(other.role) - && ipAddress.equals(other.ipAddress) - && eventType.equals(other.eventType) - && eventDescription.equals(other.eventDescription) - && createdAt.equals(other.createdAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.userName, - this.userEmail, - this.role, - this.ipAddress, - this.eventType, - this.eventDescription, - this.createdAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RoleStage builder() { - return new Builder(); - } - - public interface RoleStage { - IpAddressStage role(@NotNull AuditLogEventRole role); - - Builder from(AuditLogEvent other); - } - - public interface IpAddressStage { - EventTypeStage ipAddress(@NotNull String ipAddress); - } - - public interface EventTypeStage { - EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); - } - - public interface EventDescriptionStage { - _FinalStage eventDescription(@NotNull String eventDescription); - } - - public interface _FinalStage { - AuditLogEvent build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage userName(Optional userName); - - _FinalStage userName(String userName); - - _FinalStage userEmail(Optional userEmail); - - _FinalStage userEmail(String userEmail); - - _FinalStage createdAt(Optional createdAt); - - _FinalStage createdAt(OffsetDateTime createdAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { - private AuditLogEventRole role; - - private String ipAddress; - - private AuditLogEventEventType eventType; - - private String eventDescription; - - private Optional createdAt = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - private Optional userName = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AuditLogEvent other) { - id(other.getId()); - userName(other.getUserName()); - userEmail(other.getUserEmail()); - role(other.getRole()); - ipAddress(other.getIpAddress()); - eventType(other.getEventType()); - eventDescription(other.getEventDescription()); - createdAt(other.getCreatedAt()); - return this; - } - - /** - *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

- *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("role") - public IpAddressStage role(@NotNull AuditLogEventRole role) { - this.role = role; - return this; - } - - @java.lang.Override - @JsonSetter("ip_address") - public EventTypeStage ipAddress(@NotNull String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - *

Designates the type of event that occurred.

- *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("event_type") - public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { - this.eventType = eventType; - return this; - } - - @java.lang.Override - @JsonSetter("event_description") - public _FinalStage eventDescription(@NotNull String eventDescription) { - this.eventDescription = eventDescription; - return this; - } - - @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public _FinalStage createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The User's email at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public _FinalStage userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - *

The User's full name at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userName(String userName) { - this.userName = Optional.ofNullable(userName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_name", nulls = Nulls.SKIP) - public _FinalStage userName(Optional userName) { - this.userName = userName; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public AuditLogEvent build() { - return new AuditLogEvent( - id, - userName, - userEmail, - role, - ipAddress, - eventType, - eventDescription, - createdAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/resources/crm/types/AuditLogEventEventType.java deleted file mode 100644 index 2b4b02e8a..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AuditLogEventEventType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) -public final class AuditLogEventEventType { - private final Object value; - - private final int type; - - private AuditLogEventEventType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EventTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); - } - - private boolean equalTo(AuditLogEventEventType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventEventType of(EventTypeEnum value) { - return new AuditLogEventEventType(value, 0); - } - - public static AuditLogEventEventType of(String value) { - return new AuditLogEventEventType(value, 1); - } - - public interface Visitor { - T visit(EventTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventEventType.class); - } - - @java.lang.Override - public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AuditLogEventRole.java b/src/main/java/com/merge/api/resources/crm/types/AuditLogEventRole.java deleted file mode 100644 index d546d9e53..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AuditLogEventRole.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) -public final class AuditLogEventRole { - private final Object value; - - private final int type; - - private AuditLogEventRole(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RoleEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); - } - - private boolean equalTo(AuditLogEventRole other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventRole of(RoleEnum value) { - return new AuditLogEventRole(value, 0); - } - - public static AuditLogEventRole of(String value) { - return new AuditLogEventRole(value, 1); - } - - public interface Visitor { - T visit(RoleEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventRole.class); - } - - @java.lang.Override - public AuditLogEventRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/AvailableActions.java b/src/main/java/com/merge/api/resources/crm/types/AvailableActions.java deleted file mode 100644 index 700204186..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/AvailableActions.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AvailableActions.Builder.class) -public final class AvailableActions { - private final AccountIntegration integration; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AvailableActions( - AccountIntegration integration, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.integration = integration; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AvailableActions && equalTo((AvailableActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AvailableActions other) { - return integration.equals(other.integration) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IntegrationStage builder() { - return new Builder(); - } - - public interface IntegrationStage { - PassthroughAvailableStage integration(@NotNull AccountIntegration integration); - - Builder from(AvailableActions other); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AvailableActions build(); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { - private AccountIntegration integration; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AvailableActions other) { - integration(other.getIntegration()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public AvailableActions build() { - return new AvailableActions( - integration, passthroughAvailable, availableModelOperations, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/CategoriesEnum.java b/src/main/java/com/merge/api/resources/crm/types/CategoriesEnum.java deleted file mode 100644 index 37cc38d45..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/CategoriesEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoriesEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoriesEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/CategoryEnum.java b/src/main/java/com/merge/api/resources/crm/types/CategoryEnum.java deleted file mode 100644 index f633e1f82..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/CategoryEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoryEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/resources/crm/types/CommonModelScopeApi.java deleted file mode 100644 index 06cc4635a..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/CommonModelScopeApi.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) -public final class CommonModelScopeApi { - private final List commonModels; - - private final Map additionalProperties; - - private CommonModelScopeApi( - List commonModels, Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopeApi other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CommonModelScopeApi other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public CommonModelScopeApi build() { - return new CommonModelScopeApi(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/resources/crm/types/CommonModelScopesBodyRequest.java deleted file mode 100644 index abbb46c84..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/CommonModelScopesBodyRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) -public final class CommonModelScopesBodyRequest { - private final String modelId; - - private final List enabledActions; - - private final List disabledFields; - - private final Map additionalProperties; - - private CommonModelScopesBodyRequest( - String modelId, - List enabledActions, - List disabledFields, - Map additionalProperties) { - this.modelId = modelId; - this.enabledActions = enabledActions; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("enabled_actions") - public List getEnabledActions() { - return enabledActions; - } - - @JsonProperty("disabled_fields") - public List getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopesBodyRequest other) { - return modelId.equals(other.modelId) - && enabledActions.equals(other.enabledActions) - && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelIdStage builder() { - return new Builder(); - } - - public interface ModelIdStage { - _FinalStage modelId(@NotNull String modelId); - - Builder from(CommonModelScopesBodyRequest other); - } - - public interface _FinalStage { - CommonModelScopesBodyRequest build(); - - _FinalStage enabledActions(List enabledActions); - - _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); - - _FinalStage addAllEnabledActions(List enabledActions); - - _FinalStage disabledFields(List disabledFields); - - _FinalStage addDisabledFields(String disabledFields); - - _FinalStage addAllDisabledFields(List disabledFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelIdStage, _FinalStage { - private String modelId; - - private List disabledFields = new ArrayList<>(); - - private List enabledActions = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CommonModelScopesBodyRequest other) { - modelId(other.getModelId()); - enabledActions(other.getEnabledActions()); - disabledFields(other.getDisabledFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public _FinalStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - public _FinalStage addAllDisabledFields(List disabledFields) { - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addDisabledFields(String disabledFields) { - this.disabledFields.add(disabledFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public _FinalStage disabledFields(List disabledFields) { - this.disabledFields.clear(); - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllEnabledActions(List enabledActions) { - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { - this.enabledActions.add(enabledActions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) - public _FinalStage enabledActions(List enabledActions) { - this.enabledActions.clear(); - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public CommonModelScopesBodyRequest build() { - return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/Contact.java b/src/main/java/com/merge/api/resources/crm/types/Contact.java deleted file mode 100644 index a5d6a8501..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/Contact.java +++ /dev/null @@ -1,549 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Contact.Builder.class) -public final class Contact { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional firstName; - - private final Optional lastName; - - private final Optional account; - - private final Optional owner; - - private final Optional> addresses; - - private final Optional> emailAddresses; - - private final Optional> phoneNumbers; - - private final Optional lastActivityAt; - - private final Optional remoteCreatedAt; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Optional> remoteFields; - - private final Map additionalProperties; - - private Contact( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional firstName, - Optional lastName, - Optional account, - Optional owner, - Optional> addresses, - Optional> emailAddresses, - Optional> phoneNumbers, - Optional lastActivityAt, - Optional remoteCreatedAt, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Optional> remoteFields, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.firstName = firstName; - this.lastName = lastName; - this.account = account; - this.owner = owner; - this.addresses = addresses; - this.emailAddresses = emailAddresses; - this.phoneNumbers = phoneNumbers; - this.lastActivityAt = lastActivityAt; - this.remoteCreatedAt = remoteCreatedAt; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.remoteFields = remoteFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The contact's first name. - */ - @JsonProperty("first_name") - public Optional getFirstName() { - return firstName; - } - - /** - * @return The contact's last name. - */ - @JsonProperty("last_name") - public Optional getLastName() { - return lastName; - } - - /** - * @return The contact's account. - */ - @JsonProperty("account") - public Optional getAccount() { - return account; - } - - /** - * @return The contact's owner. - */ - @JsonProperty("owner") - public Optional getOwner() { - return owner; - } - - @JsonProperty("addresses") - public Optional> getAddresses() { - return addresses; - } - - @JsonProperty("email_addresses") - public Optional> getEmailAddresses() { - return emailAddresses; - } - - @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { - return phoneNumbers; - } - - /** - * @return When the contact's last activity occurred. - */ - @JsonProperty("last_activity_at") - public Optional getLastActivityAt() { - return lastActivityAt; - } - - /** - * @return When the third party's contact was created. - */ - @JsonProperty("remote_created_at") - public Optional getRemoteCreatedAt() { - return remoteCreatedAt; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @JsonProperty("remote_fields") - public Optional> getRemoteFields() { - return remoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Contact && equalTo((Contact) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Contact other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && firstName.equals(other.firstName) - && lastName.equals(other.lastName) - && account.equals(other.account) - && owner.equals(other.owner) - && addresses.equals(other.addresses) - && emailAddresses.equals(other.emailAddresses) - && phoneNumbers.equals(other.phoneNumbers) - && lastActivityAt.equals(other.lastActivityAt) - && remoteCreatedAt.equals(other.remoteCreatedAt) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData) - && remoteFields.equals(other.remoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.firstName, - this.lastName, - this.account, - this.owner, - this.addresses, - this.emailAddresses, - this.phoneNumbers, - this.lastActivityAt, - this.remoteCreatedAt, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData, - this.remoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional firstName = Optional.empty(); - - private Optional lastName = Optional.empty(); - - private Optional account = Optional.empty(); - - private Optional owner = Optional.empty(); - - private Optional> addresses = Optional.empty(); - - private Optional> emailAddresses = Optional.empty(); - - private Optional> phoneNumbers = Optional.empty(); - - private Optional lastActivityAt = Optional.empty(); - - private Optional remoteCreatedAt = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - private Optional> remoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Contact other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - firstName(other.getFirstName()); - lastName(other.getLastName()); - account(other.getAccount()); - owner(other.getOwner()); - addresses(other.getAddresses()); - emailAddresses(other.getEmailAddresses()); - phoneNumbers(other.getPhoneNumbers()); - lastActivityAt(other.getLastActivityAt()); - remoteCreatedAt(other.getRemoteCreatedAt()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - remoteFields(other.getRemoteFields()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "first_name", nulls = Nulls.SKIP) - public Builder firstName(Optional firstName) { - this.firstName = firstName; - return this; - } - - public Builder firstName(String firstName) { - this.firstName = Optional.ofNullable(firstName); - return this; - } - - @JsonSetter(value = "last_name", nulls = Nulls.SKIP) - public Builder lastName(Optional lastName) { - this.lastName = lastName; - return this; - } - - public Builder lastName(String lastName) { - this.lastName = Optional.ofNullable(lastName); - return this; - } - - @JsonSetter(value = "account", nulls = Nulls.SKIP) - public Builder account(Optional account) { - this.account = account; - return this; - } - - public Builder account(ContactAccount account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "owner", nulls = Nulls.SKIP) - public Builder owner(Optional owner) { - this.owner = owner; - return this; - } - - public Builder owner(ContactOwner owner) { - this.owner = Optional.ofNullable(owner); - return this; - } - - @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional> addresses) { - this.addresses = addresses; - return this; - } - - public Builder addresses(List
addresses) { - this.addresses = Optional.ofNullable(addresses); - return this; - } - - @JsonSetter(value = "email_addresses", nulls = Nulls.SKIP) - public Builder emailAddresses(Optional> emailAddresses) { - this.emailAddresses = emailAddresses; - return this; - } - - public Builder emailAddresses(List emailAddresses) { - this.emailAddresses = Optional.ofNullable(emailAddresses); - return this; - } - - @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - public Builder phoneNumbers(List phoneNumbers) { - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) - public Builder lastActivityAt(Optional lastActivityAt) { - this.lastActivityAt = lastActivityAt; - return this; - } - - public Builder lastActivityAt(OffsetDateTime lastActivityAt) { - this.lastActivityAt = Optional.ofNullable(lastActivityAt); - return this; - } - - @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) - public Builder remoteCreatedAt(Optional remoteCreatedAt) { - this.remoteCreatedAt = remoteCreatedAt; - return this; - } - - public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { - this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional> remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(List remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - public Contact build() { - return new Contact( - id, - remoteId, - createdAt, - modifiedAt, - firstName, - lastName, - account, - owner, - addresses, - emailAddresses, - phoneNumbers, - lastActivityAt, - remoteCreatedAt, - remoteWasDeleted, - fieldMappings, - remoteData, - remoteFields, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ContactAccount.java b/src/main/java/com/merge/api/resources/crm/types/ContactAccount.java deleted file mode 100644 index 20db4fe89..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ContactAccount.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ContactAccount.Deserializer.class) -public final class ContactAccount { - private final Object value; - - private final int type; - - private ContactAccount(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((Account) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactAccount && equalTo((ContactAccount) other); - } - - private boolean equalTo(ContactAccount other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ContactAccount of(String value) { - return new ContactAccount(value, 0); - } - - public static ContactAccount of(Account value) { - return new ContactAccount(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(Account value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ContactAccount.class); - } - - @java.lang.Override - public ContactAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ContactRequest.java b/src/main/java/com/merge/api/resources/crm/types/ContactRequest.java deleted file mode 100644 index 55a1dbd26..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ContactRequest.java +++ /dev/null @@ -1,378 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactRequest.Builder.class) -public final class ContactRequest { - private final Optional firstName; - - private final Optional lastName; - - private final Optional account; - - private final Optional owner; - - private final Optional> addresses; - - private final Optional> emailAddresses; - - private final Optional> phoneNumbers; - - private final Optional lastActivityAt; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Optional> remoteFields; - - private final Map additionalProperties; - - private ContactRequest( - Optional firstName, - Optional lastName, - Optional account, - Optional owner, - Optional> addresses, - Optional> emailAddresses, - Optional> phoneNumbers, - Optional lastActivityAt, - Optional> integrationParams, - Optional> linkedAccountParams, - Optional> remoteFields, - Map additionalProperties) { - this.firstName = firstName; - this.lastName = lastName; - this.account = account; - this.owner = owner; - this.addresses = addresses; - this.emailAddresses = emailAddresses; - this.phoneNumbers = phoneNumbers; - this.lastActivityAt = lastActivityAt; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.remoteFields = remoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return The contact's first name. - */ - @JsonProperty("first_name") - public Optional getFirstName() { - return firstName; - } - - /** - * @return The contact's last name. - */ - @JsonProperty("last_name") - public Optional getLastName() { - return lastName; - } - - /** - * @return The contact's account. - */ - @JsonProperty("account") - public Optional getAccount() { - return account; - } - - /** - * @return The contact's owner. - */ - @JsonProperty("owner") - public Optional getOwner() { - return owner; - } - - @JsonProperty("addresses") - public Optional> getAddresses() { - return addresses; - } - - @JsonProperty("email_addresses") - public Optional> getEmailAddresses() { - return emailAddresses; - } - - @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { - return phoneNumbers; - } - - /** - * @return When the contact's last activity occurred. - */ - @JsonProperty("last_activity_at") - public Optional getLastActivityAt() { - return lastActivityAt; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @JsonProperty("remote_fields") - public Optional> getRemoteFields() { - return remoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactRequest && equalTo((ContactRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactRequest other) { - return firstName.equals(other.firstName) - && lastName.equals(other.lastName) - && account.equals(other.account) - && owner.equals(other.owner) - && addresses.equals(other.addresses) - && emailAddresses.equals(other.emailAddresses) - && phoneNumbers.equals(other.phoneNumbers) - && lastActivityAt.equals(other.lastActivityAt) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams) - && remoteFields.equals(other.remoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.firstName, - this.lastName, - this.account, - this.owner, - this.addresses, - this.emailAddresses, - this.phoneNumbers, - this.lastActivityAt, - this.integrationParams, - this.linkedAccountParams, - this.remoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional firstName = Optional.empty(); - - private Optional lastName = Optional.empty(); - - private Optional account = Optional.empty(); - - private Optional owner = Optional.empty(); - - private Optional> addresses = Optional.empty(); - - private Optional> emailAddresses = Optional.empty(); - - private Optional> phoneNumbers = Optional.empty(); - - private Optional lastActivityAt = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - private Optional> remoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactRequest other) { - firstName(other.getFirstName()); - lastName(other.getLastName()); - account(other.getAccount()); - owner(other.getOwner()); - addresses(other.getAddresses()); - emailAddresses(other.getEmailAddresses()); - phoneNumbers(other.getPhoneNumbers()); - lastActivityAt(other.getLastActivityAt()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - remoteFields(other.getRemoteFields()); - return this; - } - - @JsonSetter(value = "first_name", nulls = Nulls.SKIP) - public Builder firstName(Optional firstName) { - this.firstName = firstName; - return this; - } - - public Builder firstName(String firstName) { - this.firstName = Optional.ofNullable(firstName); - return this; - } - - @JsonSetter(value = "last_name", nulls = Nulls.SKIP) - public Builder lastName(Optional lastName) { - this.lastName = lastName; - return this; - } - - public Builder lastName(String lastName) { - this.lastName = Optional.ofNullable(lastName); - return this; - } - - @JsonSetter(value = "account", nulls = Nulls.SKIP) - public Builder account(Optional account) { - this.account = account; - return this; - } - - public Builder account(ContactRequestAccount account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "owner", nulls = Nulls.SKIP) - public Builder owner(Optional owner) { - this.owner = owner; - return this; - } - - public Builder owner(ContactRequestOwner owner) { - this.owner = Optional.ofNullable(owner); - return this; - } - - @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional> addresses) { - this.addresses = addresses; - return this; - } - - public Builder addresses(List addresses) { - this.addresses = Optional.ofNullable(addresses); - return this; - } - - @JsonSetter(value = "email_addresses", nulls = Nulls.SKIP) - public Builder emailAddresses(Optional> emailAddresses) { - this.emailAddresses = emailAddresses; - return this; - } - - public Builder emailAddresses(List emailAddresses) { - this.emailAddresses = Optional.ofNullable(emailAddresses); - return this; - } - - @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - public Builder phoneNumbers(List phoneNumbers) { - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - @JsonSetter(value = "last_activity_at", nulls = Nulls.SKIP) - public Builder lastActivityAt(Optional lastActivityAt) { - this.lastActivityAt = lastActivityAt; - return this; - } - - public Builder lastActivityAt(OffsetDateTime lastActivityAt) { - this.lastActivityAt = Optional.ofNullable(lastActivityAt); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional> remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(List remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - public ContactRequest build() { - return new ContactRequest( - firstName, - lastName, - account, - owner, - addresses, - emailAddresses, - phoneNumbers, - lastActivityAt, - integrationParams, - linkedAccountParams, - remoteFields, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ContactRequestAccount.java b/src/main/java/com/merge/api/resources/crm/types/ContactRequestAccount.java deleted file mode 100644 index a70e7f6d1..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ContactRequestAccount.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ContactRequestAccount.Deserializer.class) -public final class ContactRequestAccount { - private final Object value; - - private final int type; - - private ContactRequestAccount(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((Account) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactRequestAccount && equalTo((ContactRequestAccount) other); - } - - private boolean equalTo(ContactRequestAccount other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ContactRequestAccount of(String value) { - return new ContactRequestAccount(value, 0); - } - - public static ContactRequestAccount of(Account value) { - return new ContactRequestAccount(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(Account value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ContactRequestAccount.class); - } - - @java.lang.Override - public ContactRequestAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/CountryEnum.java b/src/main/java/com/merge/api/resources/crm/types/CountryEnum.java deleted file mode 100644 index 17809c3e3..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/CountryEnum.java +++ /dev/null @@ -1,518 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CountryEnum { - AF("AF"), - - AX("AX"), - - AL("AL"), - - DZ("DZ"), - - AS("AS"), - - AD("AD"), - - AO("AO"), - - AI("AI"), - - AQ("AQ"), - - AG("AG"), - - AR("AR"), - - AM("AM"), - - AW("AW"), - - AU("AU"), - - AT("AT"), - - AZ("AZ"), - - BS("BS"), - - BH("BH"), - - BD("BD"), - - BB("BB"), - - BY("BY"), - - BE("BE"), - - BZ("BZ"), - - BJ("BJ"), - - BM("BM"), - - BT("BT"), - - BO("BO"), - - BQ("BQ"), - - BA("BA"), - - BW("BW"), - - BV("BV"), - - BR("BR"), - - IO("IO"), - - BN("BN"), - - BG("BG"), - - BF("BF"), - - BI("BI"), - - CV("CV"), - - KH("KH"), - - CM("CM"), - - CA("CA"), - - KY("KY"), - - CF("CF"), - - TD("TD"), - - CL("CL"), - - CN("CN"), - - CX("CX"), - - CC("CC"), - - CO("CO"), - - KM("KM"), - - CG("CG"), - - CD("CD"), - - CK("CK"), - - CR("CR"), - - CI("CI"), - - HR("HR"), - - CU("CU"), - - CW("CW"), - - CY("CY"), - - CZ("CZ"), - - DK("DK"), - - DJ("DJ"), - - DM("DM"), - - DO("DO"), - - EC("EC"), - - EG("EG"), - - SV("SV"), - - GQ("GQ"), - - ER("ER"), - - EE("EE"), - - SZ("SZ"), - - ET("ET"), - - FK("FK"), - - FO("FO"), - - FJ("FJ"), - - FI("FI"), - - FR("FR"), - - GF("GF"), - - PF("PF"), - - TF("TF"), - - GA("GA"), - - GM("GM"), - - GE("GE"), - - DE("DE"), - - GH("GH"), - - GI("GI"), - - GR("GR"), - - GL("GL"), - - GD("GD"), - - GP("GP"), - - GU("GU"), - - GT("GT"), - - GG("GG"), - - GN("GN"), - - GW("GW"), - - GY("GY"), - - HT("HT"), - - HM("HM"), - - VA("VA"), - - HN("HN"), - - HK("HK"), - - HU("HU"), - - IS("IS"), - - IN("IN"), - - ID("ID"), - - IR("IR"), - - IQ("IQ"), - - IE("IE"), - - IM("IM"), - - IL("IL"), - - IT("IT"), - - JM("JM"), - - JP("JP"), - - JE("JE"), - - JO("JO"), - - KZ("KZ"), - - KE("KE"), - - KI("KI"), - - KW("KW"), - - KG("KG"), - - LA("LA"), - - LV("LV"), - - LB("LB"), - - LS("LS"), - - LR("LR"), - - LY("LY"), - - LI("LI"), - - LT("LT"), - - LU("LU"), - - MO("MO"), - - MG("MG"), - - MW("MW"), - - MY("MY"), - - MV("MV"), - - ML("ML"), - - MT("MT"), - - MH("MH"), - - MQ("MQ"), - - MR("MR"), - - MU("MU"), - - YT("YT"), - - MX("MX"), - - FM("FM"), - - MD("MD"), - - MC("MC"), - - MN("MN"), - - ME("ME"), - - MS("MS"), - - MA("MA"), - - MZ("MZ"), - - MM("MM"), - - NA("NA"), - - NR("NR"), - - NP("NP"), - - NL("NL"), - - NC("NC"), - - NZ("NZ"), - - NI("NI"), - - NE("NE"), - - NG("NG"), - - NU("NU"), - - NF("NF"), - - KP("KP"), - - MK("MK"), - - MP("MP"), - - NO("NO"), - - OM("OM"), - - PK("PK"), - - PW("PW"), - - PS("PS"), - - PA("PA"), - - PG("PG"), - - PY("PY"), - - PE("PE"), - - PH("PH"), - - PN("PN"), - - PL("PL"), - - PT("PT"), - - PR("PR"), - - QA("QA"), - - RE("RE"), - - RO("RO"), - - RU("RU"), - - RW("RW"), - - BL("BL"), - - SH("SH"), - - KN("KN"), - - LC("LC"), - - MF("MF"), - - PM("PM"), - - VC("VC"), - - WS("WS"), - - SM("SM"), - - ST("ST"), - - SA("SA"), - - SN("SN"), - - RS("RS"), - - SC("SC"), - - SL("SL"), - - SG("SG"), - - SX("SX"), - - SK("SK"), - - SI("SI"), - - SB("SB"), - - SO("SO"), - - ZA("ZA"), - - GS("GS"), - - KR("KR"), - - SS("SS"), - - ES("ES"), - - LK("LK"), - - SD("SD"), - - SR("SR"), - - SJ("SJ"), - - SE("SE"), - - CH("CH"), - - SY("SY"), - - TW("TW"), - - TJ("TJ"), - - TZ("TZ"), - - TH("TH"), - - TL("TL"), - - TG("TG"), - - TK("TK"), - - TO("TO"), - - TT("TT"), - - TN("TN"), - - TR("TR"), - - TM("TM"), - - TC("TC"), - - TV("TV"), - - UG("UG"), - - UA("UA"), - - AE("AE"), - - GB("GB"), - - UM("UM"), - - US("US"), - - UY("UY"), - - UZ("UZ"), - - VU("VU"), - - VE("VE"), - - VN("VN"), - - VG("VG"), - - VI("VI"), - - WF("WF"), - - EH("EH"), - - YE("YE"), - - ZM("ZM"), - - ZW("ZW"); - - private final String value; - - CountryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/resources/crm/types/DataPassthroughRequest.java deleted file mode 100644 index dfd4d1805..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/DataPassthroughRequest.java +++ /dev/null @@ -1,371 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) -public final class DataPassthroughRequest { - private final MethodEnum method; - - private final String path; - - private final Optional baseUrlOverride; - - private final Optional data; - - private final Optional> multipartFormData; - - private final Optional> headers; - - private final Optional requestFormat; - - private final Optional normalizeResponse; - - private final Map additionalProperties; - - private DataPassthroughRequest( - MethodEnum method, - String path, - Optional baseUrlOverride, - Optional data, - Optional> multipartFormData, - Optional> headers, - Optional requestFormat, - Optional normalizeResponse, - Map additionalProperties) { - this.method = method; - this.path = path; - this.baseUrlOverride = baseUrlOverride; - this.data = data; - this.multipartFormData = multipartFormData; - this.headers = headers; - this.requestFormat = requestFormat; - this.normalizeResponse = normalizeResponse; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public MethodEnum getMethod() { - return method; - } - - /** - * @return The path of the request in the third party's platform. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - /** - * @return An optional override of the third party's base url for the request. - */ - @JsonProperty("base_url_override") - public Optional getBaseUrlOverride() { - return baseUrlOverride; - } - - /** - * @return The data with the request. You must include a request_format parameter matching the data's format - */ - @JsonProperty("data") - public Optional getData() { - return data; - } - - /** - * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. - */ - @JsonProperty("multipart_form_data") - public Optional> getMultipartFormData() { - return multipartFormData; - } - - /** - * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("request_format") - public Optional getRequestFormat() { - return requestFormat; - } - - /** - * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. - */ - @JsonProperty("normalize_response") - public Optional getNormalizeResponse() { - return normalizeResponse; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DataPassthroughRequest other) { - return method.equals(other.method) - && path.equals(other.path) - && baseUrlOverride.equals(other.baseUrlOverride) - && data.equals(other.data) - && multipartFormData.equals(other.multipartFormData) - && headers.equals(other.headers) - && requestFormat.equals(other.requestFormat) - && normalizeResponse.equals(other.normalizeResponse); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.baseUrlOverride, - this.data, - this.multipartFormData, - this.headers, - this.requestFormat, - this.normalizeResponse); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull MethodEnum method); - - Builder from(DataPassthroughRequest other); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - } - - public interface _FinalStage { - DataPassthroughRequest build(); - - _FinalStage baseUrlOverride(Optional baseUrlOverride); - - _FinalStage baseUrlOverride(String baseUrlOverride); - - _FinalStage data(Optional data); - - _FinalStage data(String data); - - _FinalStage multipartFormData(Optional> multipartFormData); - - _FinalStage multipartFormData(List multipartFormData); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - - _FinalStage requestFormat(Optional requestFormat); - - _FinalStage requestFormat(RequestFormatEnum requestFormat); - - _FinalStage normalizeResponse(Optional normalizeResponse); - - _FinalStage normalizeResponse(Boolean normalizeResponse); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, _FinalStage { - private MethodEnum method; - - private String path; - - private Optional normalizeResponse = Optional.empty(); - - private Optional requestFormat = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional> multipartFormData = Optional.empty(); - - private Optional data = Optional.empty(); - - private Optional baseUrlOverride = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DataPassthroughRequest other) { - method(other.getMethod()); - path(other.getPath()); - baseUrlOverride(other.getBaseUrlOverride()); - data(other.getData()); - multipartFormData(other.getMultipartFormData()); - headers(other.getHeaders()); - requestFormat(other.getRequestFormat()); - normalizeResponse(other.getNormalizeResponse()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull MethodEnum method) { - this.method = method; - return this; - } - - /** - *

The path of the request in the third party's platform.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - /** - *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage normalizeResponse(Boolean normalizeResponse) { - this.normalizeResponse = Optional.ofNullable(normalizeResponse); - return this; - } - - @java.lang.Override - @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) - public _FinalStage normalizeResponse(Optional normalizeResponse) { - this.normalizeResponse = normalizeResponse; - return this; - } - - @java.lang.Override - public _FinalStage requestFormat(RequestFormatEnum requestFormat) { - this.requestFormat = Optional.ofNullable(requestFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_format", nulls = Nulls.SKIP) - public _FinalStage requestFormat(Optional requestFormat) { - this.requestFormat = requestFormat; - return this; - } - - /** - *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - /** - *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage multipartFormData(List multipartFormData) { - this.multipartFormData = Optional.ofNullable(multipartFormData); - return this; - } - - @java.lang.Override - @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) - public _FinalStage multipartFormData(Optional> multipartFormData) { - this.multipartFormData = multipartFormData; - return this; - } - - /** - *

The data with the request. You must include a request_format parameter matching the data's format

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage data(String data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - /** - *

An optional override of the third party's base url for the request.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage baseUrlOverride(String baseUrlOverride) { - this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); - return this; - } - - @java.lang.Override - @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) - public _FinalStage baseUrlOverride(Optional baseUrlOverride) { - this.baseUrlOverride = baseUrlOverride; - return this; - } - - @java.lang.Override - public DataPassthroughRequest build() { - return new DataPassthroughRequest( - method, - path, - baseUrlOverride, - data, - multipartFormData, - headers, - requestFormat, - normalizeResponse, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/DebugModeLog.java b/src/main/java/com/merge/api/resources/crm/types/DebugModeLog.java deleted file mode 100644 index 6e83e58f1..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/DebugModeLog.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModeLog.Builder.class) -public final class DebugModeLog { - private final String logId; - - private final String dashboardView; - - private final DebugModelLogSummary logSummary; - - private final Map additionalProperties; - - private DebugModeLog( - String logId, - String dashboardView, - DebugModelLogSummary logSummary, - Map additionalProperties) { - this.logId = logId; - this.dashboardView = dashboardView; - this.logSummary = logSummary; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("log_id") - public String getLogId() { - return logId; - } - - @JsonProperty("dashboard_view") - public String getDashboardView() { - return dashboardView; - } - - @JsonProperty("log_summary") - public DebugModelLogSummary getLogSummary() { - return logSummary; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModeLog && equalTo((DebugModeLog) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModeLog other) { - return logId.equals(other.logId) - && dashboardView.equals(other.dashboardView) - && logSummary.equals(other.logSummary); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.logId, this.dashboardView, this.logSummary); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LogIdStage builder() { - return new Builder(); - } - - public interface LogIdStage { - DashboardViewStage logId(@NotNull String logId); - - Builder from(DebugModeLog other); - } - - public interface DashboardViewStage { - LogSummaryStage dashboardView(@NotNull String dashboardView); - } - - public interface LogSummaryStage { - _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); - } - - public interface _FinalStage { - DebugModeLog build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { - private String logId; - - private String dashboardView; - - private DebugModelLogSummary logSummary; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModeLog other) { - logId(other.getLogId()); - dashboardView(other.getDashboardView()); - logSummary(other.getLogSummary()); - return this; - } - - @java.lang.Override - @JsonSetter("log_id") - public DashboardViewStage logId(@NotNull String logId) { - this.logId = logId; - return this; - } - - @java.lang.Override - @JsonSetter("dashboard_view") - public LogSummaryStage dashboardView(@NotNull String dashboardView) { - this.dashboardView = dashboardView; - return this; - } - - @java.lang.Override - @JsonSetter("log_summary") - public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { - this.logSummary = logSummary; - return this; - } - - @java.lang.Override - public DebugModeLog build() { - return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/resources/crm/types/DebugModelLogSummary.java deleted file mode 100644 index fbdfe99e9..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/DebugModelLogSummary.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) -public final class DebugModelLogSummary { - private final String url; - - private final String method; - - private final int statusCode; - - private final Map additionalProperties; - - private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { - this.url = url; - this.method = method; - this.statusCode = statusCode; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("url") - public String getUrl() { - return url; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("status_code") - public int getStatusCode() { - return statusCode; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModelLogSummary other) { - return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.url, this.method, this.statusCode); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static UrlStage builder() { - return new Builder(); - } - - public interface UrlStage { - MethodStage url(@NotNull String url); - - Builder from(DebugModelLogSummary other); - } - - public interface MethodStage { - StatusCodeStage method(@NotNull String method); - } - - public interface StatusCodeStage { - _FinalStage statusCode(int statusCode); - } - - public interface _FinalStage { - DebugModelLogSummary build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { - private String url; - - private String method; - - private int statusCode; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModelLogSummary other) { - url(other.getUrl()); - method(other.getMethod()); - statusCode(other.getStatusCode()); - return this; - } - - @java.lang.Override - @JsonSetter("url") - public MethodStage url(@NotNull String url) { - this.url = url; - return this; - } - - @java.lang.Override - @JsonSetter("method") - public StatusCodeStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("status_code") - public _FinalStage statusCode(int statusCode) { - this.statusCode = statusCode; - return this; - } - - @java.lang.Override - public DebugModelLogSummary build() { - return new DebugModelLogSummary(url, method, statusCode, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EmailAddress.java b/src/main/java/com/merge/api/resources/crm/types/EmailAddress.java deleted file mode 100644 index b791acdb0..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EmailAddress.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmailAddress.Builder.class) -public final class EmailAddress { - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional emailAddress; - - private final Optional emailAddressType; - - private final Map additionalProperties; - - private EmailAddress( - Optional createdAt, - Optional modifiedAt, - Optional emailAddress, - Optional emailAddressType, - Map additionalProperties) { - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.emailAddress = emailAddress; - this.emailAddressType = emailAddressType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return The email address's type. - */ - @JsonProperty("email_address_type") - public Optional getEmailAddressType() { - return emailAddressType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmailAddress && equalTo((EmailAddress) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmailAddress other) { - return createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && emailAddress.equals(other.emailAddress) - && emailAddressType.equals(other.emailAddressType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.createdAt, this.modifiedAt, this.emailAddress, this.emailAddressType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional emailAddressType = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmailAddress other) { - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - emailAddress(other.getEmailAddress()); - emailAddressType(other.getEmailAddressType()); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) - public Builder emailAddressType(Optional emailAddressType) { - this.emailAddressType = emailAddressType; - return this; - } - - public Builder emailAddressType(String emailAddressType) { - this.emailAddressType = Optional.ofNullable(emailAddressType); - return this; - } - - public EmailAddress build() { - return new EmailAddress(createdAt, modifiedAt, emailAddress, emailAddressType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EmailAddressRequest.java b/src/main/java/com/merge/api/resources/crm/types/EmailAddressRequest.java deleted file mode 100644 index b6774ae34..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EmailAddressRequest.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmailAddressRequest.Builder.class) -public final class EmailAddressRequest { - private final Optional emailAddress; - - private final Optional emailAddressType; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private EmailAddressRequest( - Optional emailAddress, - Optional emailAddressType, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.emailAddress = emailAddress; - this.emailAddressType = emailAddressType; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return The email address's type. - */ - @JsonProperty("email_address_type") - public Optional getEmailAddressType() { - return emailAddressType; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmailAddressRequest && equalTo((EmailAddressRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmailAddressRequest other) { - return emailAddress.equals(other.emailAddress) - && emailAddressType.equals(other.emailAddressType) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.emailAddress, this.emailAddressType, this.integrationParams, this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional emailAddress = Optional.empty(); - - private Optional emailAddressType = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmailAddressRequest other) { - emailAddress(other.getEmailAddress()); - emailAddressType(other.getEmailAddressType()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "email_address_type", nulls = Nulls.SKIP) - public Builder emailAddressType(Optional emailAddressType) { - this.emailAddressType = emailAddressType; - return this; - } - - public Builder emailAddressType(String emailAddressType) { - this.emailAddressType = Optional.ofNullable(emailAddressType); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public EmailAddressRequest build() { - return new EmailAddressRequest( - emailAddress, emailAddressType, integrationParams, linkedAccountParams, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/resources/crm/types/EnabledActionsEnum.java deleted file mode 100644 index 6301a0d20..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EnabledActionsEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EnabledActionsEnum { - READ("READ"), - - WRITE("WRITE"); - - private final String value; - - EnabledActionsEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EncodingEnum.java b/src/main/java/com/merge/api/resources/crm/types/EncodingEnum.java deleted file mode 100644 index 3a019648f..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EncodingEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EncodingEnum { - RAW("RAW"), - - BASE_64("BASE64"), - - GZIP_BASE_64("GZIP_BASE64"); - - private final String value; - - EncodingEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementDirection.java b/src/main/java/com/merge/api/resources/crm/types/EngagementDirection.java deleted file mode 100644 index f1c199400..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementDirection.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EngagementDirection.Deserializer.class) -public final class EngagementDirection { - private final Object value; - - private final int type; - - private EngagementDirection(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((DirectionEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EngagementDirection && equalTo((EngagementDirection) other); - } - - private boolean equalTo(EngagementDirection other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EngagementDirection of(DirectionEnum value) { - return new EngagementDirection(value, 0); - } - - public static EngagementDirection of(String value) { - return new EngagementDirection(value, 1); - } - - public interface Visitor { - T visit(DirectionEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EngagementDirection.class); - } - - @java.lang.Override - public EngagementDirection deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, DirectionEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementRequestDirection.java b/src/main/java/com/merge/api/resources/crm/types/EngagementRequestDirection.java deleted file mode 100644 index 95fed2ee2..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementRequestDirection.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EngagementRequestDirection.Deserializer.class) -public final class EngagementRequestDirection { - private final Object value; - - private final int type; - - private EngagementRequestDirection(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((DirectionEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EngagementRequestDirection && equalTo((EngagementRequestDirection) other); - } - - private boolean equalTo(EngagementRequestDirection other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EngagementRequestDirection of(DirectionEnum value) { - return new EngagementRequestDirection(value, 0); - } - - public static EngagementRequestDirection of(String value) { - return new EngagementRequestDirection(value, 1); - } - - public interface Visitor { - T visit(DirectionEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EngagementRequestDirection.class); - } - - @java.lang.Override - public EngagementRequestDirection deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, DirectionEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EngagementTypeActivityType.java b/src/main/java/com/merge/api/resources/crm/types/EngagementTypeActivityType.java deleted file mode 100644 index db87479f8..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EngagementTypeActivityType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EngagementTypeActivityType.Deserializer.class) -public final class EngagementTypeActivityType { - private final Object value; - - private final int type; - - private EngagementTypeActivityType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ActivityTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EngagementTypeActivityType && equalTo((EngagementTypeActivityType) other); - } - - private boolean equalTo(EngagementTypeActivityType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EngagementTypeActivityType of(ActivityTypeEnum value) { - return new EngagementTypeActivityType(value, 0); - } - - public static EngagementTypeActivityType of(String value) { - return new EngagementTypeActivityType(value, 1); - } - - public interface Visitor { - T visit(ActivityTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EngagementTypeActivityType.class); - } - - @java.lang.Override - public EngagementTypeActivityType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ActivityTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/resources/crm/types/ErrorValidationProblem.java deleted file mode 100644 index 7d6690ca6..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ErrorValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) -public final class ErrorValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private ErrorValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ErrorValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(ErrorValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - ErrorValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ErrorValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public ErrorValidationProblem build() { - return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/EventTypeEnum.java b/src/main/java/com/merge/api/resources/crm/types/EventTypeEnum.java deleted file mode 100644 index c1d32f29b..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/EventTypeEnum.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EventTypeEnum { - CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), - - DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), - - CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), - - DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), - - REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), - - INVITED_USER("INVITED_USER"), - - TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), - - TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), - - DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), - - CREATED_DESTINATION("CREATED_DESTINATION"), - - DELETED_DESTINATION("DELETED_DESTINATION"), - - CHANGED_DESTINATION("CHANGED_DESTINATION"), - - CHANGED_SCOPES("CHANGED_SCOPES"), - - CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), - - CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), - - ENABLED_INTEGRATION("ENABLED_INTEGRATION"), - - DISABLED_INTEGRATION("DISABLED_INTEGRATION"), - - ENABLED_CATEGORY("ENABLED_CATEGORY"), - - DISABLED_CATEGORY("DISABLED_CATEGORY"), - - CHANGED_PASSWORD("CHANGED_PASSWORD"), - - RESET_PASSWORD("RESET_PASSWORD"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), - - MUTED_ISSUE("MUTED_ISSUE"), - - GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), - - ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), - - DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), - - MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), - - END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); - - private final String value; - - EventTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/resources/crm/types/ExternalTargetFieldApi.java deleted file mode 100644 index 83203db1e..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ExternalTargetFieldApi.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) -public final class ExternalTargetFieldApi { - private final Optional name; - - private final Optional description; - - private final Optional isMapped; - - private final Map additionalProperties; - - private ExternalTargetFieldApi( - Optional name, - Optional description, - Optional isMapped, - Map additionalProperties) { - this.name = name; - this.description = description; - this.isMapped = isMapped; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_mapped") - public Optional getIsMapped() { - return isMapped; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApi other) { - return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isMapped); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isMapped = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApi other) { - name(other.getName()); - description(other.getDescription()); - isMapped(other.getIsMapped()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) - public Builder isMapped(Optional isMapped) { - this.isMapped = isMapped; - return this; - } - - public Builder isMapped(String isMapped) { - this.isMapped = Optional.ofNullable(isMapped); - return this; - } - - public ExternalTargetFieldApi build() { - return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/resources/crm/types/ExternalTargetFieldApiResponse.java deleted file mode 100644 index 7b1122965..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ExternalTargetFieldApiResponse.java +++ /dev/null @@ -1,300 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) -public final class ExternalTargetFieldApiResponse { - private final Optional> account; - - private final Optional> contact; - - private final Optional> lead; - - private final Optional> note; - - private final Optional> opportunity; - - private final Optional> stage; - - private final Optional> user; - - private final Optional> task; - - private final Optional> engagement; - - private final Map additionalProperties; - - private ExternalTargetFieldApiResponse( - Optional> account, - Optional> contact, - Optional> lead, - Optional> note, - Optional> opportunity, - Optional> stage, - Optional> user, - Optional> task, - Optional> engagement, - Map additionalProperties) { - this.account = account; - this.contact = contact; - this.lead = lead; - this.note = note; - this.opportunity = opportunity; - this.stage = stage; - this.user = user; - this.task = task; - this.engagement = engagement; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @JsonProperty("Lead") - public Optional> getLead() { - return lead; - } - - @JsonProperty("Note") - public Optional> getNote() { - return note; - } - - @JsonProperty("Opportunity") - public Optional> getOpportunity() { - return opportunity; - } - - @JsonProperty("Stage") - public Optional> getStage() { - return stage; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @JsonProperty("Task") - public Optional> getTask() { - return task; - } - - @JsonProperty("Engagement") - public Optional> getEngagement() { - return engagement; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApiResponse other) { - return account.equals(other.account) - && contact.equals(other.contact) - && lead.equals(other.lead) - && note.equals(other.note) - && opportunity.equals(other.opportunity) - && stage.equals(other.stage) - && user.equals(other.user) - && task.equals(other.task) - && engagement.equals(other.engagement); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.account, - this.contact, - this.lead, - this.note, - this.opportunity, - this.stage, - this.user, - this.task, - this.engagement); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> account = Optional.empty(); - - private Optional> contact = Optional.empty(); - - private Optional> lead = Optional.empty(); - - private Optional> note = Optional.empty(); - - private Optional> opportunity = Optional.empty(); - - private Optional> stage = Optional.empty(); - - private Optional> user = Optional.empty(); - - private Optional> task = Optional.empty(); - - private Optional> engagement = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApiResponse other) { - account(other.getAccount()); - contact(other.getContact()); - lead(other.getLead()); - note(other.getNote()); - opportunity(other.getOpportunity()); - stage(other.getStage()); - user(other.getUser()); - task(other.getTask()); - engagement(other.getEngagement()); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - @JsonSetter(value = "Lead", nulls = Nulls.SKIP) - public Builder lead(Optional> lead) { - this.lead = lead; - return this; - } - - public Builder lead(List lead) { - this.lead = Optional.ofNullable(lead); - return this; - } - - @JsonSetter(value = "Note", nulls = Nulls.SKIP) - public Builder note(Optional> note) { - this.note = note; - return this; - } - - public Builder note(List note) { - this.note = Optional.ofNullable(note); - return this; - } - - @JsonSetter(value = "Opportunity", nulls = Nulls.SKIP) - public Builder opportunity(Optional> opportunity) { - this.opportunity = opportunity; - return this; - } - - public Builder opportunity(List opportunity) { - this.opportunity = Optional.ofNullable(opportunity); - return this; - } - - @JsonSetter(value = "Stage", nulls = Nulls.SKIP) - public Builder stage(Optional> stage) { - this.stage = stage; - return this; - } - - public Builder stage(List stage) { - this.stage = Optional.ofNullable(stage); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - @JsonSetter(value = "Task", nulls = Nulls.SKIP) - public Builder task(Optional> task) { - this.task = task; - return this; - } - - public Builder task(List task) { - this.task = Optional.ofNullable(task); - return this; - } - - @JsonSetter(value = "Engagement", nulls = Nulls.SKIP) - public Builder engagement(Optional> engagement) { - this.engagement = engagement; - return this; - } - - public Builder engagement(List engagement) { - this.engagement = Optional.ofNullable(engagement); - return this; - } - - public ExternalTargetFieldApiResponse build() { - return new ExternalTargetFieldApiResponse( - account, contact, lead, note, opportunity, stage, user, task, engagement, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldFormatEnum.java b/src/main/java/com/merge/api/resources/crm/types/FieldFormatEnum.java deleted file mode 100644 index 06f531fb6..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldFormatEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FieldFormatEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - FieldFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstance.java deleted file mode 100644 index 3c93bd25c..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstance.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) -public final class FieldMappingApiInstance { - private final Optional id; - - private final Optional isIntegrationWide; - - private final Optional targetField; - - private final Optional remoteField; - - private final Map additionalProperties; - - private FieldMappingApiInstance( - Optional id, - Optional isIntegrationWide, - Optional targetField, - Optional remoteField, - Map additionalProperties) { - this.id = id; - this.isIntegrationWide = isIntegrationWide; - this.targetField = targetField; - this.remoteField = remoteField; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("is_integration_wide") - public Optional getIsIntegrationWide() { - return isIntegrationWide; - } - - @JsonProperty("target_field") - public Optional getTargetField() { - return targetField; - } - - @JsonProperty("remote_field") - public Optional getRemoteField() { - return remoteField; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstance other) { - return id.equals(other.id) - && isIntegrationWide.equals(other.isIntegrationWide) - && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional isIntegrationWide = Optional.empty(); - - private Optional targetField = Optional.empty(); - - private Optional remoteField = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstance other) { - id(other.getId()); - isIntegrationWide(other.getIsIntegrationWide()); - targetField(other.getTargetField()); - remoteField(other.getRemoteField()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) - public Builder isIntegrationWide(Optional isIntegrationWide) { - this.isIntegrationWide = isIntegrationWide; - return this; - } - - public Builder isIntegrationWide(Boolean isIntegrationWide) { - this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); - return this; - } - - @JsonSetter(value = "target_field", nulls = Nulls.SKIP) - public Builder targetField(Optional targetField) { - this.targetField = targetField; - return this; - } - - public Builder targetField(FieldMappingApiInstanceTargetField targetField) { - this.targetField = Optional.ofNullable(targetField); - return this; - } - - @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) - public Builder remoteField(Optional remoteField) { - this.remoteField = remoteField; - return this; - } - - public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { - this.remoteField = Optional.ofNullable(remoteField); - return this; - } - - public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceRemoteField.java deleted file mode 100644 index f1ddc8ff8..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceRemoteField.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) -public final class FieldMappingApiInstanceRemoteField { - private final Optional remoteKeyName; - - private final Optional> schema; - - private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteField( - Optional remoteKeyName, - Optional> schema, - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, - Map additionalProperties) { - this.remoteKeyName = remoteKeyName; - this.schema = schema; - this.remoteEndpointInfo = remoteEndpointInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("schema") - public Optional> getSchema() { - return schema; - } - - @JsonProperty("remote_endpoint_info") - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteField - && equalTo((FieldMappingApiInstanceRemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteField other) { - return remoteKeyName.equals(other.remoteKeyName) - && schema.equals(other.schema) - && remoteEndpointInfo.equals(other.remoteEndpointInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteEndpointInfoStage builder() { - return new Builder(); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); - - Builder from(FieldMappingApiInstanceRemoteField other); - } - - public interface _FinalStage { - FieldMappingApiInstanceRemoteField build(); - - _FinalStage remoteKeyName(Optional remoteKeyName); - - _FinalStage remoteKeyName(String remoteKeyName); - - _FinalStage schema(Optional> schema); - - _FinalStage schema(Map schema); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private Optional> schema = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceRemoteField other) { - remoteKeyName(other.getRemoteKeyName()); - schema(other.getSchema()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage schema(Map schema) { - this.schema = Optional.ofNullable(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Optional> schema) { - this.schema = schema; - return this; - } - - @java.lang.Override - public _FinalStage remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public _FinalStage remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceRemoteField build() { - return new FieldMappingApiInstanceRemoteField( - remoteKeyName, schema, remoteEndpointInfo, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java deleted file mode 100644 index 08b477b22..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) -public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { - private final Optional method; - - private final Optional urlPath; - - private final Optional> fieldTraversalPath; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - Optional method, - Optional urlPath, - Optional> fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public Optional getMethod() { - return method; - } - - @JsonProperty("url_path") - public Optional getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public Optional> getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional method = Optional.empty(); - - private Optional urlPath = Optional.empty(); - - private Optional> fieldTraversalPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @JsonSetter(value = "method", nulls = Nulls.SKIP) - public Builder method(Optional method) { - this.method = method; - return this; - } - - public Builder method(String method) { - this.method = Optional.ofNullable(method); - return this; - } - - @JsonSetter(value = "url_path", nulls = Nulls.SKIP) - public Builder urlPath(Optional urlPath) { - this.urlPath = urlPath; - return this; - } - - public Builder urlPath(String urlPath) { - this.urlPath = Optional.ofNullable(urlPath); - return this; - } - - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public Builder fieldTraversalPath(Optional> fieldTraversalPath) { - this.fieldTraversalPath = fieldTraversalPath; - return this; - } - - public Builder fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); - return this; - } - - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { - return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceResponse.java deleted file mode 100644 index 6122d53a8..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceResponse.java +++ /dev/null @@ -1,300 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) -public final class FieldMappingApiInstanceResponse { - private final Optional> account; - - private final Optional> contact; - - private final Optional> lead; - - private final Optional> note; - - private final Optional> opportunity; - - private final Optional> stage; - - private final Optional> user; - - private final Optional> task; - - private final Optional> engagement; - - private final Map additionalProperties; - - private FieldMappingApiInstanceResponse( - Optional> account, - Optional> contact, - Optional> lead, - Optional> note, - Optional> opportunity, - Optional> stage, - Optional> user, - Optional> task, - Optional> engagement, - Map additionalProperties) { - this.account = account; - this.contact = contact; - this.lead = lead; - this.note = note; - this.opportunity = opportunity; - this.stage = stage; - this.user = user; - this.task = task; - this.engagement = engagement; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @JsonProperty("Lead") - public Optional> getLead() { - return lead; - } - - @JsonProperty("Note") - public Optional> getNote() { - return note; - } - - @JsonProperty("Opportunity") - public Optional> getOpportunity() { - return opportunity; - } - - @JsonProperty("Stage") - public Optional> getStage() { - return stage; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @JsonProperty("Task") - public Optional> getTask() { - return task; - } - - @JsonProperty("Engagement") - public Optional> getEngagement() { - return engagement; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceResponse other) { - return account.equals(other.account) - && contact.equals(other.contact) - && lead.equals(other.lead) - && note.equals(other.note) - && opportunity.equals(other.opportunity) - && stage.equals(other.stage) - && user.equals(other.user) - && task.equals(other.task) - && engagement.equals(other.engagement); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.account, - this.contact, - this.lead, - this.note, - this.opportunity, - this.stage, - this.user, - this.task, - this.engagement); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> account = Optional.empty(); - - private Optional> contact = Optional.empty(); - - private Optional> lead = Optional.empty(); - - private Optional> note = Optional.empty(); - - private Optional> opportunity = Optional.empty(); - - private Optional> stage = Optional.empty(); - - private Optional> user = Optional.empty(); - - private Optional> task = Optional.empty(); - - private Optional> engagement = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceResponse other) { - account(other.getAccount()); - contact(other.getContact()); - lead(other.getLead()); - note(other.getNote()); - opportunity(other.getOpportunity()); - stage(other.getStage()); - user(other.getUser()); - task(other.getTask()); - engagement(other.getEngagement()); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - @JsonSetter(value = "Lead", nulls = Nulls.SKIP) - public Builder lead(Optional> lead) { - this.lead = lead; - return this; - } - - public Builder lead(List lead) { - this.lead = Optional.ofNullable(lead); - return this; - } - - @JsonSetter(value = "Note", nulls = Nulls.SKIP) - public Builder note(Optional> note) { - this.note = note; - return this; - } - - public Builder note(List note) { - this.note = Optional.ofNullable(note); - return this; - } - - @JsonSetter(value = "Opportunity", nulls = Nulls.SKIP) - public Builder opportunity(Optional> opportunity) { - this.opportunity = opportunity; - return this; - } - - public Builder opportunity(List opportunity) { - this.opportunity = Optional.ofNullable(opportunity); - return this; - } - - @JsonSetter(value = "Stage", nulls = Nulls.SKIP) - public Builder stage(Optional> stage) { - this.stage = stage; - return this; - } - - public Builder stage(List stage) { - this.stage = Optional.ofNullable(stage); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - @JsonSetter(value = "Task", nulls = Nulls.SKIP) - public Builder task(Optional> task) { - this.task = task; - return this; - } - - public Builder task(List task) { - this.task = Optional.ofNullable(task); - return this; - } - - @JsonSetter(value = "Engagement", nulls = Nulls.SKIP) - public Builder engagement(Optional> engagement) { - this.engagement = engagement; - return this; - } - - public Builder engagement(List engagement) { - this.engagement = Optional.ofNullable(engagement); - return this; - } - - public FieldMappingApiInstanceResponse build() { - return new FieldMappingApiInstanceResponse( - account, contact, lead, note, opportunity, stage, user, task, engagement, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceTargetField.java deleted file mode 100644 index bbd88cbba..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldMappingApiInstanceTargetField.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) -public final class FieldMappingApiInstanceTargetField { - private final String name; - - private final String description; - - private final boolean isOrganizationWide; - - private final Map additionalProperties; - - private FieldMappingApiInstanceTargetField( - String name, String description, boolean isOrganizationWide, Map additionalProperties) { - this.name = name; - this.description = description; - this.isOrganizationWide = isOrganizationWide; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("is_organization_wide") - public boolean getIsOrganizationWide() { - return isOrganizationWide; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceTargetField - && equalTo((FieldMappingApiInstanceTargetField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceTargetField other) { - return name.equals(other.name) - && description.equals(other.description) - && isOrganizationWide == other.isOrganizationWide; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isOrganizationWide); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DescriptionStage name(@NotNull String name); - - Builder from(FieldMappingApiInstanceTargetField other); - } - - public interface DescriptionStage { - IsOrganizationWideStage description(@NotNull String description); - } - - public interface IsOrganizationWideStage { - _FinalStage isOrganizationWide(boolean isOrganizationWide); - } - - public interface _FinalStage { - FieldMappingApiInstanceTargetField build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { - private String name; - - private String description; - - private boolean isOrganizationWide; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceTargetField other) { - name(other.getName()); - description(other.getDescription()); - isOrganizationWide(other.getIsOrganizationWide()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public DescriptionStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("description") - public IsOrganizationWideStage description(@NotNull String description) { - this.description = description; - return this; - } - - @java.lang.Override - @JsonSetter("is_organization_wide") - public _FinalStage isOrganizationWide(boolean isOrganizationWide) { - this.isOrganizationWide = isOrganizationWide; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceTargetField build() { - return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/resources/crm/types/FieldMappingInstanceResponse.java deleted file mode 100644 index 2c22ebce2..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldMappingInstanceResponse.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) -public final class FieldMappingInstanceResponse { - private final FieldMappingApiInstance model; - - private final List warnings; - - private final List errors; - - private final Optional> logs; - - private final Map additionalProperties; - - private FieldMappingInstanceResponse( - FieldMappingApiInstance model, - List warnings, - List errors, - Optional> logs, - Map additionalProperties) { - this.model = model; - this.warnings = warnings; - this.errors = errors; - this.logs = logs; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model") - public FieldMappingApiInstance getModel() { - return model; - } - - @JsonProperty("warnings") - public List getWarnings() { - return warnings; - } - - @JsonProperty("errors") - public List getErrors() { - return errors; - } - - @JsonProperty("logs") - public Optional> getLogs() { - return logs; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingInstanceResponse other) { - return model.equals(other.model) - && warnings.equals(other.warnings) - && errors.equals(other.errors) - && logs.equals(other.logs); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.warnings, this.errors, this.logs); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelStage builder() { - return new Builder(); - } - - public interface ModelStage { - _FinalStage model(@NotNull FieldMappingApiInstance model); - - Builder from(FieldMappingInstanceResponse other); - } - - public interface _FinalStage { - FieldMappingInstanceResponse build(); - - _FinalStage warnings(List warnings); - - _FinalStage addWarnings(WarningValidationProblem warnings); - - _FinalStage addAllWarnings(List warnings); - - _FinalStage errors(List errors); - - _FinalStage addErrors(ErrorValidationProblem errors); - - _FinalStage addAllErrors(List errors); - - _FinalStage logs(Optional> logs); - - _FinalStage logs(List logs); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelStage, _FinalStage { - private FieldMappingApiInstance model; - - private Optional> logs = Optional.empty(); - - private List errors = new ArrayList<>(); - - private List warnings = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingInstanceResponse other) { - model(other.getModel()); - warnings(other.getWarnings()); - errors(other.getErrors()); - logs(other.getLogs()); - return this; - } - - @java.lang.Override - @JsonSetter("model") - public _FinalStage model(@NotNull FieldMappingApiInstance model) { - this.model = model; - return this; - } - - @java.lang.Override - public _FinalStage logs(List logs) { - this.logs = Optional.ofNullable(logs); - return this; - } - - @java.lang.Override - @JsonSetter(value = "logs", nulls = Nulls.SKIP) - public _FinalStage logs(Optional> logs) { - this.logs = logs; - return this; - } - - @java.lang.Override - public _FinalStage addAllErrors(List errors) { - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addErrors(ErrorValidationProblem errors) { - this.errors.add(errors); - return this; - } - - @java.lang.Override - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public _FinalStage errors(List errors) { - this.errors.clear(); - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addAllWarnings(List warnings) { - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public _FinalStage addWarnings(WarningValidationProblem warnings) { - this.warnings.add(warnings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public _FinalStage warnings(List warnings) { - this.warnings.clear(); - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public FieldMappingInstanceResponse build() { - return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/resources/crm/types/FieldPermissionDeserializer.java deleted file mode 100644 index 6e7919881..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldPermissionDeserializer.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) -public final class FieldPermissionDeserializer { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializer( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializer other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializer other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializer build() { - return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/crm/types/FieldPermissionDeserializerRequest.java deleted file mode 100644 index bee65205a..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldPermissionDeserializerRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) -public final class FieldPermissionDeserializerRequest { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializerRequest( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializerRequest - && equalTo((FieldPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializerRequest other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializerRequest other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializerRequest build() { - return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/FieldTypeEnum.java b/src/main/java/com/merge/api/resources/crm/types/FieldTypeEnum.java deleted file mode 100644 index 22164c1eb..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/FieldTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FieldTypeEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - FieldTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/IgnoreCommonModelRequest.java b/src/main/java/com/merge/api/resources/crm/types/IgnoreCommonModelRequest.java deleted file mode 100644 index 95b3b6835..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/IgnoreCommonModelRequest.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IgnoreCommonModelRequest.Builder.class) -public final class IgnoreCommonModelRequest { - private final ReasonEnum reason; - - private final Optional message; - - private final Map additionalProperties; - - private IgnoreCommonModelRequest( - ReasonEnum reason, Optional message, Map additionalProperties) { - this.reason = reason; - this.message = message; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("reason") - public ReasonEnum getReason() { - return reason; - } - - @JsonProperty("message") - public Optional getMessage() { - return message; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IgnoreCommonModelRequest && equalTo((IgnoreCommonModelRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IgnoreCommonModelRequest other) { - return reason.equals(other.reason) && message.equals(other.message); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.reason, this.message); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ReasonStage builder() { - return new Builder(); - } - - public interface ReasonStage { - _FinalStage reason(@NotNull ReasonEnum reason); - - Builder from(IgnoreCommonModelRequest other); - } - - public interface _FinalStage { - IgnoreCommonModelRequest build(); - - _FinalStage message(Optional message); - - _FinalStage message(String message); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ReasonStage, _FinalStage { - private ReasonEnum reason; - - private Optional message = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IgnoreCommonModelRequest other) { - reason(other.getReason()); - message(other.getMessage()); - return this; - } - - @java.lang.Override - @JsonSetter("reason") - public _FinalStage reason(@NotNull ReasonEnum reason) { - this.reason = reason; - return this; - } - - @java.lang.Override - public _FinalStage message(String message) { - this.message = Optional.ofNullable(message); - return this; - } - - @java.lang.Override - @JsonSetter(value = "message", nulls = Nulls.SKIP) - public _FinalStage message(Optional message) { - this.message = message; - return this; - } - - @java.lang.Override - public IgnoreCommonModelRequest build() { - return new IgnoreCommonModelRequest(reason, message, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/resources/crm/types/IndividualCommonModelScopeDeserializer.java deleted file mode 100644 index 3fb1f876f..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/IndividualCommonModelScopeDeserializer.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) -public final class IndividualCommonModelScopeDeserializer { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializer( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializer - && equalTo((IndividualCommonModelScopeDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializer other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializer other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializer build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializer other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions(Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializer build() { - return new IndividualCommonModelScopeDeserializer( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/crm/types/IndividualCommonModelScopeDeserializerRequest.java deleted file mode 100644 index f67fec9f7..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/IndividualCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) -public final class IndividualCommonModelScopeDeserializerRequest { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializerRequest( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializerRequest - && equalTo((IndividualCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializerRequest other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializerRequest build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializerRequest other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions( - Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializerRequest build() { - return new IndividualCommonModelScopeDeserializerRequest( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/Issue.java b/src/main/java/com/merge/api/resources/crm/types/Issue.java deleted file mode 100644 index 16b5c2b67..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/Issue.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Issue.Builder.class) -public final class Issue { - private final Optional id; - - private final Optional status; - - private final String errorDescription; - - private final Optional> endUser; - - private final Optional firstIncidentTime; - - private final Optional lastIncidentTime; - - private final Optional isMuted; - - private final Optional> errorDetails; - - private final Map additionalProperties; - - private Issue( - Optional id, - Optional status, - String errorDescription, - Optional> endUser, - Optional firstIncidentTime, - Optional lastIncidentTime, - Optional isMuted, - Optional> errorDetails, - Map additionalProperties) { - this.id = id; - this.status = status; - this.errorDescription = errorDescription; - this.endUser = endUser; - this.firstIncidentTime = firstIncidentTime; - this.lastIncidentTime = lastIncidentTime; - this.isMuted = isMuted; - this.errorDetails = errorDetails; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("error_description") - public String getErrorDescription() { - return errorDescription; - } - - @JsonProperty("end_user") - public Optional> getEndUser() { - return endUser; - } - - @JsonProperty("first_incident_time") - public Optional getFirstIncidentTime() { - return firstIncidentTime; - } - - @JsonProperty("last_incident_time") - public Optional getLastIncidentTime() { - return lastIncidentTime; - } - - @JsonProperty("is_muted") - public Optional getIsMuted() { - return isMuted; - } - - @JsonProperty("error_details") - public Optional> getErrorDetails() { - return errorDetails; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Issue && equalTo((Issue) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Issue other) { - return id.equals(other.id) - && status.equals(other.status) - && errorDescription.equals(other.errorDescription) - && endUser.equals(other.endUser) - && firstIncidentTime.equals(other.firstIncidentTime) - && lastIncidentTime.equals(other.lastIncidentTime) - && isMuted.equals(other.isMuted) - && errorDetails.equals(other.errorDetails); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.status, - this.errorDescription, - this.endUser, - this.firstIncidentTime, - this.lastIncidentTime, - this.isMuted, - this.errorDetails); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ErrorDescriptionStage builder() { - return new Builder(); - } - - public interface ErrorDescriptionStage { - _FinalStage errorDescription(@NotNull String errorDescription); - - Builder from(Issue other); - } - - public interface _FinalStage { - Issue build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage status(Optional status); - - _FinalStage status(IssueStatus status); - - _FinalStage endUser(Optional> endUser); - - _FinalStage endUser(Map endUser); - - _FinalStage firstIncidentTime(Optional firstIncidentTime); - - _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); - - _FinalStage lastIncidentTime(Optional lastIncidentTime); - - _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); - - _FinalStage isMuted(Optional isMuted); - - _FinalStage isMuted(Boolean isMuted); - - _FinalStage errorDetails(Optional> errorDetails); - - _FinalStage errorDetails(List errorDetails); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ErrorDescriptionStage, _FinalStage { - private String errorDescription; - - private Optional> errorDetails = Optional.empty(); - - private Optional isMuted = Optional.empty(); - - private Optional lastIncidentTime = Optional.empty(); - - private Optional firstIncidentTime = Optional.empty(); - - private Optional> endUser = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Issue other) { - id(other.getId()); - status(other.getStatus()); - errorDescription(other.getErrorDescription()); - endUser(other.getEndUser()); - firstIncidentTime(other.getFirstIncidentTime()); - lastIncidentTime(other.getLastIncidentTime()); - isMuted(other.getIsMuted()); - errorDetails(other.getErrorDetails()); - return this; - } - - @java.lang.Override - @JsonSetter("error_description") - public _FinalStage errorDescription(@NotNull String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - @java.lang.Override - public _FinalStage errorDetails(List errorDetails) { - this.errorDetails = Optional.ofNullable(errorDetails); - return this; - } - - @java.lang.Override - @JsonSetter(value = "error_details", nulls = Nulls.SKIP) - public _FinalStage errorDetails(Optional> errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - @java.lang.Override - public _FinalStage isMuted(Boolean isMuted) { - this.isMuted = Optional.ofNullable(isMuted); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) - public _FinalStage isMuted(Optional isMuted) { - this.isMuted = isMuted; - return this; - } - - @java.lang.Override - public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { - this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) - public _FinalStage lastIncidentTime(Optional lastIncidentTime) { - this.lastIncidentTime = lastIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { - this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) - public _FinalStage firstIncidentTime(Optional firstIncidentTime) { - this.firstIncidentTime = firstIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage endUser(Map endUser) { - this.endUser = Optional.ofNullable(endUser); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user", nulls = Nulls.SKIP) - public _FinalStage endUser(Optional> endUser) { - this.endUser = endUser; - return this; - } - - /** - *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

- *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage status(IssueStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public Issue build() { - return new Issue( - id, - status, - errorDescription, - endUser, - firstIncidentTime, - lastIncidentTime, - isMuted, - errorDetails, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/IssueStatus.java b/src/main/java/com/merge/api/resources/crm/types/IssueStatus.java deleted file mode 100644 index 424a4317d..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/IssueStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IssueStatus.Deserializer.class) -public final class IssueStatus { - private final Object value; - - private final int type; - - private IssueStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((IssueStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssueStatus && equalTo((IssueStatus) other); - } - - private boolean equalTo(IssueStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IssueStatus of(IssueStatusEnum value) { - return new IssueStatus(value, 0); - } - - public static IssueStatus of(String value) { - return new IssueStatus(value, 1); - } - - public interface Visitor { - T visit(IssueStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IssueStatus.class); - } - - @java.lang.Override - public IssueStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/IssueStatusEnum.java b/src/main/java/com/merge/api/resources/crm/types/IssueStatusEnum.java deleted file mode 100644 index 65cd48381..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/IssueStatusEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssueStatusEnum { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssueStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ItemFormatEnum.java b/src/main/java/com/merge/api/resources/crm/types/ItemFormatEnum.java deleted file mode 100644 index f6ce834b3..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ItemFormatEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemFormatEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - ItemFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ItemSchema.java b/src/main/java/com/merge/api/resources/crm/types/ItemSchema.java deleted file mode 100644 index 76817ca34..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ItemSchema.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ItemSchema.Builder.class) -public final class ItemSchema { - private final Optional itemType; - - private final Optional itemFormat; - - private final Optional> itemChoices; - - private final Map additionalProperties; - - private ItemSchema( - Optional itemType, - Optional itemFormat, - Optional> itemChoices, - Map additionalProperties) { - this.itemType = itemType; - this.itemFormat = itemFormat; - this.itemChoices = itemChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("item_type") - public Optional getItemType() { - return itemType; - } - - @JsonProperty("item_format") - public Optional getItemFormat() { - return itemFormat; - } - - @JsonProperty("item_choices") - public Optional> getItemChoices() { - return itemChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ItemSchema && equalTo((ItemSchema) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ItemSchema other) { - return itemType.equals(other.itemType) - && itemFormat.equals(other.itemFormat) - && itemChoices.equals(other.itemChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional itemType = Optional.empty(); - - private Optional itemFormat = Optional.empty(); - - private Optional> itemChoices = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ItemSchema other) { - itemType(other.getItemType()); - itemFormat(other.getItemFormat()); - itemChoices(other.getItemChoices()); - return this; - } - - @JsonSetter(value = "item_type", nulls = Nulls.SKIP) - public Builder itemType(Optional itemType) { - this.itemType = itemType; - return this; - } - - public Builder itemType(ItemTypeEnum itemType) { - this.itemType = Optional.ofNullable(itemType); - return this; - } - - @JsonSetter(value = "item_format", nulls = Nulls.SKIP) - public Builder itemFormat(Optional itemFormat) { - this.itemFormat = itemFormat; - return this; - } - - public Builder itemFormat(ItemFormatEnum itemFormat) { - this.itemFormat = Optional.ofNullable(itemFormat); - return this; - } - - @JsonSetter(value = "item_choices", nulls = Nulls.SKIP) - public Builder itemChoices(Optional> itemChoices) { - this.itemChoices = itemChoices; - return this; - } - - public Builder itemChoices(List itemChoices) { - this.itemChoices = Optional.ofNullable(itemChoices); - return this; - } - - public ItemSchema build() { - return new ItemSchema(itemType, itemFormat, itemChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ItemTypeEnum.java b/src/main/java/com/merge/api/resources/crm/types/ItemTypeEnum.java deleted file mode 100644 index 366b9287f..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ItemTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemTypeEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - ItemTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/LanguageEnum.java b/src/main/java/com/merge/api/resources/crm/types/LanguageEnum.java deleted file mode 100644 index 33c3c37c0..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/LanguageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LanguageEnum { - EN("en"), - - DE("de"); - - private final String value; - - LanguageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/LinkToken.java b/src/main/java/com/merge/api/resources/crm/types/LinkToken.java deleted file mode 100644 index bf7d72a74..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/LinkToken.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkToken.Builder.class) -public final class LinkToken { - private final String linkToken; - - private final Optional integrationName; - - private final Optional magicLinkUrl; - - private final Map additionalProperties; - - private LinkToken( - String linkToken, - Optional integrationName, - Optional magicLinkUrl, - Map additionalProperties) { - this.linkToken = linkToken; - this.integrationName = integrationName; - this.magicLinkUrl = magicLinkUrl; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("link_token") - public String getLinkToken() { - return linkToken; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - @JsonProperty("magic_link_url") - public Optional getMagicLinkUrl() { - return magicLinkUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkToken && equalTo((LinkToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkToken other) { - return linkToken.equals(other.linkToken) - && integrationName.equals(other.integrationName) - && magicLinkUrl.equals(other.magicLinkUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkTokenStage builder() { - return new Builder(); - } - - public interface LinkTokenStage { - _FinalStage linkToken(@NotNull String linkToken); - - Builder from(LinkToken other); - } - - public interface _FinalStage { - LinkToken build(); - - _FinalStage integrationName(Optional integrationName); - - _FinalStage integrationName(String integrationName); - - _FinalStage magicLinkUrl(Optional magicLinkUrl); - - _FinalStage magicLinkUrl(String magicLinkUrl); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkTokenStage, _FinalStage { - private String linkToken; - - private Optional magicLinkUrl = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkToken other) { - linkToken(other.getLinkToken()); - integrationName(other.getIntegrationName()); - magicLinkUrl(other.getMagicLinkUrl()); - return this; - } - - @java.lang.Override - @JsonSetter("link_token") - public _FinalStage linkToken(@NotNull String linkToken) { - this.linkToken = linkToken; - return this; - } - - @java.lang.Override - public _FinalStage magicLinkUrl(String magicLinkUrl) { - this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) - public _FinalStage magicLinkUrl(Optional magicLinkUrl) { - this.magicLinkUrl = magicLinkUrl; - return this; - } - - @java.lang.Override - public _FinalStage integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public _FinalStage integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - @java.lang.Override - public LinkToken build() { - return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/resources/crm/types/LinkedAccountStatus.java deleted file mode 100644 index 6e71c3ee5..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/LinkedAccountStatus.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) -public final class LinkedAccountStatus { - private final String linkedAccountStatus; - - private final boolean canMakeRequest; - - private final Map additionalProperties; - - private LinkedAccountStatus( - String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { - this.linkedAccountStatus = linkedAccountStatus; - this.canMakeRequest = canMakeRequest; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("linked_account_status") - public String getLinkedAccountStatus() { - return linkedAccountStatus; - } - - @JsonProperty("can_make_request") - public boolean getCanMakeRequest() { - return canMakeRequest; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountStatus other) { - return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkedAccountStatusStage builder() { - return new Builder(); - } - - public interface LinkedAccountStatusStage { - CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); - - Builder from(LinkedAccountStatus other); - } - - public interface CanMakeRequestStage { - _FinalStage canMakeRequest(boolean canMakeRequest); - } - - public interface _FinalStage { - LinkedAccountStatus build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { - private String linkedAccountStatus; - - private boolean canMakeRequest; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkedAccountStatus other) { - linkedAccountStatus(other.getLinkedAccountStatus()); - canMakeRequest(other.getCanMakeRequest()); - return this; - } - - @java.lang.Override - @JsonSetter("linked_account_status") - public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { - this.linkedAccountStatus = linkedAccountStatus; - return this; - } - - @java.lang.Override - @JsonSetter("can_make_request") - public _FinalStage canMakeRequest(boolean canMakeRequest) { - this.canMakeRequest = canMakeRequest; - return this; - } - - @java.lang.Override - public LinkedAccountStatus build() { - return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/MetaResponse.java b/src/main/java/com/merge/api/resources/crm/types/MetaResponse.java deleted file mode 100644 index 081777027..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/MetaResponse.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MetaResponse.Builder.class) -public final class MetaResponse { - private final Map requestSchema; - - private final Optional> remoteFieldClasses; - - private final Optional status; - - private final boolean hasConditionalParams; - - private final boolean hasRequiredLinkedAccountParams; - - private final Map additionalProperties; - - private MetaResponse( - Map requestSchema, - Optional> remoteFieldClasses, - Optional status, - boolean hasConditionalParams, - boolean hasRequiredLinkedAccountParams, - Map additionalProperties) { - this.requestSchema = requestSchema; - this.remoteFieldClasses = remoteFieldClasses; - this.status = status; - this.hasConditionalParams = hasConditionalParams; - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("request_schema") - public Map getRequestSchema() { - return requestSchema; - } - - @JsonProperty("remote_field_classes") - public Optional> getRemoteFieldClasses() { - return remoteFieldClasses; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("has_conditional_params") - public boolean getHasConditionalParams() { - return hasConditionalParams; - } - - @JsonProperty("has_required_linked_account_params") - public boolean getHasRequiredLinkedAccountParams() { - return hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MetaResponse && equalTo((MetaResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MetaResponse other) { - return requestSchema.equals(other.requestSchema) - && remoteFieldClasses.equals(other.remoteFieldClasses) - && status.equals(other.status) - && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.requestSchema, - this.remoteFieldClasses, - this.status, - this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static HasConditionalParamsStage builder() { - return new Builder(); - } - - public interface HasConditionalParamsStage { - HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); - - Builder from(MetaResponse other); - } - - public interface HasRequiredLinkedAccountParamsStage { - _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); - } - - public interface _FinalStage { - MetaResponse build(); - - _FinalStage requestSchema(Map requestSchema); - - _FinalStage putAllRequestSchema(Map requestSchema); - - _FinalStage requestSchema(String key, JsonNode value); - - _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); - - _FinalStage remoteFieldClasses(Map remoteFieldClasses); - - _FinalStage status(Optional status); - - _FinalStage status(LinkedAccountStatus status); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { - private boolean hasConditionalParams; - - private boolean hasRequiredLinkedAccountParams; - - private Optional status = Optional.empty(); - - private Optional> remoteFieldClasses = Optional.empty(); - - private Map requestSchema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MetaResponse other) { - requestSchema(other.getRequestSchema()); - remoteFieldClasses(other.getRemoteFieldClasses()); - status(other.getStatus()); - hasConditionalParams(other.getHasConditionalParams()); - hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); - return this; - } - - @java.lang.Override - @JsonSetter("has_conditional_params") - public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { - this.hasConditionalParams = hasConditionalParams; - return this; - } - - @java.lang.Override - @JsonSetter("has_required_linked_account_params") - public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - return this; - } - - @java.lang.Override - public _FinalStage status(LinkedAccountStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { - this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) - public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { - this.remoteFieldClasses = remoteFieldClasses; - return this; - } - - @java.lang.Override - public _FinalStage requestSchema(String key, JsonNode value) { - this.requestSchema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllRequestSchema(Map requestSchema) { - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) - public _FinalStage requestSchema(Map requestSchema) { - this.requestSchema.clear(); - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - public MetaResponse build() { - return new MetaResponse( - requestSchema, - remoteFieldClasses, - status, - hasConditionalParams, - hasRequiredLinkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/MethodEnum.java b/src/main/java/com/merge/api/resources/crm/types/MethodEnum.java deleted file mode 100644 index f2b888919..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/MethodEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum MethodEnum { - GET("GET"), - - OPTIONS("OPTIONS"), - - HEAD("HEAD"), - - POST("POST"), - - PUT("PUT"), - - PATCH("PATCH"), - - DELETE("DELETE"); - - private final String value; - - MethodEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ModelOperation.java b/src/main/java/com/merge/api/resources/crm/types/ModelOperation.java deleted file mode 100644 index 851dc8c6f..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ModelOperation.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelOperation.Builder.class) -public final class ModelOperation { - private final String modelName; - - private final List availableOperations; - - private final List requiredPostParameters; - - private final List supportedFields; - - private final Map additionalProperties; - - private ModelOperation( - String modelName, - List availableOperations, - List requiredPostParameters, - List supportedFields, - Map additionalProperties) { - this.modelName = modelName; - this.availableOperations = availableOperations; - this.requiredPostParameters = requiredPostParameters; - this.supportedFields = supportedFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("available_operations") - public List getAvailableOperations() { - return availableOperations; - } - - @JsonProperty("required_post_parameters") - public List getRequiredPostParameters() { - return requiredPostParameters; - } - - @JsonProperty("supported_fields") - public List getSupportedFields() { - return supportedFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelOperation && equalTo((ModelOperation) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelOperation other) { - return modelName.equals(other.modelName) - && availableOperations.equals(other.availableOperations) - && requiredPostParameters.equals(other.requiredPostParameters) - && supportedFields.equals(other.supportedFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(ModelOperation other); - } - - public interface _FinalStage { - ModelOperation build(); - - _FinalStage availableOperations(List availableOperations); - - _FinalStage addAvailableOperations(String availableOperations); - - _FinalStage addAllAvailableOperations(List availableOperations); - - _FinalStage requiredPostParameters(List requiredPostParameters); - - _FinalStage addRequiredPostParameters(String requiredPostParameters); - - _FinalStage addAllRequiredPostParameters(List requiredPostParameters); - - _FinalStage supportedFields(List supportedFields); - - _FinalStage addSupportedFields(String supportedFields); - - _FinalStage addAllSupportedFields(List supportedFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private List supportedFields = new ArrayList<>(); - - private List requiredPostParameters = new ArrayList<>(); - - private List availableOperations = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ModelOperation other) { - modelName(other.getModelName()); - availableOperations(other.getAvailableOperations()); - requiredPostParameters(other.getRequiredPostParameters()); - supportedFields(other.getSupportedFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage addAllSupportedFields(List supportedFields) { - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addSupportedFields(String supportedFields) { - this.supportedFields.add(supportedFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) - public _FinalStage supportedFields(List supportedFields) { - this.supportedFields.clear(); - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addRequiredPostParameters(String requiredPostParameters) { - this.requiredPostParameters.add(requiredPostParameters); - return this; - } - - @java.lang.Override - @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) - public _FinalStage requiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.clear(); - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addAllAvailableOperations(List availableOperations) { - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public _FinalStage addAvailableOperations(String availableOperations) { - this.availableOperations.add(availableOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) - public _FinalStage availableOperations(List availableOperations) { - this.availableOperations.clear(); - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public ModelOperation build() { - return new ModelOperation( - modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/resources/crm/types/ModelPermissionDeserializer.java deleted file mode 100644 index 1861eb478..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ModelPermissionDeserializer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) -public final class ModelPermissionDeserializer { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializer other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializer other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializer build() { - return new ModelPermissionDeserializer(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/crm/types/ModelPermissionDeserializerRequest.java deleted file mode 100644 index 54c481bc9..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ModelPermissionDeserializerRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) -public final class ModelPermissionDeserializerRequest { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializerRequest - && equalTo((ModelPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializerRequest other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializerRequest other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializerRequest build() { - return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/resources/crm/types/MultipartFormFieldRequest.java deleted file mode 100644 index 185fc16ff..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/MultipartFormFieldRequest.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) -public final class MultipartFormFieldRequest { - private final String name; - - private final String data; - - private final Optional encoding; - - private final Optional fileName; - - private final Optional contentType; - - private final Map additionalProperties; - - private MultipartFormFieldRequest( - String name, - String data, - Optional encoding, - Optional fileName, - Optional contentType, - Map additionalProperties) { - this.name = name; - this.data = data; - this.encoding = encoding; - this.fileName = fileName; - this.contentType = contentType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the form field - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The data for the form field. - */ - @JsonProperty("data") - public String getData() { - return data; - } - - /** - * @return The encoding of the value of data. Defaults to RAW if not defined. - *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- */ - @JsonProperty("encoding") - public Optional getEncoding() { - return encoding; - } - - /** - * @return The file name of the form field, if the field is for a file. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The MIME type of the file, if the field is for a file. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MultipartFormFieldRequest other) { - return name.equals(other.name) - && data.equals(other.data) - && encoding.equals(other.encoding) - && fileName.equals(other.fileName) - && contentType.equals(other.contentType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DataStage name(@NotNull String name); - - Builder from(MultipartFormFieldRequest other); - } - - public interface DataStage { - _FinalStage data(@NotNull String data); - } - - public interface _FinalStage { - MultipartFormFieldRequest build(); - - _FinalStage encoding(Optional encoding); - - _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); - - _FinalStage fileName(Optional fileName); - - _FinalStage fileName(String fileName); - - _FinalStage contentType(Optional contentType); - - _FinalStage contentType(String contentType); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DataStage, _FinalStage { - private String name; - - private String data; - - private Optional contentType = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional encoding = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MultipartFormFieldRequest other) { - name(other.getName()); - data(other.getData()); - encoding(other.getEncoding()); - fileName(other.getFileName()); - contentType(other.getContentType()); - return this; - } - - /** - *

The name of the form field

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public DataStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

The data for the form field.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull String data) { - this.data = data; - return this; - } - - /** - *

The MIME type of the file, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public _FinalStage contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - /** - *

The file name of the form field, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public _FinalStage fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - /** - *

The encoding of the value of data. Defaults to RAW if not defined.

- *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { - this.encoding = Optional.ofNullable(encoding); - return this; - } - - @java.lang.Override - @JsonSetter(value = "encoding", nulls = Nulls.SKIP) - public _FinalStage encoding(Optional encoding) { - this.encoding = encoding; - return this; - } - - @java.lang.Override - public MultipartFormFieldRequest build() { - return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/resources/crm/types/MultipartFormFieldRequestEncoding.java deleted file mode 100644 index 881cf5df5..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/MultipartFormFieldRequestEncoding.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) -public final class MultipartFormFieldRequestEncoding { - private final Object value; - - private final int type; - - private MultipartFormFieldRequestEncoding(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EncodingEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); - } - - private boolean equalTo(MultipartFormFieldRequestEncoding other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { - return new MultipartFormFieldRequestEncoding(value, 0); - } - - public static MultipartFormFieldRequestEncoding of(String value) { - return new MultipartFormFieldRequestEncoding(value, 1); - } - - public interface Visitor { - T visit(EncodingEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MultipartFormFieldRequestEncoding.class); - } - - @java.lang.Override - public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequestStatus.java b/src/main/java/com/merge/api/resources/crm/types/OpportunityRequestStatus.java deleted file mode 100644 index 31dc44cb9..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = OpportunityRequestStatus.Deserializer.class) -public final class OpportunityRequestStatus { - private final Object value; - - private final int type; - - private OpportunityRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((OpportunityStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof OpportunityRequestStatus && equalTo((OpportunityRequestStatus) other); - } - - private boolean equalTo(OpportunityRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static OpportunityRequestStatus of(OpportunityStatusEnum value) { - return new OpportunityRequestStatus(value, 0); - } - - public static OpportunityRequestStatus of(String value) { - return new OpportunityRequestStatus(value, 1); - } - - public interface Visitor { - T visit(OpportunityStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(OpportunityRequestStatus.class); - } - - @java.lang.Override - public OpportunityRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, OpportunityStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/OpportunityStatus.java b/src/main/java/com/merge/api/resources/crm/types/OpportunityStatus.java deleted file mode 100644 index 53baf9d0f..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/OpportunityStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = OpportunityStatus.Deserializer.class) -public final class OpportunityStatus { - private final Object value; - - private final int type; - - private OpportunityStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((OpportunityStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof OpportunityStatus && equalTo((OpportunityStatus) other); - } - - private boolean equalTo(OpportunityStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static OpportunityStatus of(OpportunityStatusEnum value) { - return new OpportunityStatus(value, 0); - } - - public static OpportunityStatus of(String value) { - return new OpportunityStatus(value, 1); - } - - public interface Visitor { - T visit(OpportunityStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(OpportunityStatus.class); - } - - @java.lang.Override - public OpportunityStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, OpportunityStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedAccountDetailsAndActionsList.java deleted file mode 100644 index c9d8873d9..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedAccountDetailsAndActionsList.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) -public final class PaginatedAccountDetailsAndActionsList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountDetailsAndActionsList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountDetailsAndActionsList - && equalTo((PaginatedAccountDetailsAndActionsList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountDetailsAndActionsList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountDetailsAndActionsList build() { - return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedAccountList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedAccountList.java deleted file mode 100644 index 838025575..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedAccountList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountList.Builder.class) -public final class PaginatedAccountList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountList && equalTo((PaginatedAccountList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountList build() { - return new PaginatedAccountList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedAuditLogEventList.java deleted file mode 100644 index 1ae686ff2..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedAuditLogEventList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) -public final class PaginatedAuditLogEventList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAuditLogEventList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAuditLogEventList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAuditLogEventList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAuditLogEventList build() { - return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedContactList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedContactList.java deleted file mode 100644 index 17e97a5eb..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedContactList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedContactList.Builder.class) -public final class PaginatedContactList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedContactList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedContactList && equalTo((PaginatedContactList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedContactList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedContactList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedContactList build() { - return new PaginatedContactList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedIssueList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedIssueList.java deleted file mode 100644 index f81be200b..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedIssueList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedIssueList.Builder.class) -public final class PaginatedIssueList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedIssueList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedIssueList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedIssueList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedIssueList build() { - return new PaginatedIssueList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedRemoteFieldClassList.java deleted file mode 100644 index 7debd7043..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedRemoteFieldClassList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedRemoteFieldClassList.Builder.class) -public final class PaginatedRemoteFieldClassList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedRemoteFieldClassList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedRemoteFieldClassList && equalTo((PaginatedRemoteFieldClassList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedRemoteFieldClassList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedRemoteFieldClassList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedRemoteFieldClassList build() { - return new PaginatedRemoteFieldClassList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedSyncStatusList.java deleted file mode 100644 index c9bb4851b..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedSyncStatusList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) -public final class PaginatedSyncStatusList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedSyncStatusList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedSyncStatusList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedSyncStatusList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedSyncStatusList build() { - return new PaginatedSyncStatusList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PaginatedUserList.java b/src/main/java/com/merge/api/resources/crm/types/PaginatedUserList.java deleted file mode 100644 index 70f022774..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PaginatedUserList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedUserList.Builder.class) -public final class PaginatedUserList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedUserList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedUserList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedUserList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedUserList build() { - return new PaginatedUserList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedEngagementRequestDirection.java b/src/main/java/com/merge/api/resources/crm/types/PatchedEngagementRequestDirection.java deleted file mode 100644 index 32f376483..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedEngagementRequestDirection.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PatchedEngagementRequestDirection.Deserializer.class) -public final class PatchedEngagementRequestDirection { - private final Object value; - - private final int type; - - private PatchedEngagementRequestDirection(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((DirectionEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedEngagementRequestDirection && equalTo((PatchedEngagementRequestDirection) other); - } - - private boolean equalTo(PatchedEngagementRequestDirection other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PatchedEngagementRequestDirection of(DirectionEnum value) { - return new PatchedEngagementRequestDirection(value, 0); - } - - public static PatchedEngagementRequestDirection of(String value) { - return new PatchedEngagementRequestDirection(value, 1); - } - - public interface Visitor { - T visit(DirectionEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PatchedEngagementRequestDirection.class); - } - - @java.lang.Override - public PatchedEngagementRequestDirection deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, DirectionEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedOpportunityRequestStatus.java b/src/main/java/com/merge/api/resources/crm/types/PatchedOpportunityRequestStatus.java deleted file mode 100644 index 727989830..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedOpportunityRequestStatus.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PatchedOpportunityRequestStatus.Deserializer.class) -public final class PatchedOpportunityRequestStatus { - private final Object value; - - private final int type; - - private PatchedOpportunityRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((OpportunityStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedOpportunityRequestStatus && equalTo((PatchedOpportunityRequestStatus) other); - } - - private boolean equalTo(PatchedOpportunityRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PatchedOpportunityRequestStatus of(OpportunityStatusEnum value) { - return new PatchedOpportunityRequestStatus(value, 0); - } - - public static PatchedOpportunityRequestStatus of(String value) { - return new PatchedOpportunityRequestStatus(value, 1); - } - - public interface Visitor { - T visit(OpportunityStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PatchedOpportunityRequestStatus.class); - } - - @java.lang.Override - public PatchedOpportunityRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, OpportunityStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PatchedTaskRequestStatus.java b/src/main/java/com/merge/api/resources/crm/types/PatchedTaskRequestStatus.java deleted file mode 100644 index 7318729f4..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PatchedTaskRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PatchedTaskRequestStatus.Deserializer.class) -public final class PatchedTaskRequestStatus { - private final Object value; - - private final int type; - - private PatchedTaskRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TaskStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedTaskRequestStatus && equalTo((PatchedTaskRequestStatus) other); - } - - private boolean equalTo(PatchedTaskRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PatchedTaskRequestStatus of(TaskStatusEnum value) { - return new PatchedTaskRequestStatus(value, 0); - } - - public static PatchedTaskRequestStatus of(String value) { - return new PatchedTaskRequestStatus(value, 1); - } - - public interface Visitor { - T visit(TaskStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PatchedTaskRequestStatus.class); - } - - @java.lang.Override - public PatchedTaskRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaskStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PhoneNumber.java b/src/main/java/com/merge/api/resources/crm/types/PhoneNumber.java deleted file mode 100644 index f8a745885..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PhoneNumber.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PhoneNumber.Builder.class) -public final class PhoneNumber { - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional phoneNumber; - - private final Optional phoneNumberType; - - private final Map additionalProperties; - - private PhoneNumber( - Optional createdAt, - Optional modifiedAt, - Optional phoneNumber, - Optional phoneNumberType, - Map additionalProperties) { - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.phoneNumber = phoneNumber; - this.phoneNumberType = phoneNumberType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The phone number. - */ - @JsonProperty("phone_number") - public Optional getPhoneNumber() { - return phoneNumber; - } - - /** - * @return The phone number's type. - */ - @JsonProperty("phone_number_type") - public Optional getPhoneNumberType() { - return phoneNumberType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneNumber && equalTo((PhoneNumber) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PhoneNumber other) { - return createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && phoneNumber.equals(other.phoneNumber) - && phoneNumberType.equals(other.phoneNumberType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.createdAt, this.modifiedAt, this.phoneNumber, this.phoneNumberType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional phoneNumber = Optional.empty(); - - private Optional phoneNumberType = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PhoneNumber other) { - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - phoneNumber(other.getPhoneNumber()); - phoneNumberType(other.getPhoneNumberType()); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) - public Builder phoneNumber(Optional phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - public Builder phoneNumber(String phoneNumber) { - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - - @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) - public Builder phoneNumberType(Optional phoneNumberType) { - this.phoneNumberType = phoneNumberType; - return this; - } - - public Builder phoneNumberType(String phoneNumberType) { - this.phoneNumberType = Optional.ofNullable(phoneNumberType); - return this; - } - - public PhoneNumber build() { - return new PhoneNumber(createdAt, modifiedAt, phoneNumber, phoneNumberType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/PhoneNumberRequest.java b/src/main/java/com/merge/api/resources/crm/types/PhoneNumberRequest.java deleted file mode 100644 index d13137329..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/PhoneNumberRequest.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PhoneNumberRequest.Builder.class) -public final class PhoneNumberRequest { - private final Optional phoneNumber; - - private final Optional phoneNumberType; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private PhoneNumberRequest( - Optional phoneNumber, - Optional phoneNumberType, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.phoneNumber = phoneNumber; - this.phoneNumberType = phoneNumberType; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The phone number. - */ - @JsonProperty("phone_number") - public Optional getPhoneNumber() { - return phoneNumber; - } - - /** - * @return The phone number's type. - */ - @JsonProperty("phone_number_type") - public Optional getPhoneNumberType() { - return phoneNumberType; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PhoneNumberRequest && equalTo((PhoneNumberRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PhoneNumberRequest other) { - return phoneNumber.equals(other.phoneNumber) - && phoneNumberType.equals(other.phoneNumberType) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.phoneNumber, this.phoneNumberType, this.integrationParams, this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional phoneNumber = Optional.empty(); - - private Optional phoneNumberType = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PhoneNumberRequest other) { - phoneNumber(other.getPhoneNumber()); - phoneNumberType(other.getPhoneNumberType()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) - public Builder phoneNumber(Optional phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - public Builder phoneNumber(String phoneNumber) { - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - - @JsonSetter(value = "phone_number_type", nulls = Nulls.SKIP) - public Builder phoneNumberType(Optional phoneNumberType) { - this.phoneNumberType = phoneNumberType; - return this; - } - - public Builder phoneNumberType(String phoneNumberType) { - this.phoneNumberType = Optional.ofNullable(phoneNumberType); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public PhoneNumberRequest build() { - return new PhoneNumberRequest( - phoneNumber, phoneNumberType, integrationParams, linkedAccountParams, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ReasonEnum.java b/src/main/java/com/merge/api/resources/crm/types/ReasonEnum.java deleted file mode 100644 index 8597ba3b1..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ReasonEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ReasonEnum { - GENERAL_CUSTOMER_REQUEST("GENERAL_CUSTOMER_REQUEST"), - - GDPR("GDPR"), - - OTHER("OTHER"); - - private final String value; - - ReasonEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteData.java b/src/main/java/com/merge/api/resources/crm/types/RemoteData.java deleted file mode 100644 index 24e2d15e2..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteData.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteData.Builder.class) -public final class RemoteData { - private final String path; - - private final Optional data; - - private final Map additionalProperties; - - private RemoteData(String path, Optional data, Map additionalProperties) { - this.path = path; - this.data = data; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API path that is being called. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("data") - public Optional getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteData && equalTo((RemoteData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteData other) { - return path.equals(other.path) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.path, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PathStage builder() { - return new Builder(); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - - Builder from(RemoteData other); - } - - public interface _FinalStage { - RemoteData build(); - - _FinalStage data(Optional data); - - _FinalStage data(JsonNode data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PathStage, _FinalStage { - private String path; - - private Optional data = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteData other) { - path(other.getPath()); - data(other.getData()); - return this; - } - - /** - *

The third-party API path that is being called.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - public _FinalStage data(JsonNode data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - @java.lang.Override - public RemoteData build() { - return new RemoteData(path, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/crm/types/RemoteEndpointInfo.java deleted file mode 100644 index 93e435e7d..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteEndpointInfo.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) -public final class RemoteEndpointInfo { - private final String method; - - private final String urlPath; - - private final List fieldTraversalPath; - - private final Map additionalProperties; - - private RemoteEndpointInfo( - String method, - String urlPath, - List fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("url_path") - public String getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public List getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - UrlPathStage method(@NotNull String method); - - Builder from(RemoteEndpointInfo other); - } - - public interface UrlPathStage { - _FinalStage urlPath(@NotNull String urlPath); - } - - public interface _FinalStage { - RemoteEndpointInfo build(); - - _FinalStage fieldTraversalPath(List fieldTraversalPath); - - _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); - - _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { - private String method; - - private String urlPath; - - private List fieldTraversalPath = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public UrlPathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("url_path") - public _FinalStage urlPath(@NotNull String urlPath) { - this.urlPath = urlPath; - return this; - } - - @java.lang.Override - public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { - this.fieldTraversalPath.add(fieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.clear(); - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public RemoteEndpointInfo build() { - return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteField.java b/src/main/java/com/merge/api/resources/crm/types/RemoteField.java deleted file mode 100644 index 6d33e45c1..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteField.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteField.Builder.class) -public final class RemoteField { - private final RemoteFieldRemoteFieldClass remoteFieldClass; - - private final Optional value; - - private final Map additionalProperties; - - private RemoteField( - RemoteFieldRemoteFieldClass remoteFieldClass, - Optional value, - Map additionalProperties) { - this.remoteFieldClass = remoteFieldClass; - this.value = value; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_field_class") - public RemoteFieldRemoteFieldClass getRemoteFieldClass() { - return remoteFieldClass; - } - - @JsonProperty("value") - public Optional getValue() { - return value; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteField && equalTo((RemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteField other) { - return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldClass, this.value); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteFieldClassStage builder() { - return new Builder(); - } - - public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass); - - Builder from(RemoteField other); - } - - public interface _FinalStage { - RemoteField build(); - - _FinalStage value(Optional value); - - _FinalStage value(JsonNode value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldRemoteFieldClass remoteFieldClass; - - private Optional value = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteField other) { - remoteFieldClass(other.getRemoteFieldClass()); - value(other.getValue()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { - this.remoteFieldClass = remoteFieldClass; - return this; - } - - @java.lang.Override - public _FinalStage value(JsonNode value) { - this.value = Optional.ofNullable(value); - return this; - } - - @java.lang.Override - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public _FinalStage value(Optional value) { - this.value = value; - return this; - } - - @java.lang.Override - public RemoteField build() { - return new RemoteField(remoteFieldClass, value, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApi.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApi.java deleted file mode 100644 index 0a77b87ce..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApi.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApi.Builder.class) -public final class RemoteFieldApi { - private final Map schema; - - private final String remoteKeyName; - - private final RemoteEndpointInfo remoteEndpointInfo; - - private final Optional> exampleValues; - - private final Optional advancedMetadata; - - private final Optional coverage; - - private final Map additionalProperties; - - private RemoteFieldApi( - Map schema, - String remoteKeyName, - RemoteEndpointInfo remoteEndpointInfo, - Optional> exampleValues, - Optional advancedMetadata, - Optional coverage, - Map additionalProperties) { - this.schema = schema; - this.remoteKeyName = remoteKeyName; - this.remoteEndpointInfo = remoteEndpointInfo; - this.exampleValues = exampleValues; - this.advancedMetadata = advancedMetadata; - this.coverage = coverage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("schema") - public Map getSchema() { - return schema; - } - - @JsonProperty("remote_key_name") - public String getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("remote_endpoint_info") - public RemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @JsonProperty("example_values") - public Optional> getExampleValues() { - return exampleValues; - } - - @JsonProperty("advanced_metadata") - public Optional getAdvancedMetadata() { - return advancedMetadata; - } - - @JsonProperty("coverage") - public Optional getCoverage() { - return coverage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApi other) { - return schema.equals(other.schema) - && remoteKeyName.equals(other.remoteKeyName) - && remoteEndpointInfo.equals(other.remoteEndpointInfo) - && exampleValues.equals(other.exampleValues) - && advancedMetadata.equals(other.advancedMetadata) - && coverage.equals(other.coverage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.schema, - this.remoteKeyName, - this.remoteEndpointInfo, - this.exampleValues, - this.advancedMetadata, - this.coverage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteKeyNameStage builder() { - return new Builder(); - } - - public interface RemoteKeyNameStage { - RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); - - Builder from(RemoteFieldApi other); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); - } - - public interface _FinalStage { - RemoteFieldApi build(); - - _FinalStage schema(Map schema); - - _FinalStage putAllSchema(Map schema); - - _FinalStage schema(String key, JsonNode value); - - _FinalStage exampleValues(Optional> exampleValues); - - _FinalStage exampleValues(List exampleValues); - - _FinalStage advancedMetadata(Optional advancedMetadata); - - _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); - - _FinalStage coverage(Optional coverage); - - _FinalStage coverage(RemoteFieldApiCoverage coverage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { - private String remoteKeyName; - - private RemoteEndpointInfo remoteEndpointInfo; - - private Optional coverage = Optional.empty(); - - private Optional advancedMetadata = Optional.empty(); - - private Optional> exampleValues = Optional.empty(); - - private Map schema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldApi other) { - schema(other.getSchema()); - remoteKeyName(other.getRemoteKeyName()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - exampleValues(other.getExampleValues()); - advancedMetadata(other.getAdvancedMetadata()); - coverage(other.getCoverage()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_key_name") - public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage coverage(RemoteFieldApiCoverage coverage) { - this.coverage = Optional.ofNullable(coverage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "coverage", nulls = Nulls.SKIP) - public _FinalStage coverage(Optional coverage) { - this.coverage = coverage; - return this; - } - - @java.lang.Override - public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { - this.advancedMetadata = Optional.ofNullable(advancedMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) - public _FinalStage advancedMetadata(Optional advancedMetadata) { - this.advancedMetadata = advancedMetadata; - return this; - } - - @java.lang.Override - public _FinalStage exampleValues(List exampleValues) { - this.exampleValues = Optional.ofNullable(exampleValues); - return this; - } - - @java.lang.Override - @JsonSetter(value = "example_values", nulls = Nulls.SKIP) - public _FinalStage exampleValues(Optional> exampleValues) { - this.exampleValues = exampleValues; - return this; - } - - @java.lang.Override - public _FinalStage schema(String key, JsonNode value) { - this.schema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllSchema(Map schema) { - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Map schema) { - this.schema.clear(); - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - public RemoteFieldApi build() { - return new RemoteFieldApi( - schema, - remoteKeyName, - remoteEndpointInfo, - exampleValues, - advancedMetadata, - coverage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApiCoverage.java deleted file mode 100644 index 4c4674fb3..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApiCoverage.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) -public final class RemoteFieldApiCoverage { - private final Object value; - - private final int type; - - private RemoteFieldApiCoverage(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((int) this.value); - } else if (this.type == 1) { - return visitor.visit((double) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); - } - - private boolean equalTo(RemoteFieldApiCoverage other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldApiCoverage of(int value) { - return new RemoteFieldApiCoverage(value, 0); - } - - public static RemoteFieldApiCoverage of(double value) { - return new RemoteFieldApiCoverage(value, 1); - } - - public interface Visitor { - T visit(int value); - - T visit(double value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldApiCoverage.class); - } - - @java.lang.Override - public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - if (value instanceof Integer) { - return of((Integer) value); - } - if (value instanceof Double) { - return of((Double) value); - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApiResponse.java deleted file mode 100644 index 24b6e731c..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldApiResponse.java +++ /dev/null @@ -1,300 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) -public final class RemoteFieldApiResponse { - private final Optional> account; - - private final Optional> contact; - - private final Optional> lead; - - private final Optional> note; - - private final Optional> opportunity; - - private final Optional> stage; - - private final Optional> user; - - private final Optional> task; - - private final Optional> engagement; - - private final Map additionalProperties; - - private RemoteFieldApiResponse( - Optional> account, - Optional> contact, - Optional> lead, - Optional> note, - Optional> opportunity, - Optional> stage, - Optional> user, - Optional> task, - Optional> engagement, - Map additionalProperties) { - this.account = account; - this.contact = contact; - this.lead = lead; - this.note = note; - this.opportunity = opportunity; - this.stage = stage; - this.user = user; - this.task = task; - this.engagement = engagement; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @JsonProperty("Lead") - public Optional> getLead() { - return lead; - } - - @JsonProperty("Note") - public Optional> getNote() { - return note; - } - - @JsonProperty("Opportunity") - public Optional> getOpportunity() { - return opportunity; - } - - @JsonProperty("Stage") - public Optional> getStage() { - return stage; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @JsonProperty("Task") - public Optional> getTask() { - return task; - } - - @JsonProperty("Engagement") - public Optional> getEngagement() { - return engagement; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApiResponse other) { - return account.equals(other.account) - && contact.equals(other.contact) - && lead.equals(other.lead) - && note.equals(other.note) - && opportunity.equals(other.opportunity) - && stage.equals(other.stage) - && user.equals(other.user) - && task.equals(other.task) - && engagement.equals(other.engagement); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.account, - this.contact, - this.lead, - this.note, - this.opportunity, - this.stage, - this.user, - this.task, - this.engagement); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> account = Optional.empty(); - - private Optional> contact = Optional.empty(); - - private Optional> lead = Optional.empty(); - - private Optional> note = Optional.empty(); - - private Optional> opportunity = Optional.empty(); - - private Optional> stage = Optional.empty(); - - private Optional> user = Optional.empty(); - - private Optional> task = Optional.empty(); - - private Optional> engagement = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldApiResponse other) { - account(other.getAccount()); - contact(other.getContact()); - lead(other.getLead()); - note(other.getNote()); - opportunity(other.getOpportunity()); - stage(other.getStage()); - user(other.getUser()); - task(other.getTask()); - engagement(other.getEngagement()); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - @JsonSetter(value = "Lead", nulls = Nulls.SKIP) - public Builder lead(Optional> lead) { - this.lead = lead; - return this; - } - - public Builder lead(List lead) { - this.lead = Optional.ofNullable(lead); - return this; - } - - @JsonSetter(value = "Note", nulls = Nulls.SKIP) - public Builder note(Optional> note) { - this.note = note; - return this; - } - - public Builder note(List note) { - this.note = Optional.ofNullable(note); - return this; - } - - @JsonSetter(value = "Opportunity", nulls = Nulls.SKIP) - public Builder opportunity(Optional> opportunity) { - this.opportunity = opportunity; - return this; - } - - public Builder opportunity(List opportunity) { - this.opportunity = Optional.ofNullable(opportunity); - return this; - } - - @JsonSetter(value = "Stage", nulls = Nulls.SKIP) - public Builder stage(Optional> stage) { - this.stage = stage; - return this; - } - - public Builder stage(List stage) { - this.stage = Optional.ofNullable(stage); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - @JsonSetter(value = "Task", nulls = Nulls.SKIP) - public Builder task(Optional> task) { - this.task = task; - return this; - } - - public Builder task(List task) { - this.task = Optional.ofNullable(task); - return this; - } - - @JsonSetter(value = "Engagement", nulls = Nulls.SKIP) - public Builder engagement(Optional> engagement) { - this.engagement = engagement; - return this; - } - - public Builder engagement(List engagement) { - this.engagement = Optional.ofNullable(engagement); - return this; - } - - public RemoteFieldApiResponse build() { - return new RemoteFieldApiResponse( - account, contact, lead, note, opportunity, stage, user, task, engagement, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClass.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClass.java deleted file mode 100644 index 41cf8c49a..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClass.java +++ /dev/null @@ -1,335 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldClass.Builder.class) -public final class RemoteFieldClass { - private final Optional id; - - private final Optional displayName; - - private final Optional remoteKeyName; - - private final Optional description; - - private final Optional isCustom; - - private final Optional isRequired; - - private final Optional fieldType; - - private final Optional fieldFormat; - - private final Optional> fieldChoices; - - private final Optional itemSchema; - - private final Map additionalProperties; - - private RemoteFieldClass( - Optional id, - Optional displayName, - Optional remoteKeyName, - Optional description, - Optional isCustom, - Optional isRequired, - Optional fieldType, - Optional fieldFormat, - Optional> fieldChoices, - Optional itemSchema, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.remoteKeyName = remoteKeyName; - this.description = description; - this.isCustom = isCustom; - this.isRequired = isRequired; - this.fieldType = fieldType; - this.fieldFormat = fieldFormat; - this.fieldChoices = fieldChoices; - this.itemSchema = itemSchema; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("field_type") - public Optional getFieldType() { - return fieldType; - } - - @JsonProperty("field_format") - public Optional getFieldFormat() { - return fieldFormat; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @JsonProperty("item_schema") - public Optional getItemSchema() { - return itemSchema; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClass && equalTo((RemoteFieldClass) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldClass other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && remoteKeyName.equals(other.remoteKeyName) - && description.equals(other.description) - && isCustom.equals(other.isCustom) - && isRequired.equals(other.isRequired) - && fieldType.equals(other.fieldType) - && fieldFormat.equals(other.fieldFormat) - && fieldChoices.equals(other.fieldChoices) - && itemSchema.equals(other.itemSchema); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.displayName, - this.remoteKeyName, - this.description, - this.isCustom, - this.isRequired, - this.fieldType, - this.fieldFormat, - this.fieldChoices, - this.itemSchema); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional displayName = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional fieldType = Optional.empty(); - - private Optional fieldFormat = Optional.empty(); - - private Optional> fieldChoices = Optional.empty(); - - private Optional itemSchema = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldClass other) { - id(other.getId()); - displayName(other.getDisplayName()); - remoteKeyName(other.getRemoteKeyName()); - description(other.getDescription()); - isCustom(other.getIsCustom()); - isRequired(other.getIsRequired()); - fieldType(other.getFieldType()); - fieldFormat(other.getFieldFormat()); - fieldChoices(other.getFieldChoices()); - itemSchema(other.getItemSchema()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public Builder displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - public Builder displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public Builder remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - public Builder remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public Builder isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - public Builder isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public Builder isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - public Builder isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @JsonSetter(value = "field_type", nulls = Nulls.SKIP) - public Builder fieldType(Optional fieldType) { - this.fieldType = fieldType; - return this; - } - - public Builder fieldType(RemoteFieldClassFieldType fieldType) { - this.fieldType = Optional.ofNullable(fieldType); - return this; - } - - @JsonSetter(value = "field_format", nulls = Nulls.SKIP) - public Builder fieldFormat(Optional fieldFormat) { - this.fieldFormat = fieldFormat; - return this; - } - - public Builder fieldFormat(RemoteFieldClassFieldFormat fieldFormat) { - this.fieldFormat = Optional.ofNullable(fieldFormat); - return this; - } - - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public Builder fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - public Builder fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) - public Builder itemSchema(Optional itemSchema) { - this.itemSchema = itemSchema; - return this; - } - - public Builder itemSchema(ItemSchema itemSchema) { - this.itemSchema = Optional.ofNullable(itemSchema); - return this; - } - - public RemoteFieldClass build() { - return new RemoteFieldClass( - id, - displayName, - remoteKeyName, - description, - isCustom, - isRequired, - fieldType, - fieldFormat, - fieldChoices, - itemSchema, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldChoicesItem.java deleted file mode 100644 index c75af89d4..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldChoicesItem.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldClassFieldChoicesItem.Builder.class) -public final class RemoteFieldClassFieldChoicesItem { - private final Optional value; - - private final Optional displayName; - - private final Map additionalProperties; - - private RemoteFieldClassFieldChoicesItem( - Optional value, Optional displayName, Map additionalProperties) { - this.value = value; - this.displayName = displayName; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("value") - public Optional getValue() { - return value; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassFieldChoicesItem && equalTo((RemoteFieldClassFieldChoicesItem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldClassFieldChoicesItem other) { - return value.equals(other.value) && displayName.equals(other.displayName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value, this.displayName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional value = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldClassFieldChoicesItem other) { - value(other.getValue()); - displayName(other.getDisplayName()); - return this; - } - - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public Builder value(Optional value) { - this.value = value; - return this; - } - - public Builder value(JsonNode value) { - this.value = Optional.ofNullable(value); - return this; - } - - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public Builder displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - public Builder displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - public RemoteFieldClassFieldChoicesItem build() { - return new RemoteFieldClassFieldChoicesItem(value, displayName, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldFormat.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldFormat.java deleted file mode 100644 index 839923ee2..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldFormat.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldClassFieldFormat.Deserializer.class) -public final class RemoteFieldClassFieldFormat { - private final Object value; - - private final int type; - - private RemoteFieldClassFieldFormat(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((FieldFormatEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassFieldFormat && equalTo((RemoteFieldClassFieldFormat) other); - } - - private boolean equalTo(RemoteFieldClassFieldFormat other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldClassFieldFormat of(FieldFormatEnum value) { - return new RemoteFieldClassFieldFormat(value, 0); - } - - public static RemoteFieldClassFieldFormat of(String value) { - return new RemoteFieldClassFieldFormat(value, 1); - } - - public interface Visitor { - T visit(FieldFormatEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldClassFieldFormat.class); - } - - @java.lang.Override - public RemoteFieldClassFieldFormat deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FieldFormatEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldType.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldType.java deleted file mode 100644 index c586ca306..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassFieldType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldClassFieldType.Deserializer.class) -public final class RemoteFieldClassFieldType { - private final Object value; - - private final int type; - - private RemoteFieldClassFieldType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((FieldTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassFieldType && equalTo((RemoteFieldClassFieldType) other); - } - - private boolean equalTo(RemoteFieldClassFieldType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldClassFieldType of(FieldTypeEnum value) { - return new RemoteFieldClassFieldType(value, 0); - } - - public static RemoteFieldClassFieldType of(String value) { - return new RemoteFieldClassFieldType(value, 1); - } - - public interface Visitor { - T visit(FieldTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldClassFieldType.class); - } - - @java.lang.Override - public RemoteFieldClassFieldType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FieldTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldFormat.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldFormat.java deleted file mode 100644 index e1f456a83..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldFormat.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldClassForCustomObjectClassFieldFormat.Deserializer.class) -public final class RemoteFieldClassForCustomObjectClassFieldFormat { - private final Object value; - - private final int type; - - private RemoteFieldClassForCustomObjectClassFieldFormat(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((FieldFormatEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassForCustomObjectClassFieldFormat - && equalTo((RemoteFieldClassForCustomObjectClassFieldFormat) other); - } - - private boolean equalTo(RemoteFieldClassForCustomObjectClassFieldFormat other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldClassForCustomObjectClassFieldFormat of(FieldFormatEnum value) { - return new RemoteFieldClassForCustomObjectClassFieldFormat(value, 0); - } - - public static RemoteFieldClassForCustomObjectClassFieldFormat of(String value) { - return new RemoteFieldClassForCustomObjectClassFieldFormat(value, 1); - } - - public interface Visitor { - T visit(FieldFormatEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldClassForCustomObjectClassFieldFormat.class); - } - - @java.lang.Override - public RemoteFieldClassForCustomObjectClassFieldFormat deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FieldFormatEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldType.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldType.java deleted file mode 100644 index e1ec8e80b..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldClassForCustomObjectClassFieldType.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldClassForCustomObjectClassFieldType.Deserializer.class) -public final class RemoteFieldClassForCustomObjectClassFieldType { - private final Object value; - - private final int type; - - private RemoteFieldClassForCustomObjectClassFieldType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((FieldTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassForCustomObjectClassFieldType - && equalTo((RemoteFieldClassForCustomObjectClassFieldType) other); - } - - private boolean equalTo(RemoteFieldClassForCustomObjectClassFieldType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldClassForCustomObjectClassFieldType of(FieldTypeEnum value) { - return new RemoteFieldClassForCustomObjectClassFieldType(value, 0); - } - - public static RemoteFieldClassForCustomObjectClassFieldType of(String value) { - return new RemoteFieldClassForCustomObjectClassFieldType(value, 1); - } - - public interface Visitor { - T visit(FieldTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldClassForCustomObjectClassFieldType.class); - } - - @java.lang.Override - public RemoteFieldClassForCustomObjectClassFieldType deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FieldTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRemoteFieldClass.java deleted file mode 100644 index a838b4702..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRemoteFieldClass.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldRemoteFieldClass.Deserializer.class) -public final class RemoteFieldRemoteFieldClass { - private final Object value; - - private final int type; - - private RemoteFieldRemoteFieldClass(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((RemoteFieldClass) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRemoteFieldClass && equalTo((RemoteFieldRemoteFieldClass) other); - } - - private boolean equalTo(RemoteFieldRemoteFieldClass other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldRemoteFieldClass of(String value) { - return new RemoteFieldRemoteFieldClass(value, 0); - } - - public static RemoteFieldRemoteFieldClass of(RemoteFieldClass value) { - return new RemoteFieldRemoteFieldClass(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(RemoteFieldClass value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldRemoteFieldClass.class); - } - - @java.lang.Override - public RemoteFieldRemoteFieldClass deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRequest.java deleted file mode 100644 index 50479cb77..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRequest.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldRequest.Builder.class) -public final class RemoteFieldRequest { - private final RemoteFieldRequestRemoteFieldClass remoteFieldClass; - - private final Optional value; - - private final Map additionalProperties; - - private RemoteFieldRequest( - RemoteFieldRequestRemoteFieldClass remoteFieldClass, - Optional value, - Map additionalProperties) { - this.remoteFieldClass = remoteFieldClass; - this.value = value; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_field_class") - public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { - return remoteFieldClass; - } - - @JsonProperty("value") - public Optional getValue() { - return value; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRequest && equalTo((RemoteFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldRequest other) { - return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldClass, this.value); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteFieldClassStage builder() { - return new Builder(); - } - - public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass); - - Builder from(RemoteFieldRequest other); - } - - public interface _FinalStage { - RemoteFieldRequest build(); - - _FinalStage value(Optional value); - - _FinalStage value(JsonNode value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldRequestRemoteFieldClass remoteFieldClass; - - private Optional value = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldRequest other) { - remoteFieldClass(other.getRemoteFieldClass()); - value(other.getValue()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { - this.remoteFieldClass = remoteFieldClass; - return this; - } - - @java.lang.Override - public _FinalStage value(JsonNode value) { - this.value = Optional.ofNullable(value); - return this; - } - - @java.lang.Override - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public _FinalStage value(Optional value) { - this.value = value; - return this; - } - - @java.lang.Override - public RemoteFieldRequest build() { - return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRequestRemoteFieldClass.java deleted file mode 100644 index 4d4dcad73..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteFieldRequestRemoteFieldClass.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldRequestRemoteFieldClass.Deserializer.class) -public final class RemoteFieldRequestRemoteFieldClass { - private final Object value; - - private final int type; - - private RemoteFieldRequestRemoteFieldClass(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((RemoteFieldClass) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRequestRemoteFieldClass - && equalTo((RemoteFieldRequestRemoteFieldClass) other); - } - - private boolean equalTo(RemoteFieldRequestRemoteFieldClass other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldRequestRemoteFieldClass of(String value) { - return new RemoteFieldRequestRemoteFieldClass(value, 0); - } - - public static RemoteFieldRequestRemoteFieldClass of(RemoteFieldClass value) { - return new RemoteFieldRequestRemoteFieldClass(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(RemoteFieldClass value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldRequestRemoteFieldClass.class); - } - - @java.lang.Override - public RemoteFieldRequestRemoteFieldClass deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteKey.java b/src/main/java/com/merge/api/resources/crm/types/RemoteKey.java deleted file mode 100644 index 7b86bc718..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteKey.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKey.Builder.class) -public final class RemoteKey { - private final String name; - - private final String key; - - private final Map additionalProperties; - - private RemoteKey(String name, String key, Map additionalProperties) { - this.name = name; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("key") - public String getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKey && equalTo((RemoteKey) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKey other) { - return name.equals(other.name) && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - KeyStage name(@NotNull String name); - - Builder from(RemoteKey other); - } - - public interface KeyStage { - _FinalStage key(@NotNull String key); - } - - public interface _FinalStage { - RemoteKey build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, KeyStage, _FinalStage { - private String name; - - private String key; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKey other) { - name(other.getName()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public KeyStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("key") - public _FinalStage key(@NotNull String key) { - this.key = key; - return this; - } - - @java.lang.Override - public RemoteKey build() { - return new RemoteKey(name, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RemoteResponse.java b/src/main/java/com/merge/api/resources/crm/types/RemoteResponse.java deleted file mode 100644 index 91c7894d9..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RemoteResponse.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteResponse.Builder.class) -public final class RemoteResponse { - private final String method; - - private final String path; - - private final int status; - - private final JsonNode response; - - private final Optional> responseHeaders; - - private final Optional responseType; - - private final Optional> headers; - - private final Map additionalProperties; - - private RemoteResponse( - String method, - String path, - int status, - JsonNode response, - Optional> responseHeaders, - Optional responseType, - Optional> headers, - Map additionalProperties) { - this.method = method; - this.path = path; - this.status = status; - this.response = response; - this.responseHeaders = responseHeaders; - this.responseType = responseType; - this.headers = headers; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("status") - public int getStatus() { - return status; - } - - @JsonProperty("response") - public JsonNode getResponse() { - return response; - } - - @JsonProperty("response_headers") - public Optional> getResponseHeaders() { - return responseHeaders; - } - - @JsonProperty("response_type") - public Optional getResponseType() { - return responseType; - } - - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponse && equalTo((RemoteResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteResponse other) { - return method.equals(other.method) - && path.equals(other.path) - && status == other.status - && response.equals(other.response) - && responseHeaders.equals(other.responseHeaders) - && responseType.equals(other.responseType) - && headers.equals(other.headers); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.status, - this.response, - this.responseHeaders, - this.responseType, - this.headers); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull String method); - - Builder from(RemoteResponse other); - } - - public interface PathStage { - StatusStage path(@NotNull String path); - } - - public interface StatusStage { - ResponseStage status(int status); - } - - public interface ResponseStage { - _FinalStage response(@NotNull JsonNode response); - } - - public interface _FinalStage { - RemoteResponse build(); - - _FinalStage responseHeaders(Optional> responseHeaders); - - _FinalStage responseHeaders(Map responseHeaders); - - _FinalStage responseType(Optional responseType); - - _FinalStage responseType(ResponseTypeEnum responseType); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { - private String method; - - private String path; - - private int status; - - private JsonNode response; - - private Optional> headers = Optional.empty(); - - private Optional responseType = Optional.empty(); - - private Optional> responseHeaders = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteResponse other) { - method(other.getMethod()); - path(other.getPath()); - status(other.getStatus()); - response(other.getResponse()); - responseHeaders(other.getResponseHeaders()); - responseType(other.getResponseType()); - headers(other.getHeaders()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("path") - public StatusStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public ResponseStage status(int status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("response") - public _FinalStage response(@NotNull JsonNode response) { - this.response = response; - return this; - } - - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - @java.lang.Override - public _FinalStage responseType(ResponseTypeEnum responseType) { - this.responseType = Optional.ofNullable(responseType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_type", nulls = Nulls.SKIP) - public _FinalStage responseType(Optional responseType) { - this.responseType = responseType; - return this; - } - - @java.lang.Override - public _FinalStage responseHeaders(Map responseHeaders) { - this.responseHeaders = Optional.ofNullable(responseHeaders); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) - public _FinalStage responseHeaders(Optional> responseHeaders) { - this.responseHeaders = responseHeaders; - return this; - } - - @java.lang.Override - public RemoteResponse build() { - return new RemoteResponse( - method, path, status, response, responseHeaders, responseType, headers, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RequestFormatEnum.java b/src/main/java/com/merge/api/resources/crm/types/RequestFormatEnum.java deleted file mode 100644 index a3dbd18d5..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RequestFormatEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RequestFormatEnum { - JSON("JSON"), - - XML("XML"), - - MULTIPART("MULTIPART"); - - private final String value; - - RequestFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/resources/crm/types/ResponseTypeEnum.java deleted file mode 100644 index df922716d..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ResponseTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ResponseTypeEnum { - JSON("JSON"), - - BASE_64_GZIP("BASE64_GZIP"); - - private final String value; - - ResponseTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/RoleEnum.java b/src/main/java/com/merge/api/resources/crm/types/RoleEnum.java deleted file mode 100644 index 0c314a9ef..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/RoleEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RoleEnum { - ADMIN("ADMIN"), - - DEVELOPER("DEVELOPER"), - - MEMBER("MEMBER"), - - API("API"), - - SYSTEM("SYSTEM"), - - MERGE_TEAM("MERGE_TEAM"); - - private final String value; - - RoleEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/resources/crm/types/SelectiveSyncConfigurationsUsageEnum.java deleted file mode 100644 index fdc02427f..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/SelectiveSyncConfigurationsUsageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SelectiveSyncConfigurationsUsageEnum { - IN_NEXT_SYNC("IN_NEXT_SYNC"), - - IN_LAST_SYNC("IN_LAST_SYNC"); - - private final String value; - - SelectiveSyncConfigurationsUsageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/SyncStatus.java b/src/main/java/com/merge/api/resources/crm/types/SyncStatus.java deleted file mode 100644 index 022bc4d71..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/SyncStatus.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatus.Builder.class) -public final class SyncStatus { - private final String modelName; - - private final String modelId; - - private final Optional lastSyncStart; - - private final Optional nextSyncStart; - - private final SyncStatusStatusEnum status; - - private final boolean isInitialSync; - - private final Optional selectiveSyncConfigurationsUsage; - - private final Map additionalProperties; - - private SyncStatus( - String modelName, - String modelId, - Optional lastSyncStart, - Optional nextSyncStart, - SyncStatusStatusEnum status, - boolean isInitialSync, - Optional selectiveSyncConfigurationsUsage, - Map additionalProperties) { - this.modelName = modelName; - this.modelId = modelId; - this.lastSyncStart = lastSyncStart; - this.nextSyncStart = nextSyncStart; - this.status = status; - this.isInitialSync = isInitialSync; - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("last_sync_start") - public Optional getLastSyncStart() { - return lastSyncStart; - } - - @JsonProperty("next_sync_start") - public Optional getNextSyncStart() { - return nextSyncStart; - } - - @JsonProperty("status") - public SyncStatusStatusEnum getStatus() { - return status; - } - - @JsonProperty("is_initial_sync") - public boolean getIsInitialSync() { - return isInitialSync; - } - - @JsonProperty("selective_sync_configurations_usage") - public Optional getSelectiveSyncConfigurationsUsage() { - return selectiveSyncConfigurationsUsage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatus && equalTo((SyncStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatus other) { - return modelName.equals(other.modelName) - && modelId.equals(other.modelId) - && lastSyncStart.equals(other.lastSyncStart) - && nextSyncStart.equals(other.nextSyncStart) - && status.equals(other.status) - && isInitialSync == other.isInitialSync - && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, - this.modelId, - this.lastSyncStart, - this.nextSyncStart, - this.status, - this.isInitialSync, - this.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - ModelIdStage modelName(@NotNull String modelName); - - Builder from(SyncStatus other); - } - - public interface ModelIdStage { - StatusStage modelId(@NotNull String modelId); - } - - public interface StatusStage { - IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status); - } - - public interface IsInitialSyncStage { - _FinalStage isInitialSync(boolean isInitialSync); - } - - public interface _FinalStage { - SyncStatus build(); - - _FinalStage lastSyncStart(Optional lastSyncStart); - - _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); - - _FinalStage nextSyncStart(Optional nextSyncStart); - - _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); - - _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage); - - _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { - private String modelName; - - private String modelId; - - private SyncStatusStatusEnum status; - - private boolean isInitialSync; - - private Optional selectiveSyncConfigurationsUsage = Optional.empty(); - - private Optional nextSyncStart = Optional.empty(); - - private Optional lastSyncStart = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(SyncStatus other) { - modelName(other.getModelName()); - modelId(other.getModelId()); - lastSyncStart(other.getLastSyncStart()); - nextSyncStart(other.getNextSyncStart()); - status(other.getStatus()); - isInitialSync(other.getIsInitialSync()); - selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public ModelIdStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public StatusStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("is_initial_sync") - public _FinalStage isInitialSync(boolean isInitialSync) { - this.isInitialSync = isInitialSync; - return this; - } - - @java.lang.Override - public _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) - public _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - return this; - } - - @java.lang.Override - public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { - this.nextSyncStart = Optional.ofNullable(nextSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) - public _FinalStage nextSyncStart(Optional nextSyncStart) { - this.nextSyncStart = nextSyncStart; - return this; - } - - @java.lang.Override - public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { - this.lastSyncStart = Optional.ofNullable(lastSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) - public _FinalStage lastSyncStart(Optional lastSyncStart) { - this.lastSyncStart = lastSyncStart; - return this; - } - - @java.lang.Override - public SyncStatus build() { - return new SyncStatus( - modelName, - modelId, - lastSyncStart, - nextSyncStart, - status, - isInitialSync, - selectiveSyncConfigurationsUsage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/api/resources/crm/types/SyncStatusStatusEnum.java deleted file mode 100644 index dbcfe228e..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/SyncStatusStatusEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SyncStatusStatusEnum { - SYNCING("SYNCING"), - - DONE("DONE"), - - FAILED("FAILED"), - - DISABLED("DISABLED"), - - PAUSED("PAUSED"), - - PARTIALLY_SYNCED("PARTIALLY_SYNCED"); - - private final String value; - - SyncStatusStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskRequestStatus.java b/src/main/java/com/merge/api/resources/crm/types/TaskRequestStatus.java deleted file mode 100644 index b3d79ad60..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/TaskRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TaskRequestStatus.Deserializer.class) -public final class TaskRequestStatus { - private final Object value; - - private final int type; - - private TaskRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TaskStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TaskRequestStatus && equalTo((TaskRequestStatus) other); - } - - private boolean equalTo(TaskRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TaskRequestStatus of(TaskStatusEnum value) { - return new TaskRequestStatus(value, 0); - } - - public static TaskRequestStatus of(String value) { - return new TaskRequestStatus(value, 1); - } - - public interface Visitor { - T visit(TaskStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TaskRequestStatus.class); - } - - @java.lang.Override - public TaskRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaskStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/TaskStatus.java b/src/main/java/com/merge/api/resources/crm/types/TaskStatus.java deleted file mode 100644 index 3de681121..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/TaskStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TaskStatus.Deserializer.class) -public final class TaskStatus { - private final Object value; - - private final int type; - - private TaskStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TaskStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TaskStatus && equalTo((TaskStatus) other); - } - - private boolean equalTo(TaskStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TaskStatus of(TaskStatusEnum value) { - return new TaskStatus(value, 0); - } - - public static TaskStatus of(String value) { - return new TaskStatus(value, 1); - } - - public interface Visitor { - T visit(TaskStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TaskStatus.class); - } - - @java.lang.Override - public TaskStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaskStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/User.java b/src/main/java/com/merge/api/resources/crm/types/User.java deleted file mode 100644 index c67bb3b3a..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/User.java +++ /dev/null @@ -1,384 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = User.Builder.class) -public final class User { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional email; - - private final Optional isActive; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Optional> remoteFields; - - private final Map additionalProperties; - - private User( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional email, - Optional isActive, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Optional> remoteFields, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.email = email; - this.isActive = isActive; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.remoteFields = remoteFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The user's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The user's email address. - */ - @JsonProperty("email") - public Optional getEmail() { - return email; - } - - /** - * @return Whether or not the user is active. - */ - @JsonProperty("is_active") - public Optional getIsActive() { - return isActive; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @JsonProperty("remote_fields") - public Optional> getRemoteFields() { - return remoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof User && equalTo((User) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(User other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && email.equals(other.email) - && isActive.equals(other.isActive) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData) - && remoteFields.equals(other.remoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.email, - this.isActive, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData, - this.remoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional email = Optional.empty(); - - private Optional isActive = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - private Optional> remoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(User other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - email(other.getEmail()); - isActive(other.getIsActive()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - remoteFields(other.getRemoteFields()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "email", nulls = Nulls.SKIP) - public Builder email(Optional email) { - this.email = email; - return this; - } - - public Builder email(String email) { - this.email = Optional.ofNullable(email); - return this; - } - - @JsonSetter(value = "is_active", nulls = Nulls.SKIP) - public Builder isActive(Optional isActive) { - this.isActive = isActive; - return this; - } - - public Builder isActive(Boolean isActive) { - this.isActive = Optional.ofNullable(isActive); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional> remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(List remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - public User build() { - return new User( - id, - remoteId, - createdAt, - modifiedAt, - name, - email, - isActive, - remoteWasDeleted, - fieldMappings, - remoteData, - remoteFields, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/ValidationProblemSource.java b/src/main/java/com/merge/api/resources/crm/types/ValidationProblemSource.java deleted file mode 100644 index a600fa73b..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/ValidationProblemSource.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ValidationProblemSource.Builder.class) -public final class ValidationProblemSource { - private final String pointer; - - private final Map additionalProperties; - - private ValidationProblemSource(String pointer, Map additionalProperties) { - this.pointer = pointer; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("pointer") - public String getPointer() { - return pointer; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidationProblemSource other) { - return pointer.equals(other.pointer); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.pointer); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PointerStage builder() { - return new Builder(); - } - - public interface PointerStage { - _FinalStage pointer(@NotNull String pointer); - - Builder from(ValidationProblemSource other); - } - - public interface _FinalStage { - ValidationProblemSource build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PointerStage, _FinalStage { - private String pointer; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ValidationProblemSource other) { - pointer(other.getPointer()); - return this; - } - - @java.lang.Override - @JsonSetter("pointer") - public _FinalStage pointer(@NotNull String pointer) { - this.pointer = pointer; - return this; - } - - @java.lang.Override - public ValidationProblemSource build() { - return new ValidationProblemSource(pointer, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/WarningValidationProblem.java b/src/main/java/com/merge/api/resources/crm/types/WarningValidationProblem.java deleted file mode 100644 index 8865e6098..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/WarningValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WarningValidationProblem.Builder.class) -public final class WarningValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private WarningValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WarningValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(WarningValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - WarningValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WarningValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public WarningValidationProblem build() { - return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/types/WebhookReceiver.java b/src/main/java/com/merge/api/resources/crm/types/WebhookReceiver.java deleted file mode 100644 index 2dbcdcf50..000000000 --- a/src/main/java/com/merge/api/resources/crm/types/WebhookReceiver.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiver.Builder.class) -public final class WebhookReceiver { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiver( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiver other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiver other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiver build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiver other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiver build() { - return new WebhookReceiver(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/users/UsersClient.java b/src/main/java/com/merge/api/resources/crm/users/UsersClient.java deleted file mode 100644 index 8865bb4fd..000000000 --- a/src/main/java/com/merge/api/resources/crm/users/UsersClient.java +++ /dev/null @@ -1,311 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.users; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.types.IgnoreCommonModelRequest; -import com.merge.api.resources.crm.types.PaginatedRemoteFieldClassList; -import com.merge.api.resources.crm.types.PaginatedUserList; -import com.merge.api.resources.crm.types.User; -import com.merge.api.resources.crm.users.requests.UsersListRequest; -import com.merge.api.resources.crm.users.requests.UsersRemoteFieldClassesListRequest; -import com.merge.api.resources.crm.users.requests.UsersRetrieveRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class UsersClient { - protected final ClientOptions clientOptions; - - public UsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list() { - return list(UsersListRequest.builder().build()); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list(UsersListRequest request) { - return list(request, null); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list(UsersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/users"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmail().isPresent()) { - httpUrl.addQueryParameter("email", request.getEmail().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedUserList.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); - } - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id) { - return retrieve(id, UsersRetrieveRequest.builder().build()); - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id, UsersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/users") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), User.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); - } - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { - ignoreCreate(modelId, request, null); - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/users/ignore") - .addPathSegment(modelId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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; - } - 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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - UsersRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(UsersRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - UsersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/users/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/users/requests/UsersListRequest.java b/src/main/java/com/merge/api/resources/crm/users/requests/UsersListRequest.java deleted file mode 100644 index e3a22b60b..000000000 --- a/src/main/java/com/merge/api/resources/crm/users/requests/UsersListRequest.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersListRequest.Builder.class) -public final class UsersListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional email; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private UsersListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional email, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeRemoteFields, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.email = email; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return users with this email. - */ - @JsonProperty("email") - public Optional getEmail() { - return email; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersListRequest && equalTo((UsersListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && email.equals(other.email) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.email, - this.includeDeletedData, - this.includeRemoteData, - this.includeRemoteFields, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional email = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - email(other.getEmail()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "email", nulls = Nulls.SKIP) - public Builder email(Optional email) { - this.email = email; - return this; - } - - public Builder email(String email) { - this.email = Optional.ofNullable(email); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public UsersListRequest build() { - return new UsersListRequest( - createdAfter, - createdBefore, - cursor, - email, - includeDeletedData, - includeRemoteData, - includeRemoteFields, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/api/resources/crm/users/requests/UsersRetrieveRequest.java deleted file mode 100644 index 41c2f2f97..000000000 --- a/src/main/java/com/merge/api/resources/crm/users/requests/UsersRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) -public final class UsersRetrieveRequest { - private final Optional includeRemoteData; - - private final Optional includeRemoteFields; - - private final Map additionalProperties; - - private UsersRetrieveRequest( - Optional includeRemoteData, - Optional includeRemoteFields, - Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.includeRemoteFields = includeRemoteFields; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - */ - @JsonProperty("include_remote_fields") - public Optional getIncludeRemoteFields() { - return includeRemoteFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData) - && includeRemoteFields.equals(other.includeRemoteFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData, this.includeRemoteFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - private Optional includeRemoteFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - includeRemoteFields(other.getIncludeRemoteFields()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) - public Builder includeRemoteFields(Optional includeRemoteFields) { - this.includeRemoteFields = includeRemoteFields; - return this; - } - - public Builder includeRemoteFields(Boolean includeRemoteFields) { - this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); - return this; - } - - public UsersRetrieveRequest build() { - return new UsersRetrieveRequest(includeRemoteData, includeRemoteFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/api/resources/crm/webhookreceivers/WebhookReceiversClient.java deleted file mode 100644 index 00f82834d..000000000 --- a/src/main/java/com/merge/api/resources/crm/webhookreceivers/WebhookReceiversClient.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.webhookreceivers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.crm.types.WebhookReceiver; -import com.merge.api.resources.crm.webhookreceivers.requests.WebhookReceiverRequest; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class WebhookReceiversClient { - protected final ClientOptions clientOptions; - - public WebhookReceiversClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list() { - return list(null); - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/webhook-receivers") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request) { - return create(request, null); - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("crm/v1/webhook-receivers") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), WebhookReceiver.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/crm/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/api/resources/crm/webhookreceivers/requests/WebhookReceiverRequest.java deleted file mode 100644 index 19dab68e4..000000000 --- a/src/main/java/com/merge/api/resources/crm/webhookreceivers/requests/WebhookReceiverRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.crm.webhookreceivers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) -public final class WebhookReceiverRequest { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiverRequest( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiverRequest other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiverRequest other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiverRequest build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiverRequest other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiverRequest build() { - return new WebhookReceiverRequest(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/FilestorageClient.java b/src/main/java/com/merge/api/resources/filestorage/FilestorageClient.java deleted file mode 100644 index dab6b895b..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/FilestorageClient.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage; - -import com.merge.api.core.ClientOptions; -import com.merge.api.core.Suppliers; -import com.merge.api.resources.filestorage.accountdetails.AccountDetailsClient; -import com.merge.api.resources.filestorage.accounttoken.AccountTokenClient; -import com.merge.api.resources.filestorage.asyncpassthrough.AsyncPassthroughClient; -import com.merge.api.resources.filestorage.audittrail.AuditTrailClient; -import com.merge.api.resources.filestorage.availableactions.AvailableActionsClient; -import com.merge.api.resources.filestorage.deleteaccount.DeleteAccountClient; -import com.merge.api.resources.filestorage.drives.DrivesClient; -import com.merge.api.resources.filestorage.fieldmapping.FieldMappingClient; -import com.merge.api.resources.filestorage.files.FilesClient; -import com.merge.api.resources.filestorage.folders.FoldersClient; -import com.merge.api.resources.filestorage.forceresync.ForceResyncClient; -import com.merge.api.resources.filestorage.generatekey.GenerateKeyClient; -import com.merge.api.resources.filestorage.groups.GroupsClient; -import com.merge.api.resources.filestorage.issues.IssuesClient; -import com.merge.api.resources.filestorage.linkedaccounts.LinkedAccountsClient; -import com.merge.api.resources.filestorage.linktoken.LinkTokenClient; -import com.merge.api.resources.filestorage.passthrough.PassthroughClient; -import com.merge.api.resources.filestorage.regeneratekey.RegenerateKeyClient; -import com.merge.api.resources.filestorage.scopes.ScopesClient; -import com.merge.api.resources.filestorage.syncstatus.SyncStatusClient; -import com.merge.api.resources.filestorage.users.UsersClient; -import com.merge.api.resources.filestorage.webhookreceivers.WebhookReceiversClient; -import java.util.function.Supplier; - -public class FilestorageClient { - protected final ClientOptions clientOptions; - - protected final Supplier accountDetailsClient; - - protected final Supplier accountTokenClient; - - protected final Supplier asyncPassthroughClient; - - protected final Supplier auditTrailClient; - - protected final Supplier availableActionsClient; - - protected final Supplier scopesClient; - - protected final Supplier deleteAccountClient; - - protected final Supplier drivesClient; - - protected final Supplier fieldMappingClient; - - protected final Supplier filesClient; - - protected final Supplier foldersClient; - - protected final Supplier generateKeyClient; - - protected final Supplier groupsClient; - - protected final Supplier issuesClient; - - protected final Supplier linkTokenClient; - - protected final Supplier linkedAccountsClient; - - protected final Supplier passthroughClient; - - protected final Supplier regenerateKeyClient; - - protected final Supplier syncStatusClient; - - protected final Supplier forceResyncClient; - - protected final Supplier usersClient; - - protected final Supplier webhookReceiversClient; - - public FilestorageClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); - this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); - this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); - this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); - this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); - this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); - this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); - this.drivesClient = Suppliers.memoize(() -> new DrivesClient(clientOptions)); - this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); - this.filesClient = Suppliers.memoize(() -> new FilesClient(clientOptions)); - this.foldersClient = Suppliers.memoize(() -> new FoldersClient(clientOptions)); - this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions)); - this.groupsClient = Suppliers.memoize(() -> new GroupsClient(clientOptions)); - this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); - this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); - this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); - this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); - this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); - this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); - this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); - this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); - this.webhookReceiversClient = Suppliers.memoize(() -> new WebhookReceiversClient(clientOptions)); - } - - public AccountDetailsClient accountDetails() { - return this.accountDetailsClient.get(); - } - - public AccountTokenClient accountToken() { - return this.accountTokenClient.get(); - } - - public AsyncPassthroughClient asyncPassthrough() { - return this.asyncPassthroughClient.get(); - } - - public AuditTrailClient auditTrail() { - return this.auditTrailClient.get(); - } - - public AvailableActionsClient availableActions() { - return this.availableActionsClient.get(); - } - - public ScopesClient scopes() { - return this.scopesClient.get(); - } - - public DeleteAccountClient deleteAccount() { - return this.deleteAccountClient.get(); - } - - public DrivesClient drives() { - return this.drivesClient.get(); - } - - public FieldMappingClient fieldMapping() { - return this.fieldMappingClient.get(); - } - - public FilesClient files() { - return this.filesClient.get(); - } - - public FoldersClient folders() { - return this.foldersClient.get(); - } - - public GenerateKeyClient generateKey() { - return this.generateKeyClient.get(); - } - - public GroupsClient groups() { - return this.groupsClient.get(); - } - - public IssuesClient issues() { - return this.issuesClient.get(); - } - - public LinkTokenClient linkToken() { - return this.linkTokenClient.get(); - } - - public LinkedAccountsClient linkedAccounts() { - return this.linkedAccountsClient.get(); - } - - public PassthroughClient passthrough() { - return this.passthroughClient.get(); - } - - public RegenerateKeyClient regenerateKey() { - return this.regenerateKeyClient.get(); - } - - public SyncStatusClient syncStatus() { - return this.syncStatusClient.get(); - } - - public ForceResyncClient forceResync() { - return this.forceResyncClient.get(); - } - - public UsersClient users() { - return this.usersClient.get(); - } - - public WebhookReceiversClient webhookReceivers() { - return this.webhookReceiversClient.get(); - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/api/resources/filestorage/accountdetails/AccountDetailsClient.java deleted file mode 100644 index 84b0f6054..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/accountdetails/AccountDetailsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.accountdetails; - -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.filestorage.types.AccountDetails; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountDetailsClient { - protected final ClientOptions clientOptions; - - public AccountDetailsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve() { - return retrieve(null); - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/account-details") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountDetails.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/api/resources/filestorage/accounttoken/AccountTokenClient.java deleted file mode 100644 index b9296cd78..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/accounttoken/AccountTokenClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.accounttoken; - -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.filestorage.types.AccountToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountTokenClient { - protected final ClientOptions clientOptions; - - public AccountTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken) { - return retrieve(publicToken, null); - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/account-token") - .addPathSegment(publicToken) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/api/resources/filestorage/asyncpassthrough/AsyncPassthroughClient.java deleted file mode 100644 index a2f98a5b6..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/asyncpassthrough/AsyncPassthroughClient.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.asyncpassthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; -import com.merge.api.resources.filestorage.types.AsyncPassthroughReciept; -import com.merge.api.resources.filestorage.types.DataPassthroughRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AsyncPassthroughClient { - protected final ClientOptions clientOptions; - - public AsyncPassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/async-passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), AsyncPassthroughReciept.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); - } - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/async-passthrough") - .addPathSegment(asyncPassthroughReceiptId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AsyncPassthroughRetrieveResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/resources/filestorage/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java deleted file mode 100644 index 3bd9b0a11..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.asyncpassthrough.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.types.RemoteResponse; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) -public final class AsyncPassthroughRetrieveResponse { - private final Object value; - - private final int type; - - private AsyncPassthroughRetrieveResponse(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RemoteResponse) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); - } - - private boolean equalTo(AsyncPassthroughRetrieveResponse other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { - return new AsyncPassthroughRetrieveResponse(value, 0); - } - - public static AsyncPassthroughRetrieveResponse of(String value) { - return new AsyncPassthroughRetrieveResponse(value, 1); - } - - public interface Visitor { - T visit(RemoteResponse value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AsyncPassthroughRetrieveResponse.class); - } - - @java.lang.Override - public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/audittrail/AuditTrailClient.java b/src/main/java/com/merge/api/resources/filestorage/audittrail/AuditTrailClient.java deleted file mode 100644 index 77b43d27d..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/audittrail/AuditTrailClient.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.audittrail; - -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.filestorage.audittrail.requests.AuditTrailListRequest; -import com.merge.api.resources.filestorage.types.PaginatedAuditLogEventList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AuditTrailClient { - protected final ClientOptions clientOptions; - - public AuditTrailClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list() { - return list(AuditTrailListRequest.builder().build()); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request) { - return list(request, null); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/audit-trail"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEventType().isPresent()) { - httpUrl.addQueryParameter("event_type", request.getEventType().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getUserEmail().isPresent()) { - httpUrl.addQueryParameter("user_email", request.getUserEmail().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAuditLogEventList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/api/resources/filestorage/audittrail/requests/AuditTrailListRequest.java deleted file mode 100644 index 66dd4574b..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/audittrail/requests/AuditTrailListRequest.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.audittrail.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) -public final class AuditTrailListRequest { - private final Optional cursor; - - private final Optional endDate; - - private final Optional eventType; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional userEmail; - - private final Map additionalProperties; - - private AuditTrailListRequest( - Optional cursor, - Optional endDate, - Optional eventType, - Optional pageSize, - Optional startDate, - Optional userEmail, - Map additionalProperties) { - this.cursor = cursor; - this.endDate = endDate; - this.eventType = eventType; - this.pageSize = pageSize; - this.startDate = startDate; - this.userEmail = userEmail; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include audit trail events that occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - /** - * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED - */ - @JsonProperty("event_type") - public Optional getEventType() { - return eventType; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include audit trail events that occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditTrailListRequest other) { - return cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && eventType.equals(other.eventType) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && userEmail.equals(other.userEmail); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional eventType = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AuditTrailListRequest other) { - cursor(other.getCursor()); - endDate(other.getEndDate()); - eventType(other.getEventType()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - userEmail(other.getUserEmail()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "event_type", nulls = Nulls.SKIP) - public Builder eventType(Optional eventType) { - this.eventType = eventType; - return this; - } - - public Builder eventType(String eventType) { - this.eventType = Optional.ofNullable(eventType); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public Builder userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - public Builder userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - public AuditTrailListRequest build() { - return new AuditTrailListRequest( - cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/api/resources/filestorage/availableactions/AvailableActionsClient.java deleted file mode 100644 index 3a77382a4..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/availableactions/AvailableActionsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.availableactions; - -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.filestorage.types.AvailableActions; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AvailableActionsClient { - protected final ClientOptions clientOptions; - - public AvailableActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve() { - return retrieve(null); - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/available-actions") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AvailableActions.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/api/resources/filestorage/deleteaccount/DeleteAccountClient.java deleted file mode 100644 index 782532c0b..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/deleteaccount/DeleteAccountClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.deleteaccount; - -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 java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DeleteAccountClient { - protected final ClientOptions clientOptions; - - public DeleteAccountClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Delete a linked account. - */ - public void delete() { - delete(null); - } - - /** - * Delete a linked account. - */ - public void delete(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/delete-account") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .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; - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/drives/DrivesClient.java b/src/main/java/com/merge/api/resources/filestorage/drives/DrivesClient.java deleted file mode 100644 index ca0e123f3..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/drives/DrivesClient.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.drives; - -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.filestorage.drives.requests.DrivesListRequest; -import com.merge.api.resources.filestorage.drives.requests.DrivesRetrieveRequest; -import com.merge.api.resources.filestorage.types.Drive; -import com.merge.api.resources.filestorage.types.PaginatedDriveList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DrivesClient { - protected final ClientOptions clientOptions; - - public DrivesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Drive objects. - */ - public PaginatedDriveList list() { - return list(DrivesListRequest.builder().build()); - } - - /** - * Returns a list of Drive objects. - */ - public PaginatedDriveList list(DrivesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Drive objects. - */ - public PaginatedDriveList list(DrivesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/drives"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getName().isPresent()) { - httpUrl.addQueryParameter("name", request.getName().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedDriveList.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); - } - } - - /** - * Returns a Drive object with the given id. - */ - public Drive retrieve(String id) { - return retrieve(id, DrivesRetrieveRequest.builder().build()); - } - - /** - * Returns a Drive object with the given id. - */ - public Drive retrieve(String id, DrivesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Drive object with the given id. - */ - public Drive retrieve(String id, DrivesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/drives") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Drive.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/drives/requests/DrivesRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/drives/requests/DrivesRetrieveRequest.java deleted file mode 100644 index f168df918..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/drives/requests/DrivesRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.drives.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DrivesRetrieveRequest.Builder.class) -public final class DrivesRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private DrivesRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DrivesRetrieveRequest && equalTo((DrivesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DrivesRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(DrivesRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public DrivesRetrieveRequest build() { - return new DrivesRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/api/resources/filestorage/fieldmapping/FieldMappingClient.java deleted file mode 100644 index df0a81cff..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/FieldMappingClient.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.fieldmapping; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.fieldmapping.requests.CreateFieldMappingRequest; -import com.merge.api.resources.filestorage.fieldmapping.requests.FieldMappingsRetrieveRequest; -import com.merge.api.resources.filestorage.fieldmapping.requests.PatchedEditFieldMappingRequest; -import com.merge.api.resources.filestorage.fieldmapping.requests.RemoteFieldsRetrieveRequest; -import com.merge.api.resources.filestorage.types.ExternalTargetFieldApiResponse; -import com.merge.api.resources.filestorage.types.FieldMappingApiInstanceResponse; -import com.merge.api.resources.filestorage.types.FieldMappingInstanceResponse; -import com.merge.api.resources.filestorage.types.RemoteFieldApiResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FieldMappingClient { - protected final ClientOptions clientOptions; - - public FieldMappingClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { - return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { - return fieldMappingsRetrieve(request, null); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve( - FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingApiInstanceResponse.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); - } - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { - return fieldMappingsCreate(request, null); - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate( - CreateFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { - return fieldMappingsPartialUpdate( - fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request) { - return fieldMappingsPartialUpdate(fieldMappingId, request, null); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve() { - return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { - return remoteFieldsRetrieve(request, null); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve( - RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/remote-fields"); - if (request.getCommonModels().isPresent()) { - httpUrl.addQueryParameter("common_models", request.getCommonModels().get()); - } - if (request.getIncludeExampleValues().isPresent()) { - httpUrl.addQueryParameter( - "include_example_values", request.getIncludeExampleValues().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RemoteFieldApiResponse.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); - } - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve() { - return targetFieldsRetrieve(null); - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/target-fields") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), ExternalTargetFieldApiResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/CreateFieldMappingRequest.java deleted file mode 100644 index 8a65b66a4..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/CreateFieldMappingRequest.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) -public final class CreateFieldMappingRequest { - private final Optional excludeRemoteFieldMetadata; - - private final String targetFieldName; - - private final String targetFieldDescription; - - private final List remoteFieldTraversalPath; - - private final String remoteMethod; - - private final String remoteUrlPath; - - private final String commonModelName; - - private final Map additionalProperties; - - private CreateFieldMappingRequest( - Optional excludeRemoteFieldMetadata, - String targetFieldName, - String targetFieldDescription, - List remoteFieldTraversalPath, - String remoteMethod, - String remoteUrlPath, - String commonModelName, - Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.targetFieldName = targetFieldName; - this.targetFieldDescription = targetFieldDescription; - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.commonModelName = commonModelName; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - /** - * @return The name of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_name") - public String getTargetFieldName() { - return targetFieldName; - } - - /** - * @return The description of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_description") - public String getTargetFieldDescription() { - return targetFieldDescription; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public List getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public String getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public String getRemoteUrlPath() { - return remoteUrlPath; - } - - /** - * @return The name of the Common Model that the remote field corresponds to in a given category. - */ - @JsonProperty("common_model_name") - public String getCommonModelName() { - return commonModelName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateFieldMappingRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) - && targetFieldName.equals(other.targetFieldName) - && targetFieldDescription.equals(other.targetFieldDescription) - && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.excludeRemoteFieldMetadata, - this.targetFieldName, - this.targetFieldDescription, - this.remoteFieldTraversalPath, - this.remoteMethod, - this.remoteUrlPath, - this.commonModelName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TargetFieldNameStage builder() { - return new Builder(); - } - - public interface TargetFieldNameStage { - TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); - - Builder from(CreateFieldMappingRequest other); - } - - public interface TargetFieldDescriptionStage { - RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); - } - - public interface RemoteMethodStage { - RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); - } - - public interface RemoteUrlPathStage { - CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); - } - - public interface CommonModelNameStage { - _FinalStage commonModelName(@NotNull String commonModelName); - } - - public interface _FinalStage { - CreateFieldMappingRequest build(); - - _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); - - _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); - - _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); - - _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); - - _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements TargetFieldNameStage, - TargetFieldDescriptionStage, - RemoteMethodStage, - RemoteUrlPathStage, - CommonModelNameStage, - _FinalStage { - private String targetFieldName; - - private String targetFieldDescription; - - private String remoteMethod; - - private String remoteUrlPath; - - private String commonModelName; - - private List remoteFieldTraversalPath = new ArrayList<>(); - - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateFieldMappingRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - targetFieldName(other.getTargetFieldName()); - targetFieldDescription(other.getTargetFieldDescription()); - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - commonModelName(other.getCommonModelName()); - return this; - } - - /** - *

The name of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_name") - public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { - this.targetFieldName = targetFieldName; - return this; - } - - /** - *

The description of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_description") - public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { - this.targetFieldDescription = targetFieldDescription; - return this; - } - - /** - *

The method of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_method") - public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - /** - *

The path of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_url_path") - public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - /** - *

The name of the Common Model that the remote field corresponds to in a given category.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("common_model_name") - public _FinalStage commonModelName(@NotNull String commonModelName) { - this.commonModelName = commonModelName; - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.clear(); - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - @java.lang.Override - public CreateFieldMappingRequest build() { - return new CreateFieldMappingRequest( - excludeRemoteFieldMetadata, - targetFieldName, - targetFieldDescription, - remoteFieldTraversalPath, - remoteMethod, - remoteUrlPath, - commonModelName, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/FieldMappingsRetrieveRequest.java deleted file mode 100644 index fe032465e..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/FieldMappingsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) -public final class FieldMappingsRetrieveRequest { - private final Optional excludeRemoteFieldMetadata; - - private final Map additionalProperties; - - private FieldMappingsRetrieveRequest( - Optional excludeRemoteFieldMetadata, Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingsRetrieveRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingsRetrieveRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - return this; - } - - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - public FieldMappingsRetrieveRequest build() { - return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/PatchedEditFieldMappingRequest.java deleted file mode 100644 index 608fa3770..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/PatchedEditFieldMappingRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) -public final class PatchedEditFieldMappingRequest { - private final Optional> remoteFieldTraversalPath; - - private final Optional remoteMethod; - - private final Optional remoteUrlPath; - - private final Map additionalProperties; - - private PatchedEditFieldMappingRequest( - Optional> remoteFieldTraversalPath, - Optional remoteMethod, - Optional remoteUrlPath, - Map additionalProperties) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.additionalProperties = additionalProperties; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public Optional> getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public Optional getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public Optional getRemoteUrlPath() { - return remoteUrlPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> remoteFieldTraversalPath = Optional.empty(); - - private Optional remoteMethod = Optional.empty(); - - private Optional remoteUrlPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PatchedEditFieldMappingRequest other) { - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - return this; - } - - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - return this; - } - - public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); - return this; - } - - @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) - public Builder remoteMethod(Optional remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - public Builder remoteMethod(String remoteMethod) { - this.remoteMethod = Optional.ofNullable(remoteMethod); - return this; - } - - @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) - public Builder remoteUrlPath(Optional remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - public Builder remoteUrlPath(String remoteUrlPath) { - this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); - return this; - } - - public PatchedEditFieldMappingRequest build() { - return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/RemoteFieldsRetrieveRequest.java deleted file mode 100644 index 0f682eb07..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/fieldmapping/requests/RemoteFieldsRetrieveRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) -public final class RemoteFieldsRetrieveRequest { - private final Optional commonModels; - - private final Optional includeExampleValues; - - private final Map additionalProperties; - - private RemoteFieldsRetrieveRequest( - Optional commonModels, - Optional includeExampleValues, - Map additionalProperties) { - this.commonModels = commonModels; - this.includeExampleValues = includeExampleValues; - this.additionalProperties = additionalProperties; - } - - /** - * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. - */ - @JsonProperty("common_models") - public Optional getCommonModels() { - return commonModels; - } - - /** - * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. - */ - @JsonProperty("include_example_values") - public Optional getIncludeExampleValues() { - return includeExampleValues; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldsRetrieveRequest other) { - return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels, this.includeExampleValues); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional commonModels = Optional.empty(); - - private Optional includeExampleValues = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldsRetrieveRequest other) { - commonModels(other.getCommonModels()); - includeExampleValues(other.getIncludeExampleValues()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(Optional commonModels) { - this.commonModels = commonModels; - return this; - } - - public Builder commonModels(String commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) - public Builder includeExampleValues(Optional includeExampleValues) { - this.includeExampleValues = includeExampleValues; - return this; - } - - public Builder includeExampleValues(String includeExampleValues) { - this.includeExampleValues = Optional.ofNullable(includeExampleValues); - return this; - } - - public RemoteFieldsRetrieveRequest build() { - return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/files/FilesClient.java b/src/main/java/com/merge/api/resources/filestorage/files/FilesClient.java deleted file mode 100644 index 63935a96e..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/files/FilesClient.java +++ /dev/null @@ -1,344 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.files; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.core.ResponseBodyInputStream; -import com.merge.api.resources.filestorage.files.requests.FileStorageFileEndpointRequest; -import com.merge.api.resources.filestorage.files.requests.FilesDownloadRetrieveRequest; -import com.merge.api.resources.filestorage.files.requests.FilesListRequest; -import com.merge.api.resources.filestorage.files.requests.FilesRetrieveRequest; -import com.merge.api.resources.filestorage.types.File; -import com.merge.api.resources.filestorage.types.FileStorageFileResponse; -import com.merge.api.resources.filestorage.types.MetaResponse; -import com.merge.api.resources.filestorage.types.PaginatedFileList; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FilesClient { - protected final ClientOptions clientOptions; - - public FilesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of File objects. - */ - public PaginatedFileList list() { - return list(FilesListRequest.builder().build()); - } - - /** - * Returns a list of File objects. - */ - public PaginatedFileList list(FilesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of File objects. - */ - public PaginatedFileList list(FilesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/files"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getDriveId().isPresent()) { - httpUrl.addQueryParameter("drive_id", request.getDriveId().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getFolderId().isPresent()) { - httpUrl.addQueryParameter("folder_id", request.getFolderId().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getMimeType().isPresent()) { - httpUrl.addQueryParameter("mime_type", request.getMimeType().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getName().isPresent()) { - httpUrl.addQueryParameter("name", request.getName().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedFileList.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); - } - } - - /** - * Creates a File object with the given values. - */ - public FileStorageFileResponse create(FileStorageFileEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a File object with the given values. - */ - public FileStorageFileResponse create(FileStorageFileEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/files"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FileStorageFileResponse.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); - } - } - - /** - * Returns a File object with the given id. - */ - public File retrieve(String id) { - return retrieve(id, FilesRetrieveRequest.builder().build()); - } - - /** - * Returns a File object with the given id. - */ - public File retrieve(String id, FilesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a File object with the given id. - */ - public File retrieve(String id, FilesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/files") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), File.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); - } - } - - /** - * Returns the File content with the given id as a stream of bytes. - */ - public InputStream downloadRetrieve(String id) { - return downloadRetrieve(id, FilesDownloadRetrieveRequest.builder().build()); - } - - /** - * Returns the File content with the given id as a stream of bytes. - */ - public InputStream downloadRetrieve(String id, FilesDownloadRetrieveRequest request) { - return downloadRetrieve(id, request, null); - } - - /** - * Returns the File content with the given id as a stream of bytes. - */ - public InputStream downloadRetrieve( - String id, FilesDownloadRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/files") - .addPathSegment(id) - .addPathSegments("download"); - if (request.getMimeType().isPresent()) { - httpUrl.addQueryParameter("mime_type", request.getMimeType().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json"); - Request okhttpRequest = _requestBuilder.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 new ResponseBodyInputStream(response); - } - 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); - } - } - - /** - * Returns metadata for FileStorageFile POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for FileStorageFile POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/files/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesDownloadRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesDownloadRetrieveRequest.java deleted file mode 100644 index d96f7c137..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesDownloadRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.files.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FilesDownloadRetrieveRequest.Builder.class) -public final class FilesDownloadRetrieveRequest { - private final Optional mimeType; - - private final Map additionalProperties; - - private FilesDownloadRetrieveRequest(Optional mimeType, Map additionalProperties) { - this.mimeType = mimeType; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. - */ - @JsonProperty("mime_type") - public Optional getMimeType() { - return mimeType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FilesDownloadRetrieveRequest && equalTo((FilesDownloadRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FilesDownloadRetrieveRequest other) { - return mimeType.equals(other.mimeType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.mimeType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional mimeType = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FilesDownloadRetrieveRequest other) { - mimeType(other.getMimeType()); - return this; - } - - @JsonSetter(value = "mime_type", nulls = Nulls.SKIP) - public Builder mimeType(Optional mimeType) { - this.mimeType = mimeType; - return this; - } - - public Builder mimeType(String mimeType) { - this.mimeType = Optional.ofNullable(mimeType); - return this; - } - - public FilesDownloadRetrieveRequest build() { - return new FilesDownloadRetrieveRequest(mimeType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesRetrieveRequest.java deleted file mode 100644 index 1aedaca8c..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/files/requests/FilesRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.files.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.files.types.FilesRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FilesRetrieveRequest.Builder.class) -public final class FilesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private FilesRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FilesRetrieveRequest && equalTo((FilesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FilesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FilesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(FilesRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public FilesRetrieveRequest build() { - return new FilesRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/files/types/FilesListRequestExpand.java b/src/main/java/com/merge/api/resources/filestorage/files/types/FilesListRequestExpand.java deleted file mode 100644 index aa5189316..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/files/types/FilesListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.files.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FilesListRequestExpand { - DRIVE("drive"), - - FOLDER("folder"), - - FOLDER_DRIVE("folder,drive"), - - PERMISSIONS("permissions"), - - PERMISSIONS_DRIVE("permissions,drive"), - - PERMISSIONS_FOLDER("permissions,folder"), - - PERMISSIONS_FOLDER_DRIVE("permissions,folder,drive"); - - private final String value; - - FilesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/files/types/FilesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/filestorage/files/types/FilesRetrieveRequestExpand.java deleted file mode 100644 index c3afe7347..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/files/types/FilesRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.files.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FilesRetrieveRequestExpand { - DRIVE("drive"), - - FOLDER("folder"), - - FOLDER_DRIVE("folder,drive"), - - PERMISSIONS("permissions"), - - PERMISSIONS_DRIVE("permissions,drive"), - - PERMISSIONS_FOLDER("permissions,folder"), - - PERMISSIONS_FOLDER_DRIVE("permissions,folder,drive"); - - private final String value; - - FilesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/folders/FoldersClient.java b/src/main/java/com/merge/api/resources/filestorage/folders/FoldersClient.java deleted file mode 100644 index a66deb6b3..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/folders/FoldersClient.java +++ /dev/null @@ -1,286 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.folders; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.folders.requests.FileStorageFolderEndpointRequest; -import com.merge.api.resources.filestorage.folders.requests.FoldersListRequest; -import com.merge.api.resources.filestorage.folders.requests.FoldersRetrieveRequest; -import com.merge.api.resources.filestorage.types.FileStorageFolderResponse; -import com.merge.api.resources.filestorage.types.Folder; -import com.merge.api.resources.filestorage.types.MetaResponse; -import com.merge.api.resources.filestorage.types.PaginatedFolderList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FoldersClient { - protected final ClientOptions clientOptions; - - public FoldersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Folder objects. - */ - public PaginatedFolderList list() { - return list(FoldersListRequest.builder().build()); - } - - /** - * Returns a list of Folder objects. - */ - public PaginatedFolderList list(FoldersListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Folder objects. - */ - public PaginatedFolderList list(FoldersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/folders"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getDriveId().isPresent()) { - httpUrl.addQueryParameter("drive_id", request.getDriveId().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getName().isPresent()) { - httpUrl.addQueryParameter("name", request.getName().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getParentFolderId().isPresent()) { - httpUrl.addQueryParameter( - "parent_folder_id", request.getParentFolderId().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedFolderList.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); - } - } - - /** - * Creates a Folder object with the given values. - */ - public FileStorageFolderResponse create(FileStorageFolderEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Folder object with the given values. - */ - public FileStorageFolderResponse create(FileStorageFolderEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/folders"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FileStorageFolderResponse.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); - } - } - - /** - * Returns a Folder object with the given id. - */ - public Folder retrieve(String id) { - return retrieve(id, FoldersRetrieveRequest.builder().build()); - } - - /** - * Returns a Folder object with the given id. - */ - public Folder retrieve(String id, FoldersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Folder object with the given id. - */ - public Folder retrieve(String id, FoldersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/folders") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Folder.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); - } - } - - /** - * Returns metadata for FileStorageFolder POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for FileStorageFolder POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/folders/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/folders/requests/FoldersRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/folders/requests/FoldersRetrieveRequest.java deleted file mode 100644 index e63f10763..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/folders/requests/FoldersRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.folders.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.folders.types.FoldersRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FoldersRetrieveRequest.Builder.class) -public final class FoldersRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private FoldersRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FoldersRetrieveRequest && equalTo((FoldersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FoldersRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FoldersRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(FoldersRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public FoldersRetrieveRequest build() { - return new FoldersRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/folders/types/FoldersListRequestExpand.java b/src/main/java/com/merge/api/resources/filestorage/folders/types/FoldersListRequestExpand.java deleted file mode 100644 index d6f9639c1..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/folders/types/FoldersListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.folders.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FoldersListRequestExpand { - DRIVE("drive"), - - PARENT_FOLDER("parent_folder"), - - PARENT_FOLDER_DRIVE("parent_folder,drive"), - - PERMISSIONS("permissions"), - - PERMISSIONS_DRIVE("permissions,drive"), - - PERMISSIONS_PARENT_FOLDER("permissions,parent_folder"), - - PERMISSIONS_PARENT_FOLDER_DRIVE("permissions,parent_folder,drive"); - - private final String value; - - FoldersListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/folders/types/FoldersRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/filestorage/folders/types/FoldersRetrieveRequestExpand.java deleted file mode 100644 index 1a9fe5f33..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/folders/types/FoldersRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.folders.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FoldersRetrieveRequestExpand { - DRIVE("drive"), - - PARENT_FOLDER("parent_folder"), - - PARENT_FOLDER_DRIVE("parent_folder,drive"), - - PERMISSIONS("permissions"), - - PERMISSIONS_DRIVE("permissions,drive"), - - PERMISSIONS_PARENT_FOLDER("permissions,parent_folder"), - - PERMISSIONS_PARENT_FOLDER_DRIVE("permissions,parent_folder,drive"); - - private final String value; - - FoldersRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/forceresync/ForceResyncClient.java b/src/main/java/com/merge/api/resources/filestorage/forceresync/ForceResyncClient.java deleted file mode 100644 index dce262465..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/forceresync/ForceResyncClient.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.forceresync; - -import com.fasterxml.jackson.core.type.TypeReference; -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.filestorage.types.SyncStatus; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ForceResyncClient { - protected final ClientOptions clientOptions; - - public ForceResyncClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate() { - return syncStatusResyncCreate(null); - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/sync-status/resync") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/api/resources/filestorage/generatekey/GenerateKeyClient.java deleted file mode 100644 index e78d528d0..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/generatekey/GenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.generatekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.generatekey.requests.GenerateRemoteKeyRequest; -import com.merge.api.resources.filestorage.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GenerateKeyClient { - protected final ClientOptions clientOptions; - - public GenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request) { - return create(request, null); - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/generate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/resources/filestorage/generatekey/requests/GenerateRemoteKeyRequest.java deleted file mode 100644 index 4bf11f233..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/generatekey/requests/GenerateRemoteKeyRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.generatekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) -public final class GenerateRemoteKeyRequest { - private final String name; - - private final Map additionalProperties; - - private GenerateRemoteKeyRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GenerateRemoteKeyRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(GenerateRemoteKeyRequest other); - } - - public interface _FinalStage { - GenerateRemoteKeyRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GenerateRemoteKeyRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public GenerateRemoteKeyRequest build() { - return new GenerateRemoteKeyRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/groups/GroupsClient.java b/src/main/java/com/merge/api/resources/filestorage/groups/GroupsClient.java deleted file mode 100644 index cb7bb04c5..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/groups/GroupsClient.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.groups; - -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.filestorage.groups.requests.GroupsListRequest; -import com.merge.api.resources.filestorage.groups.requests.GroupsRetrieveRequest; -import com.merge.api.resources.filestorage.types.Group; -import com.merge.api.resources.filestorage.types.PaginatedGroupList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GroupsClient { - protected final ClientOptions clientOptions; - - public GroupsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Group objects. - */ - public PaginatedGroupList list() { - return list(GroupsListRequest.builder().build()); - } - - /** - * Returns a list of Group objects. - */ - public PaginatedGroupList list(GroupsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Group objects. - */ - public PaginatedGroupList list(GroupsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/groups"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedGroupList.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); - } - } - - /** - * Returns a Group object with the given id. - */ - public Group retrieve(String id) { - return retrieve(id, GroupsRetrieveRequest.builder().build()); - } - - /** - * Returns a Group object with the given id. - */ - public Group retrieve(String id, GroupsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Group object with the given id. - */ - public Group retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/groups") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Group.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/groups/requests/GroupsListRequest.java b/src/main/java/com/merge/api/resources/filestorage/groups/requests/GroupsListRequest.java deleted file mode 100644 index dc153eeb5..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/groups/requests/GroupsListRequest.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.groups.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GroupsListRequest.Builder.class) -public final class GroupsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private GroupsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GroupsListRequest && equalTo((GroupsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GroupsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GroupsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public GroupsListRequest build() { - return new GroupsListRequest( - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/groups/requests/GroupsRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/groups/requests/GroupsRetrieveRequest.java deleted file mode 100644 index 5b4cade80..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/groups/requests/GroupsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.groups.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GroupsRetrieveRequest.Builder.class) -public final class GroupsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private GroupsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GroupsRetrieveRequest && equalTo((GroupsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GroupsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GroupsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public GroupsRetrieveRequest build() { - return new GroupsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/issues/IssuesClient.java b/src/main/java/com/merge/api/resources/filestorage/issues/IssuesClient.java deleted file mode 100644 index b259f9023..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/issues/IssuesClient.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.issues; - -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.filestorage.issues.requests.IssuesListRequest; -import com.merge.api.resources.filestorage.types.Issue; -import com.merge.api.resources.filestorage.types.PaginatedIssueList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuesClient { - protected final ClientOptions clientOptions; - - public IssuesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list() { - return list(IssuesListRequest.builder().build()); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request) { - return list(request, null); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/issues"); - if (request.getAccountToken().isPresent()) { - httpUrl.addQueryParameter("account_token", request.getAccountToken().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getFirstIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_after", - request.getFirstIncidentTimeAfter().get().toString()); - } - if (request.getFirstIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_before", - request.getFirstIncidentTimeBefore().get().toString()); - } - if (request.getIncludeMuted().isPresent()) { - httpUrl.addQueryParameter("include_muted", request.getIncludeMuted().get()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getLastIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_after", - request.getLastIncidentTimeAfter().get().toString()); - } - if (request.getLastIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_before", - request.getLastIncidentTimeBefore().get().toString()); - } - if (request.getLinkedAccountId().isPresent()) { - httpUrl.addQueryParameter( - "linked_account_id", request.getLinkedAccountId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedIssueList.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); - } - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id) { - return retrieve(id, null); - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/issues") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), Issue.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/api/resources/filestorage/issues/requests/IssuesListRequest.java deleted file mode 100644 index 056285851..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/issues/requests/IssuesListRequest.java +++ /dev/null @@ -1,477 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.issues.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.issues.types.IssuesListRequestStatus; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IssuesListRequest.Builder.class) -public final class IssuesListRequest { - private final Optional accountToken; - - private final Optional cursor; - - private final Optional endDate; - - private final Optional endUserOrganizationName; - - private final Optional firstIncidentTimeAfter; - - private final Optional firstIncidentTimeBefore; - - private final Optional includeMuted; - - private final Optional integrationName; - - private final Optional lastIncidentTimeAfter; - - private final Optional lastIncidentTimeBefore; - - private final Optional linkedAccountId; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional status; - - private final Map additionalProperties; - - private IssuesListRequest( - Optional accountToken, - Optional cursor, - Optional endDate, - Optional endUserOrganizationName, - Optional firstIncidentTimeAfter, - Optional firstIncidentTimeBefore, - Optional includeMuted, - Optional integrationName, - Optional lastIncidentTimeAfter, - Optional lastIncidentTimeBefore, - Optional linkedAccountId, - Optional pageSize, - Optional startDate, - Optional status, - Map additionalProperties) { - this.accountToken = accountToken; - this.cursor = cursor; - this.endDate = endDate; - this.endUserOrganizationName = endUserOrganizationName; - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - this.includeMuted = includeMuted; - this.integrationName = integrationName; - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - this.linkedAccountId = linkedAccountId; - this.pageSize = pageSize; - this.startDate = startDate; - this.status = status; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public Optional getAccountToken() { - return accountToken; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include issues whose most recent action occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return issues whose first incident time was after this datetime. - */ - @JsonProperty("first_incident_time_after") - public Optional getFirstIncidentTimeAfter() { - return firstIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose first incident time was before this datetime. - */ - @JsonProperty("first_incident_time_before") - public Optional getFirstIncidentTimeBefore() { - return firstIncidentTimeBefore; - } - - /** - * @return If true, will include muted issues - */ - @JsonProperty("include_muted") - public Optional getIncludeMuted() { - return includeMuted; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If provided, will only return issues whose last incident time was after this datetime. - */ - @JsonProperty("last_incident_time_after") - public Optional getLastIncidentTimeAfter() { - return lastIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose last incident time was before this datetime. - */ - @JsonProperty("last_incident_time_before") - public Optional getLastIncidentTimeBefore() { - return lastIncidentTimeBefore; - } - - /** - * @return If provided, will only include issues pertaining to the linked account passed in. - */ - @JsonProperty("linked_account_id") - public Optional getLinkedAccountId() { - return linkedAccountId; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include issues whose most recent action occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IssuesListRequest other) { - return accountToken.equals(other.accountToken) - && cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) - && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) - && includeMuted.equals(other.includeMuted) - && integrationName.equals(other.integrationName) - && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) - && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) - && linkedAccountId.equals(other.linkedAccountId) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountToken, - this.cursor, - this.endDate, - this.endUserOrganizationName, - this.firstIncidentTimeAfter, - this.firstIncidentTimeBefore, - this.includeMuted, - this.integrationName, - this.lastIncidentTimeAfter, - this.lastIncidentTimeBefore, - this.linkedAccountId, - this.pageSize, - this.startDate, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountToken = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional firstIncidentTimeAfter = Optional.empty(); - - private Optional firstIncidentTimeBefore = Optional.empty(); - - private Optional includeMuted = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional lastIncidentTimeAfter = Optional.empty(); - - private Optional lastIncidentTimeBefore = Optional.empty(); - - private Optional linkedAccountId = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(IssuesListRequest other) { - accountToken(other.getAccountToken()); - cursor(other.getCursor()); - endDate(other.getEndDate()); - endUserOrganizationName(other.getEndUserOrganizationName()); - firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); - firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); - includeMuted(other.getIncludeMuted()); - integrationName(other.getIntegrationName()); - lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); - lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); - linkedAccountId(other.getLinkedAccountId()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "account_token", nulls = Nulls.SKIP) - public Builder accountToken(Optional accountToken) { - this.accountToken = accountToken; - return this; - } - - public Builder accountToken(String accountToken) { - this.accountToken = Optional.ofNullable(accountToken); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) - public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - return this; - } - - public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) - public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - return this; - } - - public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) - public Builder includeMuted(Optional includeMuted) { - this.includeMuted = includeMuted; - return this; - } - - public Builder includeMuted(String includeMuted) { - this.includeMuted = Optional.ofNullable(includeMuted); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) - public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - return this; - } - - public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) - public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - return this; - } - - public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) - public Builder linkedAccountId(Optional linkedAccountId) { - this.linkedAccountId = linkedAccountId; - return this; - } - - public Builder linkedAccountId(String linkedAccountId) { - this.linkedAccountId = Optional.ofNullable(linkedAccountId); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(IssuesListRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - public IssuesListRequest build() { - return new IssuesListRequest( - accountToken, - cursor, - endDate, - endUserOrganizationName, - firstIncidentTimeAfter, - firstIncidentTimeBefore, - includeMuted, - integrationName, - lastIncidentTimeAfter, - lastIncidentTimeBefore, - linkedAccountId, - pageSize, - startDate, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/resources/filestorage/issues/types/IssuesListRequestStatus.java deleted file mode 100644 index bb7e96319..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/issues/types/IssuesListRequestStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.issues.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssuesListRequestStatus { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssuesListRequestStatus(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/LinkedAccountsClient.java deleted file mode 100644 index 19e083762..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/LinkedAccountsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.linkedaccounts; - -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.filestorage.linkedaccounts.requests.LinkedAccountsListRequest; -import com.merge.api.resources.filestorage.types.PaginatedAccountDetailsAndActionsList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkedAccountsClient { - protected final ClientOptions clientOptions; - - public LinkedAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list() { - return list(LinkedAccountsListRequest.builder().build()); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list(LinkedAccountsListRequest request) { - return list(request, null); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list( - LinkedAccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/linked-accounts"); - if (request.getCategory().isPresent()) { - httpUrl.addQueryParameter("category", request.getCategory().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndUserEmailAddress().isPresent()) { - httpUrl.addQueryParameter( - "end_user_email_address", request.getEndUserEmailAddress().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getEndUserOriginId().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_id", request.getEndUserOriginId().get()); - } - if (request.getEndUserOriginIds().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_ids", request.getEndUserOriginIds().get()); - } - if (request.getId().isPresent()) { - httpUrl.addQueryParameter("id", request.getId().get()); - } - if (request.getIds().isPresent()) { - httpUrl.addQueryParameter("ids", request.getIds().get()); - } - if (request.getIncludeDuplicates().isPresent()) { - httpUrl.addQueryParameter( - "include_duplicates", request.getIncludeDuplicates().get().toString()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getIsTestAccount().isPresent()) { - httpUrl.addQueryParameter( - "is_test_account", request.getIsTestAccount().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountDetailsAndActionsList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/requests/LinkedAccountsListRequest.java deleted file mode 100644 index 8e44f0b27..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/requests/LinkedAccountsListRequest.java +++ /dev/null @@ -1,458 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.linkedaccounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.linkedaccounts.types.LinkedAccountsListRequestCategory; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) -public final class LinkedAccountsListRequest { - private final Optional category; - - private final Optional cursor; - - private final Optional endUserEmailAddress; - - private final Optional endUserOrganizationName; - - private final Optional endUserOriginId; - - private final Optional endUserOriginIds; - - private final Optional id; - - private final Optional ids; - - private final Optional includeDuplicates; - - private final Optional integrationName; - - private final Optional isTestAccount; - - private final Optional pageSize; - - private final Optional status; - - private final Map additionalProperties; - - private LinkedAccountsListRequest( - Optional category, - Optional cursor, - Optional endUserEmailAddress, - Optional endUserOrganizationName, - Optional endUserOriginId, - Optional endUserOriginIds, - Optional id, - Optional ids, - Optional includeDuplicates, - Optional integrationName, - Optional isTestAccount, - Optional pageSize, - Optional status, - Map additionalProperties) { - this.category = category; - this.cursor = cursor; - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.endUserOriginIds = endUserOriginIds; - this.id = id; - this.ids = ids; - this.includeDuplicates = includeDuplicates; - this.integrationName = integrationName; - this.isTestAccount = isTestAccount; - this.pageSize = pageSize; - this.status = status; - this.additionalProperties = additionalProperties; - } - - /** - * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing - *
    - *
  • hris - hris
  • - *
  • ats - ats
  • - *
  • accounting - accounting
  • - *
  • ticketing - ticketing
  • - *
  • crm - crm
  • - *
  • mktg - mktg
  • - *
  • filestorage - filestorage
  • - *
- */ - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return linked accounts associated with the given email address. - */ - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return If provided, will only return linked accounts associated with the given organization name. - */ - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return linked accounts associated with the given origin ID. - */ - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. - */ - @JsonProperty("end_user_origin_ids") - public Optional getEndUserOriginIds() { - return endUserOriginIds; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. - */ - @JsonProperty("ids") - public Optional getIds() { - return ids; - } - - /** - * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. - */ - @JsonProperty("include_duplicates") - public Optional getIncludeDuplicates() { - return includeDuplicates; - } - - /** - * @return If provided, will only return linked accounts associated with the given integration name. - */ - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. - */ - @JsonProperty("is_test_account") - public Optional getIsTestAccount() { - return isTestAccount; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountsListRequest other) { - return category.equals(other.category) - && cursor.equals(other.cursor) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOriginIds.equals(other.endUserOriginIds) - && id.equals(other.id) - && ids.equals(other.ids) - && includeDuplicates.equals(other.includeDuplicates) - && integrationName.equals(other.integrationName) - && isTestAccount.equals(other.isTestAccount) - && pageSize.equals(other.pageSize) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.category, - this.cursor, - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.endUserOriginIds, - this.id, - this.ids, - this.includeDuplicates, - this.integrationName, - this.isTestAccount, - this.pageSize, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional category = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOriginIds = Optional.empty(); - - private Optional id = Optional.empty(); - - private Optional ids = Optional.empty(); - - private Optional includeDuplicates = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional isTestAccount = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountsListRequest other) { - category(other.getCategory()); - cursor(other.getCursor()); - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - endUserOriginIds(other.getEndUserOriginIds()); - id(other.getId()); - ids(other.getIds()); - includeDuplicates(other.getIncludeDuplicates()); - integrationName(other.getIntegrationName()); - isTestAccount(other.getIsTestAccount()); - pageSize(other.getPageSize()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(LinkedAccountsListRequestCategory category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) - public Builder endUserOriginIds(Optional endUserOriginIds) { - this.endUserOriginIds = endUserOriginIds; - return this; - } - - public Builder endUserOriginIds(String endUserOriginIds) { - this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "ids", nulls = Nulls.SKIP) - public Builder ids(Optional ids) { - this.ids = ids; - return this; - } - - public Builder ids(String ids) { - this.ids = Optional.ofNullable(ids); - return this; - } - - @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) - public Builder includeDuplicates(Optional includeDuplicates) { - this.includeDuplicates = includeDuplicates; - return this; - } - - public Builder includeDuplicates(Boolean includeDuplicates) { - this.includeDuplicates = Optional.ofNullable(includeDuplicates); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) - public Builder isTestAccount(Optional isTestAccount) { - this.isTestAccount = isTestAccount; - return this; - } - - public Builder isTestAccount(String isTestAccount) { - this.isTestAccount = Optional.ofNullable(isTestAccount); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - public LinkedAccountsListRequest build() { - return new LinkedAccountsListRequest( - category, - cursor, - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - endUserOriginIds, - id, - ids, - includeDuplicates, - integrationName, - isTestAccount, - pageSize, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/types/LinkedAccountsListRequestCategory.java deleted file mode 100644 index ccfdd57a2..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/linkedaccounts/types/LinkedAccountsListRequestCategory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.linkedaccounts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LinkedAccountsListRequestCategory { - ACCOUNTING("accounting"), - - ATS("ats"), - - CRM("crm"), - - FILESTORAGE("filestorage"), - - HRIS("hris"), - - MKTG("mktg"), - - TICKETING("ticketing"); - - private final String value; - - LinkedAccountsListRequestCategory(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/linktoken/LinkTokenClient.java b/src/main/java/com/merge/api/resources/filestorage/linktoken/LinkTokenClient.java deleted file mode 100644 index 445a4c7df..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/linktoken/LinkTokenClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.linktoken; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.linktoken.requests.EndUserDetailsRequest; -import com.merge.api.resources.filestorage.types.LinkToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkTokenClient { - protected final ClientOptions clientOptions; - - public LinkTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request) { - return create(request, null); - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/link-token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), LinkToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/api/resources/filestorage/linktoken/requests/EndUserDetailsRequest.java deleted file mode 100644 index 5dd21076a..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/linktoken/requests/EndUserDetailsRequest.java +++ /dev/null @@ -1,611 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.linktoken.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.types.CategoriesEnum; -import com.merge.api.resources.filestorage.types.CommonModelScopesBodyRequest; -import com.merge.api.resources.filestorage.types.IndividualCommonModelScopeDeserializerRequest; -import com.merge.api.resources.filestorage.types.LanguageEnum; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) -public final class EndUserDetailsRequest { - private final String endUserEmailAddress; - - private final String endUserOrganizationName; - - private final String endUserOriginId; - - private final List categories; - - private final Optional integration; - - private final Optional linkExpiryMins; - - private final Optional shouldCreateMagicLinkUrl; - - private final Optional hideAdminMagicLink; - - private final Optional> commonModels; - - private final Optional>>> - categoryCommonModelScopes; - - private final Optional language; - - private final Optional areSyncsDisabled; - - private final Optional> integrationSpecificConfig; - - private final Map additionalProperties; - - private EndUserDetailsRequest( - String endUserEmailAddress, - String endUserOrganizationName, - String endUserOriginId, - List categories, - Optional integration, - Optional linkExpiryMins, - Optional shouldCreateMagicLinkUrl, - Optional hideAdminMagicLink, - Optional> commonModels, - Optional>>> - categoryCommonModelScopes, - Optional language, - Optional areSyncsDisabled, - Optional> integrationSpecificConfig, - Map additionalProperties) { - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.categories = categories; - this.integration = integration; - this.linkExpiryMins = linkExpiryMins; - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - this.hideAdminMagicLink = hideAdminMagicLink; - this.commonModels = commonModels; - this.categoryCommonModelScopes = categoryCommonModelScopes; - this.language = language; - this.areSyncsDisabled = areSyncsDisabled; - this.integrationSpecificConfig = integrationSpecificConfig; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. - */ - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return Your end user's organization. - */ - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. - */ - @JsonProperty("end_user_origin_id") - public String getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return The integration categories to show in Merge Link. - */ - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - /** - * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. - */ - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - /** - * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. - */ - @JsonProperty("link_expiry_mins") - public Optional getLinkExpiryMins() { - return linkExpiryMins; - } - - /** - * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("should_create_magic_link_url") - public Optional getShouldCreateMagicLinkUrl() { - return shouldCreateMagicLinkUrl; - } - - /** - * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("hide_admin_magic_link") - public Optional getHideAdminMagicLink() { - return hideAdminMagicLink; - } - - /** - * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. - */ - @JsonProperty("common_models") - public Optional> getCommonModels() { - return commonModels; - } - - /** - * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. - */ - @JsonProperty("category_common_model_scopes") - public Optional>>> - getCategoryCommonModelScopes() { - return categoryCommonModelScopes; - } - - /** - * @return The following subset of IETF language tags can be used to configure localization. - *
    - *
  • en - en
  • - *
  • de - de
  • - *
- */ - @JsonProperty("language") - public Optional getLanguage() { - return language; - } - - /** - * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. - */ - @JsonProperty("are_syncs_disabled") - public Optional getAreSyncsDisabled() { - return areSyncsDisabled; - } - - /** - * @return A JSON object containing integration-specific configuration options. - */ - @JsonProperty("integration_specific_config") - public Optional> getIntegrationSpecificConfig() { - return integrationSpecificConfig; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EndUserDetailsRequest other) { - return endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && categories.equals(other.categories) - && integration.equals(other.integration) - && linkExpiryMins.equals(other.linkExpiryMins) - && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) - && hideAdminMagicLink.equals(other.hideAdminMagicLink) - && commonModels.equals(other.commonModels) - && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) - && language.equals(other.language) - && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.categories, - this.integration, - this.linkExpiryMins, - this.shouldCreateMagicLinkUrl, - this.hideAdminMagicLink, - this.commonModels, - this.categoryCommonModelScopes, - this.language, - this.areSyncsDisabled, - this.integrationSpecificConfig); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EndUserEmailAddressStage builder() { - return new Builder(); - } - - public interface EndUserEmailAddressStage { - EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); - - Builder from(EndUserDetailsRequest other); - } - - public interface EndUserOrganizationNameStage { - EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserOriginIdStage { - _FinalStage endUserOriginId(@NotNull String endUserOriginId); - } - - public interface _FinalStage { - EndUserDetailsRequest build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage integration(Optional integration); - - _FinalStage integration(String integration); - - _FinalStage linkExpiryMins(Optional linkExpiryMins); - - _FinalStage linkExpiryMins(Integer linkExpiryMins); - - _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); - - _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); - - _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); - - _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); - - _FinalStage commonModels(Optional> commonModels); - - _FinalStage commonModels(List commonModels); - - _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes); - - _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes); - - _FinalStage language(Optional language); - - _FinalStage language(LanguageEnum language); - - _FinalStage areSyncsDisabled(Optional areSyncsDisabled); - - _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); - - _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); - - _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { - private String endUserEmailAddress; - - private String endUserOrganizationName; - - private String endUserOriginId; - - private Optional> integrationSpecificConfig = Optional.empty(); - - private Optional areSyncsDisabled = Optional.empty(); - - private Optional language = Optional.empty(); - - private Optional>>> - categoryCommonModelScopes = Optional.empty(); - - private Optional> commonModels = Optional.empty(); - - private Optional hideAdminMagicLink = Optional.empty(); - - private Optional shouldCreateMagicLinkUrl = Optional.empty(); - - private Optional linkExpiryMins = Optional.empty(); - - private Optional integration = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EndUserDetailsRequest other) { - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - categories(other.getCategories()); - integration(other.getIntegration()); - linkExpiryMins(other.getLinkExpiryMins()); - shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); - hideAdminMagicLink(other.getHideAdminMagicLink()); - commonModels(other.getCommonModels()); - categoryCommonModelScopes(other.getCategoryCommonModelScopes()); - language(other.getLanguage()); - areSyncsDisabled(other.getAreSyncsDisabled()); - integrationSpecificConfig(other.getIntegrationSpecificConfig()); - return this; - } - - /** - *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_email_address") - public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - /** - *

Your end user's organization.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - /** - *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_origin_id") - public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - /** - *

A JSON object containing integration-specific configuration options.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { - this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) - public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { - this.integrationSpecificConfig = integrationSpecificConfig; - return this; - } - - /** - *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { - this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) - public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { - this.areSyncsDisabled = areSyncsDisabled; - return this; - } - - /** - *

The following subset of IETF language tags can be used to configure localization.

- *
    - *
  • en - en
  • - *
  • de - de
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage language(LanguageEnum language) { - this.language = Optional.ofNullable(language); - return this; - } - - @java.lang.Override - @JsonSetter(value = "language", nulls = Nulls.SKIP) - public _FinalStage language(Optional language) { - this.language = language; - return this; - } - - /** - *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes) { - this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) - public _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes) { - this.categoryCommonModelScopes = categoryCommonModelScopes; - return this; - } - - /** - *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage commonModels(List commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @java.lang.Override - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public _FinalStage commonModels(Optional> commonModels) { - this.commonModels = commonModels; - return this; - } - - /** - *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { - this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); - return this; - } - - @java.lang.Override - @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) - public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { - this.hideAdminMagicLink = hideAdminMagicLink; - return this; - } - - /** - *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) - public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - return this; - } - - /** - *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage linkExpiryMins(Integer linkExpiryMins) { - this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); - return this; - } - - @java.lang.Override - @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) - public _FinalStage linkExpiryMins(Optional linkExpiryMins) { - this.linkExpiryMins = linkExpiryMins; - return this; - } - - /** - *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public EndUserDetailsRequest build() { - return new EndUserDetailsRequest( - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - categories, - integration, - linkExpiryMins, - shouldCreateMagicLinkUrl, - hideAdminMagicLink, - commonModels, - categoryCommonModelScopes, - language, - areSyncsDisabled, - integrationSpecificConfig, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/passthrough/PassthroughClient.java b/src/main/java/com/merge/api/resources/filestorage/passthrough/PassthroughClient.java deleted file mode 100644 index 7e2086ad9..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/passthrough/PassthroughClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.passthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.types.DataPassthroughRequest; -import com.merge.api.resources.filestorage.types.RemoteResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PassthroughClient { - protected final ClientOptions clientOptions; - - public PassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), RemoteResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/api/resources/filestorage/regeneratekey/RegenerateKeyClient.java deleted file mode 100644 index cf8d0d7d1..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/regeneratekey/RegenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.regeneratekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.regeneratekey.requests.RemoteKeyForRegenerationRequest; -import com.merge.api.resources.filestorage.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RegenerateKeyClient { - protected final ClientOptions clientOptions; - - public RegenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request) { - return create(request, null); - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/regenerate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/resources/filestorage/regeneratekey/requests/RemoteKeyForRegenerationRequest.java deleted file mode 100644 index f70ffb519..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/regeneratekey/requests/RemoteKeyForRegenerationRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.regeneratekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) -public final class RemoteKeyForRegenerationRequest { - private final String name; - - private final Map additionalProperties; - - private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKeyForRegenerationRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(RemoteKeyForRegenerationRequest other); - } - - public interface _FinalStage { - RemoteKeyForRegenerationRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKeyForRegenerationRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public RemoteKeyForRegenerationRequest build() { - return new RemoteKeyForRegenerationRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/scopes/ScopesClient.java b/src/main/java/com/merge/api/resources/filestorage/scopes/ScopesClient.java deleted file mode 100644 index 926bfe9d9..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/scopes/ScopesClient.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.scopes; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; -import com.merge.api.resources.filestorage.types.CommonModelScopeApi; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ScopesClient { - protected final ClientOptions clientOptions; - - public ScopesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve() { - return defaultScopesRetrieve(null); - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/default-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve() { - return linkedAccountScopesRetrieve(null); - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/linked-account-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { - return linkedAccountScopesCreate(request, null); - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate( - LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/linked-account-scopes") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/filestorage/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 01b303860..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.scopes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.filestorage.types.IndividualCommonModelScopeDeserializerRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) -public final class LinkedAccountCommonModelScopeDeserializerRequest { - private final List commonModels; - - private final Map additionalProperties; - - private LinkedAccountCommonModelScopeDeserializerRequest( - List commonModels, - Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountCommonModelScopeDeserializerRequest - && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public LinkedAccountCommonModelScopeDeserializerRequest build() { - return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/api/resources/filestorage/syncstatus/SyncStatusClient.java deleted file mode 100644 index ad80aa4cb..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/syncstatus/SyncStatusClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.syncstatus; - -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.filestorage.syncstatus.requests.SyncStatusListRequest; -import com.merge.api.resources.filestorage.types.PaginatedSyncStatusList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SyncStatusClient { - protected final ClientOptions clientOptions; - - public SyncStatusClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list() { - return list(SyncStatusListRequest.builder().build()); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request) { - return list(request, null); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/sync-status"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedSyncStatusList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/api/resources/filestorage/syncstatus/requests/SyncStatusListRequest.java deleted file mode 100644 index c5109a05e..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/syncstatus/requests/SyncStatusListRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.syncstatus.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) -public final class SyncStatusListRequest { - private final Optional cursor; - - private final Optional pageSize; - - private final Map additionalProperties; - - private SyncStatusListRequest( - Optional cursor, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatusListRequest other) { - return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(SyncStatusListRequest other) { - cursor(other.getCursor()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public SyncStatusListRequest build() { - return new SyncStatusListRequest(cursor, pageSize, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetails.java b/src/main/java/com/merge/api/resources/filestorage/types/AccountDetails.java deleted file mode 100644 index acc440e59..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetails.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetails.Builder.class) -public final class AccountDetails { - private final Optional id; - - private final Optional integration; - - private final Optional integrationSlug; - - private final Optional category; - - private final Optional endUserOriginId; - - private final Optional endUserOrganizationName; - - private final Optional endUserEmailAddress; - - private final Optional status; - - private final Optional webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional accountType; - - private final Optional completedAt; - - private final Map additionalProperties; - - private AccountDetails( - Optional id, - Optional integration, - Optional integrationSlug, - Optional category, - Optional endUserOriginId, - Optional endUserOrganizationName, - Optional endUserEmailAddress, - Optional status, - Optional webhookListenerUrl, - Optional isDuplicate, - Optional accountType, - Optional completedAt, - Map additionalProperties) { - this.id = id; - this.integration = integration; - this.integrationSlug = integrationSlug; - this.category = category; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.status = status; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("integration_slug") - public Optional getIntegrationSlug() { - return integrationSlug; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("webhook_listener_url") - public Optional getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The time at which account completes the linking flow. - */ - @JsonProperty("completed_at") - public Optional getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetails && equalTo((AccountDetails) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetails other) { - return id.equals(other.id) - && integration.equals(other.integration) - && integrationSlug.equals(other.integrationSlug) - && category.equals(other.category) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && status.equals(other.status) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.integration, - this.integrationSlug, - this.category, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.status, - this.webhookListenerUrl, - this.isDuplicate, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional integration = Optional.empty(); - - private Optional integrationSlug = Optional.empty(); - - private Optional category = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional webhookListenerUrl = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional completedAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountDetails other) { - id(other.getId()); - integration(other.getIntegration()); - integrationSlug(other.getIntegrationSlug()); - category(other.getCategory()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - status(other.getStatus()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public Builder integration(Optional integration) { - this.integration = integration; - return this; - } - - public Builder integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) - public Builder integrationSlug(Optional integrationSlug) { - this.integrationSlug = integrationSlug; - return this; - } - - public Builder integrationSlug(String integrationSlug) { - this.integrationSlug = Optional.ofNullable(integrationSlug); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) - public Builder webhookListenerUrl(Optional webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - public Builder webhookListenerUrl(String webhookListenerUrl) { - this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); - return this; - } - - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public Builder isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - public Builder isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(String accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) - public Builder completedAt(Optional completedAt) { - this.completedAt = completedAt; - return this; - } - - public Builder completedAt(OffsetDateTime completedAt) { - this.completedAt = Optional.ofNullable(completedAt); - return this; - } - - public AccountDetails build() { - return new AccountDetails( - id, - integration, - integrationSlug, - category, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - status, - webhookListenerUrl, - isDuplicate, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActions.java deleted file mode 100644 index 27a66c422..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActions.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) -public final class AccountDetailsAndActions { - private final String id; - - private final Optional category; - - private final AccountDetailsAndActionsStatusEnum status; - - private final Optional statusDetail; - - private final Optional endUserOriginId; - - private final String endUserOrganizationName; - - private final String endUserEmailAddress; - - private final Optional subdomain; - - private final String webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional integration; - - private final String accountType; - - private final OffsetDateTime completedAt; - - private final Map additionalProperties; - - private AccountDetailsAndActions( - String id, - Optional category, - AccountDetailsAndActionsStatusEnum status, - Optional statusDetail, - Optional endUserOriginId, - String endUserOrganizationName, - String endUserEmailAddress, - Optional subdomain, - String webhookListenerUrl, - Optional isDuplicate, - Optional integration, - String accountType, - OffsetDateTime completedAt, - Map additionalProperties) { - this.id = id; - this.category = category; - this.status = status; - this.statusDetail = statusDetail; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.subdomain = subdomain; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.integration = integration; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("status") - public AccountDetailsAndActionsStatusEnum getStatus() { - return status; - } - - @JsonProperty("status_detail") - public Optional getStatusDetail() { - return statusDetail; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return The tenant or domain the customer has provided access to. - */ - @JsonProperty("subdomain") - public Optional getSubdomain() { - return subdomain; - } - - @JsonProperty("webhook_listener_url") - public String getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("account_type") - public String getAccountType() { - return accountType; - } - - @JsonProperty("completed_at") - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActions other) { - return id.equals(other.id) - && category.equals(other.category) - && status.equals(other.status) - && statusDetail.equals(other.statusDetail) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && subdomain.equals(other.subdomain) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && integration.equals(other.integration) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.category, - this.status, - this.statusDetail, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.subdomain, - this.webhookListenerUrl, - this.isDuplicate, - this.integration, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - StatusStage id(@NotNull String id); - - Builder from(AccountDetailsAndActions other); - } - - public interface StatusStage { - EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); - } - - public interface EndUserOrganizationNameStage { - EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserEmailAddressStage { - WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); - } - - public interface WebhookListenerUrlStage { - AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); - } - - public interface AccountTypeStage { - CompletedAtStage accountType(@NotNull String accountType); - } - - public interface CompletedAtStage { - _FinalStage completedAt(@NotNull OffsetDateTime completedAt); - } - - public interface _FinalStage { - AccountDetailsAndActions build(); - - _FinalStage category(Optional category); - - _FinalStage category(CategoryEnum category); - - _FinalStage statusDetail(Optional statusDetail); - - _FinalStage statusDetail(String statusDetail); - - _FinalStage endUserOriginId(Optional endUserOriginId); - - _FinalStage endUserOriginId(String endUserOriginId); - - _FinalStage subdomain(Optional subdomain); - - _FinalStage subdomain(String subdomain); - - _FinalStage isDuplicate(Optional isDuplicate); - - _FinalStage isDuplicate(Boolean isDuplicate); - - _FinalStage integration(Optional integration); - - _FinalStage integration(AccountDetailsAndActionsIntegration integration); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements IdStage, - StatusStage, - EndUserOrganizationNameStage, - EndUserEmailAddressStage, - WebhookListenerUrlStage, - AccountTypeStage, - CompletedAtStage, - _FinalStage { - private String id; - - private AccountDetailsAndActionsStatusEnum status; - - private String endUserOrganizationName; - - private String endUserEmailAddress; - - private String webhookListenerUrl; - - private String accountType; - - private OffsetDateTime completedAt; - - private Optional integration = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional subdomain = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional statusDetail = Optional.empty(); - - private Optional category = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActions other) { - id(other.getId()); - category(other.getCategory()); - status(other.getStatus()); - statusDetail(other.getStatusDetail()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - subdomain(other.getSubdomain()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - integration(other.getIntegration()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public StatusStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_email_address") - public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - @java.lang.Override - @JsonSetter("webhook_listener_url") - public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - @java.lang.Override - @JsonSetter("account_type") - public CompletedAtStage accountType(@NotNull String accountType) { - this.accountType = accountType; - return this; - } - - @java.lang.Override - @JsonSetter("completed_at") - public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - @java.lang.Override - public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public _FinalStage isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - /** - *

The tenant or domain the customer has provided access to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage subdomain(String subdomain) { - this.subdomain = Optional.ofNullable(subdomain); - return this; - } - - @java.lang.Override - @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) - public _FinalStage subdomain(Optional subdomain) { - this.subdomain = subdomain; - return this; - } - - @java.lang.Override - public _FinalStage endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public _FinalStage endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - @java.lang.Override - public _FinalStage statusDetail(String statusDetail) { - this.statusDetail = Optional.ofNullable(statusDetail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) - public _FinalStage statusDetail(Optional statusDetail) { - this.statusDetail = statusDetail; - return this; - } - - @java.lang.Override - public _FinalStage category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public _FinalStage category(Optional category) { - this.category = category; - return this; - } - - @java.lang.Override - public AccountDetailsAndActions build() { - return new AccountDetailsAndActions( - id, - category, - status, - statusDetail, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - subdomain, - webhookListenerUrl, - isDuplicate, - integration, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActionsIntegration.java deleted file mode 100644 index 307d1e46d..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActionsIntegration.java +++ /dev/null @@ -1,328 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) -public final class AccountDetailsAndActionsIntegration { - private final String name; - - private final List categories; - - private final Optional image; - - private final Optional squareImage; - - private final String color; - - private final String slug; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AccountDetailsAndActionsIntegration( - String name, - List categories, - Optional image, - Optional squareImage, - String color, - String slug, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.name = name; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - @JsonProperty("image") - public Optional getImage() { - return image; - } - - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - @JsonProperty("color") - public String getColor() { - return color; - } - - @JsonProperty("slug") - public String getSlug() { - return slug; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActionsIntegration - && equalTo((AccountDetailsAndActionsIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActionsIntegration other) { - return name.equals(other.name) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.passthroughAvailable, - this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - ColorStage name(@NotNull String name); - - Builder from(AccountDetailsAndActionsIntegration other); - } - - public interface ColorStage { - SlugStage color(@NotNull String color); - } - - public interface SlugStage { - PassthroughAvailableStage slug(@NotNull String slug); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AccountDetailsAndActionsIntegration build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { - private String name; - - private String color; - - private String slug; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActionsIntegration other) { - name(other.getName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public ColorStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("color") - public SlugStage color(@NotNull String color) { - this.color = color; - return this; - } - - @java.lang.Override - @JsonSetter("slug") - public PassthroughAvailableStage slug(@NotNull String slug) { - this.slug = slug; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public AccountDetailsAndActionsIntegration build() { - return new AccountDetailsAndActionsIntegration( - name, - categories, - image, - squareImage, - color, - slug, - passthroughAvailable, - availableModelOperations, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActionsStatusEnum.java deleted file mode 100644 index e2cf42c1f..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AccountDetailsAndActionsStatusEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AccountDetailsAndActionsStatusEnum { - COMPLETE("COMPLETE"), - - INCOMPLETE("INCOMPLETE"), - - RELINK_NEEDED("RELINK_NEEDED"), - - IDLE("IDLE"); - - private final String value; - - AccountDetailsAndActionsStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AccountIntegration.java b/src/main/java/com/merge/api/resources/filestorage/types/AccountIntegration.java deleted file mode 100644 index c00b38a50..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AccountIntegration.java +++ /dev/null @@ -1,463 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountIntegration.Builder.class) -public final class AccountIntegration { - private final String name; - - private final Optional abbreviatedName; - - private final Optional> categories; - - private final Optional image; - - private final Optional squareImage; - - private final Optional color; - - private final Optional slug; - - private final Optional> apiEndpointsToDocumentationUrls; - - private final Optional webhookSetupGuideUrl; - - private final Optional> categoryBetaStatus; - - private final Map additionalProperties; - - private AccountIntegration( - String name, - Optional abbreviatedName, - Optional> categories, - Optional image, - Optional squareImage, - Optional color, - Optional slug, - Optional> apiEndpointsToDocumentationUrls, - Optional webhookSetupGuideUrl, - Optional> categoryBetaStatus, - Map additionalProperties) { - this.name = name; - this.abbreviatedName = abbreviatedName; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - this.categoryBetaStatus = categoryBetaStatus; - this.additionalProperties = additionalProperties; - } - - /** - * @return Company name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> - */ - @JsonProperty("abbreviated_name") - public Optional getAbbreviatedName() { - return abbreviatedName; - } - - /** - * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. - */ - @JsonProperty("categories") - public Optional> getCategories() { - return categories; - } - - /** - * @return Company logo in rectangular shape. - */ - @JsonProperty("image") - public Optional getImage() { - return image; - } - - /** - * @return Company logo in square shape. - */ - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - /** - * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> - */ - @JsonProperty("color") - public Optional getColor() { - return color; - } - - @JsonProperty("slug") - public Optional getSlug() { - return slug; - } - - /** - * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} - */ - @JsonProperty("api_endpoints_to_documentation_urls") - public Optional> getApiEndpointsToDocumentationUrls() { - return apiEndpointsToDocumentationUrls; - } - - /** - * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. - */ - @JsonProperty("webhook_setup_guide_url") - public Optional getWebhookSetupGuideUrl() { - return webhookSetupGuideUrl; - } - - /** - * @return Category or categories this integration is in beta status for. - */ - @JsonProperty("category_beta_status") - public Optional> getCategoryBetaStatus() { - return categoryBetaStatus; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountIntegration && equalTo((AccountIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountIntegration other) { - return name.equals(other.name) - && abbreviatedName.equals(other.abbreviatedName) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) - && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) - && categoryBetaStatus.equals(other.categoryBetaStatus); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.abbreviatedName, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.apiEndpointsToDocumentationUrls, - this.webhookSetupGuideUrl, - this.categoryBetaStatus); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(AccountIntegration other); - } - - public interface _FinalStage { - AccountIntegration build(); - - _FinalStage abbreviatedName(Optional abbreviatedName); - - _FinalStage abbreviatedName(String abbreviatedName); - - _FinalStage categories(Optional> categories); - - _FinalStage categories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage color(Optional color); - - _FinalStage color(String color); - - _FinalStage slug(Optional slug); - - _FinalStage slug(String slug); - - _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); - - _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); - - _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); - - _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); - - _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); - - _FinalStage categoryBetaStatus(Map categoryBetaStatus); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - private Optional> categoryBetaStatus = Optional.empty(); - - private Optional webhookSetupGuideUrl = Optional.empty(); - - private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); - - private Optional slug = Optional.empty(); - - private Optional color = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private Optional> categories = Optional.empty(); - - private Optional abbreviatedName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountIntegration other) { - name(other.getName()); - abbreviatedName(other.getAbbreviatedName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); - webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); - categoryBetaStatus(other.getCategoryBetaStatus()); - return this; - } - - /** - *

Company name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

Category or categories this integration is in beta status for.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { - this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) - public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { - this.categoryBetaStatus = categoryBetaStatus; - return this; - } - - /** - *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) - public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - return this; - } - - /** - *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); - return this; - } - - @java.lang.Override - @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) - public _FinalStage apiEndpointsToDocumentationUrls( - Optional> apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - return this; - } - - @java.lang.Override - public _FinalStage slug(String slug) { - this.slug = Optional.ofNullable(slug); - return this; - } - - @java.lang.Override - @JsonSetter(value = "slug", nulls = Nulls.SKIP) - public _FinalStage slug(Optional slug) { - this.slug = slug; - return this; - } - - /** - *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage color(String color) { - this.color = Optional.ofNullable(color); - return this; - } - - @java.lang.Override - @JsonSetter(value = "color", nulls = Nulls.SKIP) - public _FinalStage color(Optional color) { - this.color = color; - return this; - } - - /** - *

Company logo in square shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - /** - *

Company logo in rectangular shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - /** - *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categories(List categories) { - this.categories = Optional.ofNullable(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(Optional> categories) { - this.categories = categories; - return this; - } - - /** - *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage abbreviatedName(String abbreviatedName) { - this.abbreviatedName = Optional.ofNullable(abbreviatedName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) - public _FinalStage abbreviatedName(Optional abbreviatedName) { - this.abbreviatedName = abbreviatedName; - return this; - } - - @java.lang.Override - public AccountIntegration build() { - return new AccountIntegration( - name, - abbreviatedName, - categories, - image, - squareImage, - color, - slug, - apiEndpointsToDocumentationUrls, - webhookSetupGuideUrl, - categoryBetaStatus, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AccountToken.java b/src/main/java/com/merge/api/resources/filestorage/types/AccountToken.java deleted file mode 100644 index d275c147f..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AccountToken.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountToken.Builder.class) -public final class AccountToken { - private final String accountToken; - - private final AccountIntegration integration; - - private final Map additionalProperties; - - private AccountToken( - String accountToken, AccountIntegration integration, Map additionalProperties) { - this.accountToken = accountToken; - this.integration = integration; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public String getAccountToken() { - return accountToken; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountToken && equalTo((AccountToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountToken other) { - return accountToken.equals(other.accountToken) && integration.equals(other.integration); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.accountToken, this.integration); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccountTokenStage builder() { - return new Builder(); - } - - public interface AccountTokenStage { - IntegrationStage accountToken(@NotNull String accountToken); - - Builder from(AccountToken other); - } - - public interface IntegrationStage { - _FinalStage integration(@NotNull AccountIntegration integration); - } - - public interface _FinalStage { - AccountToken build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountTokenStage, IntegrationStage, _FinalStage { - private String accountToken; - - private AccountIntegration integration; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountToken other) { - accountToken(other.getAccountToken()); - integration(other.getIntegration()); - return this; - } - - @java.lang.Override - @JsonSetter("account_token") - public IntegrationStage accountToken(@NotNull String accountToken) { - this.accountToken = accountToken; - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public _FinalStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - public AccountToken build() { - return new AccountToken(accountToken, integration, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AdvancedMetadata.java b/src/main/java/com/merge/api/resources/filestorage/types/AdvancedMetadata.java deleted file mode 100644 index 59289b7d7..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AdvancedMetadata.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedMetadata.Builder.class) -public final class AdvancedMetadata { - private final String id; - - private final Optional displayName; - - private final Optional description; - - private final Optional isRequired; - - private final Optional isCustom; - - private final Optional> fieldChoices; - - private final Map additionalProperties; - - private AdvancedMetadata( - String id, - Optional displayName, - Optional description, - Optional isRequired, - Optional isCustom, - Optional> fieldChoices, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.description = description; - this.isRequired = isRequired; - this.isCustom = isCustom; - this.fieldChoices = fieldChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedMetadata other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && description.equals(other.description) - && isRequired.equals(other.isRequired) - && isCustom.equals(other.isCustom) - && fieldChoices.equals(other.fieldChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - _FinalStage id(@NotNull String id); - - Builder from(AdvancedMetadata other); - } - - public interface _FinalStage { - AdvancedMetadata build(); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage description(Optional description); - - _FinalStage description(String description); - - _FinalStage isRequired(Optional isRequired); - - _FinalStage isRequired(Boolean isRequired); - - _FinalStage isCustom(Optional isCustom); - - _FinalStage isCustom(Boolean isCustom); - - _FinalStage fieldChoices(Optional> fieldChoices); - - _FinalStage fieldChoices(List fieldChoices); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, _FinalStage { - private String id; - - private Optional> fieldChoices = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedMetadata other) { - id(other.getId()); - displayName(other.getDisplayName()); - description(other.getDescription()); - isRequired(other.getIsRequired()); - isCustom(other.getIsCustom()); - fieldChoices(other.getFieldChoices()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public _FinalStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - public _FinalStage fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public _FinalStage fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - @java.lang.Override - public _FinalStage isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public _FinalStage isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - @java.lang.Override - public _FinalStage isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public _FinalStage isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - @java.lang.Override - public _FinalStage description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @java.lang.Override - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public _FinalStage description(Optional description) { - this.description = description; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - @java.lang.Override - public AdvancedMetadata build() { - return new AdvancedMetadata( - id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/resources/filestorage/types/AsyncPassthroughReciept.java deleted file mode 100644 index 5ca3d1df2..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AsyncPassthroughReciept.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) -public final class AsyncPassthroughReciept { - private final String asyncPassthroughReceiptId; - - private final Map additionalProperties; - - private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("async_passthrough_receipt_id") - public String getAsyncPassthroughReceiptId() { - return asyncPassthroughReceiptId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AsyncPassthroughReciept other) { - return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncPassthroughReceiptId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AsyncPassthroughReceiptIdStage builder() { - return new Builder(); - } - - public interface AsyncPassthroughReceiptIdStage { - _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); - - Builder from(AsyncPassthroughReciept other); - } - - public interface _FinalStage { - AsyncPassthroughReciept build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { - private String asyncPassthroughReceiptId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AsyncPassthroughReciept other) { - asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); - return this; - } - - @java.lang.Override - @JsonSetter("async_passthrough_receipt_id") - public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - return this; - } - - @java.lang.Override - public AsyncPassthroughReciept build() { - return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEvent.java b/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEvent.java deleted file mode 100644 index a8a631241..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEvent.java +++ /dev/null @@ -1,447 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditLogEvent.Builder.class) -public final class AuditLogEvent { - private final Optional id; - - private final Optional userName; - - private final Optional userEmail; - - private final AuditLogEventRole role; - - private final String ipAddress; - - private final AuditLogEventEventType eventType; - - private final String eventDescription; - - private final Optional createdAt; - - private final Map additionalProperties; - - private AuditLogEvent( - Optional id, - Optional userName, - Optional userEmail, - AuditLogEventRole role, - String ipAddress, - AuditLogEventEventType eventType, - String eventDescription, - Optional createdAt, - Map additionalProperties) { - this.id = id; - this.userName = userName; - this.userEmail = userEmail; - this.role = role; - this.ipAddress = ipAddress; - this.eventType = eventType; - this.eventDescription = eventDescription; - this.createdAt = createdAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The User's full name at the time of this Event occurring. - */ - @JsonProperty("user_name") - public Optional getUserName() { - return userName; - } - - /** - * @return The User's email at the time of this Event occurring. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - /** - * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. - *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- */ - @JsonProperty("role") - public AuditLogEventRole getRole() { - return role; - } - - @JsonProperty("ip_address") - public String getIpAddress() { - return ipAddress; - } - - /** - * @return Designates the type of event that occurred. - *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- */ - @JsonProperty("event_type") - public AuditLogEventEventType getEventType() { - return eventType; - } - - @JsonProperty("event_description") - public String getEventDescription() { - return eventDescription; - } - - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditLogEvent other) { - return id.equals(other.id) - && userName.equals(other.userName) - && userEmail.equals(other.userEmail) - && role.equals(other.role) - && ipAddress.equals(other.ipAddress) - && eventType.equals(other.eventType) - && eventDescription.equals(other.eventDescription) - && createdAt.equals(other.createdAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.userName, - this.userEmail, - this.role, - this.ipAddress, - this.eventType, - this.eventDescription, - this.createdAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RoleStage builder() { - return new Builder(); - } - - public interface RoleStage { - IpAddressStage role(@NotNull AuditLogEventRole role); - - Builder from(AuditLogEvent other); - } - - public interface IpAddressStage { - EventTypeStage ipAddress(@NotNull String ipAddress); - } - - public interface EventTypeStage { - EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); - } - - public interface EventDescriptionStage { - _FinalStage eventDescription(@NotNull String eventDescription); - } - - public interface _FinalStage { - AuditLogEvent build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage userName(Optional userName); - - _FinalStage userName(String userName); - - _FinalStage userEmail(Optional userEmail); - - _FinalStage userEmail(String userEmail); - - _FinalStage createdAt(Optional createdAt); - - _FinalStage createdAt(OffsetDateTime createdAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { - private AuditLogEventRole role; - - private String ipAddress; - - private AuditLogEventEventType eventType; - - private String eventDescription; - - private Optional createdAt = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - private Optional userName = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AuditLogEvent other) { - id(other.getId()); - userName(other.getUserName()); - userEmail(other.getUserEmail()); - role(other.getRole()); - ipAddress(other.getIpAddress()); - eventType(other.getEventType()); - eventDescription(other.getEventDescription()); - createdAt(other.getCreatedAt()); - return this; - } - - /** - *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

- *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("role") - public IpAddressStage role(@NotNull AuditLogEventRole role) { - this.role = role; - return this; - } - - @java.lang.Override - @JsonSetter("ip_address") - public EventTypeStage ipAddress(@NotNull String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - *

Designates the type of event that occurred.

- *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("event_type") - public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { - this.eventType = eventType; - return this; - } - - @java.lang.Override - @JsonSetter("event_description") - public _FinalStage eventDescription(@NotNull String eventDescription) { - this.eventDescription = eventDescription; - return this; - } - - @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public _FinalStage createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The User's email at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public _FinalStage userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - *

The User's full name at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userName(String userName) { - this.userName = Optional.ofNullable(userName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_name", nulls = Nulls.SKIP) - public _FinalStage userName(Optional userName) { - this.userName = userName; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public AuditLogEvent build() { - return new AuditLogEvent( - id, - userName, - userEmail, - role, - ipAddress, - eventType, - eventDescription, - createdAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEventEventType.java deleted file mode 100644 index 9e60a9b63..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEventEventType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) -public final class AuditLogEventEventType { - private final Object value; - - private final int type; - - private AuditLogEventEventType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EventTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); - } - - private boolean equalTo(AuditLogEventEventType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventEventType of(EventTypeEnum value) { - return new AuditLogEventEventType(value, 0); - } - - public static AuditLogEventEventType of(String value) { - return new AuditLogEventEventType(value, 1); - } - - public interface Visitor { - T visit(EventTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventEventType.class); - } - - @java.lang.Override - public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEventRole.java b/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEventRole.java deleted file mode 100644 index c4290414f..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AuditLogEventRole.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) -public final class AuditLogEventRole { - private final Object value; - - private final int type; - - private AuditLogEventRole(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RoleEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); - } - - private boolean equalTo(AuditLogEventRole other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventRole of(RoleEnum value) { - return new AuditLogEventRole(value, 0); - } - - public static AuditLogEventRole of(String value) { - return new AuditLogEventRole(value, 1); - } - - public interface Visitor { - T visit(RoleEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventRole.class); - } - - @java.lang.Override - public AuditLogEventRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/AvailableActions.java b/src/main/java/com/merge/api/resources/filestorage/types/AvailableActions.java deleted file mode 100644 index 6865141f4..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/AvailableActions.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AvailableActions.Builder.class) -public final class AvailableActions { - private final AccountIntegration integration; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AvailableActions( - AccountIntegration integration, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.integration = integration; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AvailableActions && equalTo((AvailableActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AvailableActions other) { - return integration.equals(other.integration) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IntegrationStage builder() { - return new Builder(); - } - - public interface IntegrationStage { - PassthroughAvailableStage integration(@NotNull AccountIntegration integration); - - Builder from(AvailableActions other); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AvailableActions build(); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { - private AccountIntegration integration; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AvailableActions other) { - integration(other.getIntegration()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public AvailableActions build() { - return new AvailableActions( - integration, passthroughAvailable, availableModelOperations, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/CategoriesEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/CategoriesEnum.java deleted file mode 100644 index b68a711ca..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/CategoriesEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoriesEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoriesEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/CategoryEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/CategoryEnum.java deleted file mode 100644 index 2ffc117e5..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/CategoryEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoryEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/resources/filestorage/types/CommonModelScopeApi.java deleted file mode 100644 index 273346ba3..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/CommonModelScopeApi.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) -public final class CommonModelScopeApi { - private final List commonModels; - - private final Map additionalProperties; - - private CommonModelScopeApi( - List commonModels, Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopeApi other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CommonModelScopeApi other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public CommonModelScopeApi build() { - return new CommonModelScopeApi(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/resources/filestorage/types/CommonModelScopesBodyRequest.java deleted file mode 100644 index 84275974c..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/CommonModelScopesBodyRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) -public final class CommonModelScopesBodyRequest { - private final String modelId; - - private final List enabledActions; - - private final List disabledFields; - - private final Map additionalProperties; - - private CommonModelScopesBodyRequest( - String modelId, - List enabledActions, - List disabledFields, - Map additionalProperties) { - this.modelId = modelId; - this.enabledActions = enabledActions; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("enabled_actions") - public List getEnabledActions() { - return enabledActions; - } - - @JsonProperty("disabled_fields") - public List getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopesBodyRequest other) { - return modelId.equals(other.modelId) - && enabledActions.equals(other.enabledActions) - && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelIdStage builder() { - return new Builder(); - } - - public interface ModelIdStage { - _FinalStage modelId(@NotNull String modelId); - - Builder from(CommonModelScopesBodyRequest other); - } - - public interface _FinalStage { - CommonModelScopesBodyRequest build(); - - _FinalStage enabledActions(List enabledActions); - - _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); - - _FinalStage addAllEnabledActions(List enabledActions); - - _FinalStage disabledFields(List disabledFields); - - _FinalStage addDisabledFields(String disabledFields); - - _FinalStage addAllDisabledFields(List disabledFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelIdStage, _FinalStage { - private String modelId; - - private List disabledFields = new ArrayList<>(); - - private List enabledActions = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CommonModelScopesBodyRequest other) { - modelId(other.getModelId()); - enabledActions(other.getEnabledActions()); - disabledFields(other.getDisabledFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public _FinalStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - public _FinalStage addAllDisabledFields(List disabledFields) { - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addDisabledFields(String disabledFields) { - this.disabledFields.add(disabledFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public _FinalStage disabledFields(List disabledFields) { - this.disabledFields.clear(); - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllEnabledActions(List enabledActions) { - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { - this.enabledActions.add(enabledActions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) - public _FinalStage enabledActions(List enabledActions) { - this.enabledActions.clear(); - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public CommonModelScopesBodyRequest build() { - return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/resources/filestorage/types/DataPassthroughRequest.java deleted file mode 100644 index 69d77ddfe..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/DataPassthroughRequest.java +++ /dev/null @@ -1,371 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) -public final class DataPassthroughRequest { - private final MethodEnum method; - - private final String path; - - private final Optional baseUrlOverride; - - private final Optional data; - - private final Optional> multipartFormData; - - private final Optional> headers; - - private final Optional requestFormat; - - private final Optional normalizeResponse; - - private final Map additionalProperties; - - private DataPassthroughRequest( - MethodEnum method, - String path, - Optional baseUrlOverride, - Optional data, - Optional> multipartFormData, - Optional> headers, - Optional requestFormat, - Optional normalizeResponse, - Map additionalProperties) { - this.method = method; - this.path = path; - this.baseUrlOverride = baseUrlOverride; - this.data = data; - this.multipartFormData = multipartFormData; - this.headers = headers; - this.requestFormat = requestFormat; - this.normalizeResponse = normalizeResponse; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public MethodEnum getMethod() { - return method; - } - - /** - * @return The path of the request in the third party's platform. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - /** - * @return An optional override of the third party's base url for the request. - */ - @JsonProperty("base_url_override") - public Optional getBaseUrlOverride() { - return baseUrlOverride; - } - - /** - * @return The data with the request. You must include a request_format parameter matching the data's format - */ - @JsonProperty("data") - public Optional getData() { - return data; - } - - /** - * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. - */ - @JsonProperty("multipart_form_data") - public Optional> getMultipartFormData() { - return multipartFormData; - } - - /** - * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("request_format") - public Optional getRequestFormat() { - return requestFormat; - } - - /** - * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. - */ - @JsonProperty("normalize_response") - public Optional getNormalizeResponse() { - return normalizeResponse; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DataPassthroughRequest other) { - return method.equals(other.method) - && path.equals(other.path) - && baseUrlOverride.equals(other.baseUrlOverride) - && data.equals(other.data) - && multipartFormData.equals(other.multipartFormData) - && headers.equals(other.headers) - && requestFormat.equals(other.requestFormat) - && normalizeResponse.equals(other.normalizeResponse); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.baseUrlOverride, - this.data, - this.multipartFormData, - this.headers, - this.requestFormat, - this.normalizeResponse); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull MethodEnum method); - - Builder from(DataPassthroughRequest other); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - } - - public interface _FinalStage { - DataPassthroughRequest build(); - - _FinalStage baseUrlOverride(Optional baseUrlOverride); - - _FinalStage baseUrlOverride(String baseUrlOverride); - - _FinalStage data(Optional data); - - _FinalStage data(String data); - - _FinalStage multipartFormData(Optional> multipartFormData); - - _FinalStage multipartFormData(List multipartFormData); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - - _FinalStage requestFormat(Optional requestFormat); - - _FinalStage requestFormat(RequestFormatEnum requestFormat); - - _FinalStage normalizeResponse(Optional normalizeResponse); - - _FinalStage normalizeResponse(Boolean normalizeResponse); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, _FinalStage { - private MethodEnum method; - - private String path; - - private Optional normalizeResponse = Optional.empty(); - - private Optional requestFormat = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional> multipartFormData = Optional.empty(); - - private Optional data = Optional.empty(); - - private Optional baseUrlOverride = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DataPassthroughRequest other) { - method(other.getMethod()); - path(other.getPath()); - baseUrlOverride(other.getBaseUrlOverride()); - data(other.getData()); - multipartFormData(other.getMultipartFormData()); - headers(other.getHeaders()); - requestFormat(other.getRequestFormat()); - normalizeResponse(other.getNormalizeResponse()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull MethodEnum method) { - this.method = method; - return this; - } - - /** - *

The path of the request in the third party's platform.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - /** - *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage normalizeResponse(Boolean normalizeResponse) { - this.normalizeResponse = Optional.ofNullable(normalizeResponse); - return this; - } - - @java.lang.Override - @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) - public _FinalStage normalizeResponse(Optional normalizeResponse) { - this.normalizeResponse = normalizeResponse; - return this; - } - - @java.lang.Override - public _FinalStage requestFormat(RequestFormatEnum requestFormat) { - this.requestFormat = Optional.ofNullable(requestFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_format", nulls = Nulls.SKIP) - public _FinalStage requestFormat(Optional requestFormat) { - this.requestFormat = requestFormat; - return this; - } - - /** - *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - /** - *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage multipartFormData(List multipartFormData) { - this.multipartFormData = Optional.ofNullable(multipartFormData); - return this; - } - - @java.lang.Override - @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) - public _FinalStage multipartFormData(Optional> multipartFormData) { - this.multipartFormData = multipartFormData; - return this; - } - - /** - *

The data with the request. You must include a request_format parameter matching the data's format

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage data(String data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - /** - *

An optional override of the third party's base url for the request.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage baseUrlOverride(String baseUrlOverride) { - this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); - return this; - } - - @java.lang.Override - @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) - public _FinalStage baseUrlOverride(Optional baseUrlOverride) { - this.baseUrlOverride = baseUrlOverride; - return this; - } - - @java.lang.Override - public DataPassthroughRequest build() { - return new DataPassthroughRequest( - method, - path, - baseUrlOverride, - data, - multipartFormData, - headers, - requestFormat, - normalizeResponse, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/DebugModeLog.java b/src/main/java/com/merge/api/resources/filestorage/types/DebugModeLog.java deleted file mode 100644 index 90d389766..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/DebugModeLog.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModeLog.Builder.class) -public final class DebugModeLog { - private final String logId; - - private final String dashboardView; - - private final DebugModelLogSummary logSummary; - - private final Map additionalProperties; - - private DebugModeLog( - String logId, - String dashboardView, - DebugModelLogSummary logSummary, - Map additionalProperties) { - this.logId = logId; - this.dashboardView = dashboardView; - this.logSummary = logSummary; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("log_id") - public String getLogId() { - return logId; - } - - @JsonProperty("dashboard_view") - public String getDashboardView() { - return dashboardView; - } - - @JsonProperty("log_summary") - public DebugModelLogSummary getLogSummary() { - return logSummary; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModeLog && equalTo((DebugModeLog) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModeLog other) { - return logId.equals(other.logId) - && dashboardView.equals(other.dashboardView) - && logSummary.equals(other.logSummary); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.logId, this.dashboardView, this.logSummary); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LogIdStage builder() { - return new Builder(); - } - - public interface LogIdStage { - DashboardViewStage logId(@NotNull String logId); - - Builder from(DebugModeLog other); - } - - public interface DashboardViewStage { - LogSummaryStage dashboardView(@NotNull String dashboardView); - } - - public interface LogSummaryStage { - _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); - } - - public interface _FinalStage { - DebugModeLog build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { - private String logId; - - private String dashboardView; - - private DebugModelLogSummary logSummary; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModeLog other) { - logId(other.getLogId()); - dashboardView(other.getDashboardView()); - logSummary(other.getLogSummary()); - return this; - } - - @java.lang.Override - @JsonSetter("log_id") - public DashboardViewStage logId(@NotNull String logId) { - this.logId = logId; - return this; - } - - @java.lang.Override - @JsonSetter("dashboard_view") - public LogSummaryStage dashboardView(@NotNull String dashboardView) { - this.dashboardView = dashboardView; - return this; - } - - @java.lang.Override - @JsonSetter("log_summary") - public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { - this.logSummary = logSummary; - return this; - } - - @java.lang.Override - public DebugModeLog build() { - return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/resources/filestorage/types/DebugModelLogSummary.java deleted file mode 100644 index ccf96bd22..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/DebugModelLogSummary.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) -public final class DebugModelLogSummary { - private final String url; - - private final String method; - - private final int statusCode; - - private final Map additionalProperties; - - private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { - this.url = url; - this.method = method; - this.statusCode = statusCode; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("url") - public String getUrl() { - return url; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("status_code") - public int getStatusCode() { - return statusCode; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModelLogSummary other) { - return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.url, this.method, this.statusCode); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static UrlStage builder() { - return new Builder(); - } - - public interface UrlStage { - MethodStage url(@NotNull String url); - - Builder from(DebugModelLogSummary other); - } - - public interface MethodStage { - StatusCodeStage method(@NotNull String method); - } - - public interface StatusCodeStage { - _FinalStage statusCode(int statusCode); - } - - public interface _FinalStage { - DebugModelLogSummary build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { - private String url; - - private String method; - - private int statusCode; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModelLogSummary other) { - url(other.getUrl()); - method(other.getMethod()); - statusCode(other.getStatusCode()); - return this; - } - - @java.lang.Override - @JsonSetter("url") - public MethodStage url(@NotNull String url) { - this.url = url; - return this; - } - - @java.lang.Override - @JsonSetter("method") - public StatusCodeStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("status_code") - public _FinalStage statusCode(int statusCode) { - this.statusCode = statusCode; - return this; - } - - @java.lang.Override - public DebugModelLogSummary build() { - return new DebugModelLogSummary(url, method, statusCode, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/EnabledActionsEnum.java deleted file mode 100644 index f6cca5cf0..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/EnabledActionsEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EnabledActionsEnum { - READ("READ"), - - WRITE("WRITE"); - - private final String value; - - EnabledActionsEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/EncodingEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/EncodingEnum.java deleted file mode 100644 index 6d0687781..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/EncodingEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EncodingEnum { - RAW("RAW"), - - BASE_64("BASE64"), - - GZIP_BASE_64("GZIP_BASE64"); - - private final String value; - - EncodingEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/resources/filestorage/types/ErrorValidationProblem.java deleted file mode 100644 index ddd605854..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ErrorValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) -public final class ErrorValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private ErrorValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ErrorValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(ErrorValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - ErrorValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ErrorValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public ErrorValidationProblem build() { - return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/EventTypeEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/EventTypeEnum.java deleted file mode 100644 index b199074a0..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/EventTypeEnum.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EventTypeEnum { - CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), - - DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), - - CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), - - DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), - - REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), - - INVITED_USER("INVITED_USER"), - - TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), - - TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), - - DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), - - CREATED_DESTINATION("CREATED_DESTINATION"), - - DELETED_DESTINATION("DELETED_DESTINATION"), - - CHANGED_DESTINATION("CHANGED_DESTINATION"), - - CHANGED_SCOPES("CHANGED_SCOPES"), - - CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), - - CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), - - ENABLED_INTEGRATION("ENABLED_INTEGRATION"), - - DISABLED_INTEGRATION("DISABLED_INTEGRATION"), - - ENABLED_CATEGORY("ENABLED_CATEGORY"), - - DISABLED_CATEGORY("DISABLED_CATEGORY"), - - CHANGED_PASSWORD("CHANGED_PASSWORD"), - - RESET_PASSWORD("RESET_PASSWORD"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), - - MUTED_ISSUE("MUTED_ISSUE"), - - GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), - - ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), - - DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), - - MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), - - END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); - - private final String value; - - EventTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/resources/filestorage/types/ExternalTargetFieldApi.java deleted file mode 100644 index 87641e254..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ExternalTargetFieldApi.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) -public final class ExternalTargetFieldApi { - private final Optional name; - - private final Optional description; - - private final Optional isMapped; - - private final Map additionalProperties; - - private ExternalTargetFieldApi( - Optional name, - Optional description, - Optional isMapped, - Map additionalProperties) { - this.name = name; - this.description = description; - this.isMapped = isMapped; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_mapped") - public Optional getIsMapped() { - return isMapped; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApi other) { - return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isMapped); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isMapped = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApi other) { - name(other.getName()); - description(other.getDescription()); - isMapped(other.getIsMapped()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) - public Builder isMapped(Optional isMapped) { - this.isMapped = isMapped; - return this; - } - - public Builder isMapped(String isMapped) { - this.isMapped = Optional.ofNullable(isMapped); - return this; - } - - public ExternalTargetFieldApi build() { - return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/resources/filestorage/types/ExternalTargetFieldApiResponse.java deleted file mode 100644 index c8cecda03..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ExternalTargetFieldApiResponse.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) -public final class ExternalTargetFieldApiResponse { - private final Optional> file; - - private final Optional> folder; - - private final Optional> drive; - - private final Optional> group; - - private final Optional> user; - - private final Map additionalProperties; - - private ExternalTargetFieldApiResponse( - Optional> file, - Optional> folder, - Optional> drive, - Optional> group, - Optional> user, - Map additionalProperties) { - this.file = file; - this.folder = folder; - this.drive = drive; - this.group = group; - this.user = user; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("File") - public Optional> getFile() { - return file; - } - - @JsonProperty("Folder") - public Optional> getFolder() { - return folder; - } - - @JsonProperty("Drive") - public Optional> getDrive() { - return drive; - } - - @JsonProperty("Group") - public Optional> getGroup() { - return group; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApiResponse other) { - return file.equals(other.file) - && folder.equals(other.folder) - && drive.equals(other.drive) - && group.equals(other.group) - && user.equals(other.user); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> file = Optional.empty(); - - private Optional> folder = Optional.empty(); - - private Optional> drive = Optional.empty(); - - private Optional> group = Optional.empty(); - - private Optional> user = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApiResponse other) { - file(other.getFile()); - folder(other.getFolder()); - drive(other.getDrive()); - group(other.getGroup()); - user(other.getUser()); - return this; - } - - @JsonSetter(value = "File", nulls = Nulls.SKIP) - public Builder file(Optional> file) { - this.file = file; - return this; - } - - public Builder file(List file) { - this.file = Optional.ofNullable(file); - return this; - } - - @JsonSetter(value = "Folder", nulls = Nulls.SKIP) - public Builder folder(Optional> folder) { - this.folder = folder; - return this; - } - - public Builder folder(List folder) { - this.folder = Optional.ofNullable(folder); - return this; - } - - @JsonSetter(value = "Drive", nulls = Nulls.SKIP) - public Builder drive(Optional> drive) { - this.drive = drive; - return this; - } - - public Builder drive(List drive) { - this.drive = Optional.ofNullable(drive); - return this; - } - - @JsonSetter(value = "Group", nulls = Nulls.SKIP) - public Builder group(Optional> group) { - this.group = group; - return this; - } - - public Builder group(List group) { - this.group = Optional.ofNullable(group); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - public ExternalTargetFieldApiResponse build() { - return new ExternalTargetFieldApiResponse(file, folder, drive, group, user, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstance.java deleted file mode 100644 index 71114c2e6..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstance.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) -public final class FieldMappingApiInstance { - private final Optional id; - - private final Optional isIntegrationWide; - - private final Optional targetField; - - private final Optional remoteField; - - private final Map additionalProperties; - - private FieldMappingApiInstance( - Optional id, - Optional isIntegrationWide, - Optional targetField, - Optional remoteField, - Map additionalProperties) { - this.id = id; - this.isIntegrationWide = isIntegrationWide; - this.targetField = targetField; - this.remoteField = remoteField; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("is_integration_wide") - public Optional getIsIntegrationWide() { - return isIntegrationWide; - } - - @JsonProperty("target_field") - public Optional getTargetField() { - return targetField; - } - - @JsonProperty("remote_field") - public Optional getRemoteField() { - return remoteField; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstance other) { - return id.equals(other.id) - && isIntegrationWide.equals(other.isIntegrationWide) - && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional isIntegrationWide = Optional.empty(); - - private Optional targetField = Optional.empty(); - - private Optional remoteField = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstance other) { - id(other.getId()); - isIntegrationWide(other.getIsIntegrationWide()); - targetField(other.getTargetField()); - remoteField(other.getRemoteField()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) - public Builder isIntegrationWide(Optional isIntegrationWide) { - this.isIntegrationWide = isIntegrationWide; - return this; - } - - public Builder isIntegrationWide(Boolean isIntegrationWide) { - this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); - return this; - } - - @JsonSetter(value = "target_field", nulls = Nulls.SKIP) - public Builder targetField(Optional targetField) { - this.targetField = targetField; - return this; - } - - public Builder targetField(FieldMappingApiInstanceTargetField targetField) { - this.targetField = Optional.ofNullable(targetField); - return this; - } - - @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) - public Builder remoteField(Optional remoteField) { - this.remoteField = remoteField; - return this; - } - - public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { - this.remoteField = Optional.ofNullable(remoteField); - return this; - } - - public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceRemoteField.java deleted file mode 100644 index f863bec58..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceRemoteField.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) -public final class FieldMappingApiInstanceRemoteField { - private final Optional remoteKeyName; - - private final Optional> schema; - - private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteField( - Optional remoteKeyName, - Optional> schema, - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, - Map additionalProperties) { - this.remoteKeyName = remoteKeyName; - this.schema = schema; - this.remoteEndpointInfo = remoteEndpointInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("schema") - public Optional> getSchema() { - return schema; - } - - @JsonProperty("remote_endpoint_info") - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteField - && equalTo((FieldMappingApiInstanceRemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteField other) { - return remoteKeyName.equals(other.remoteKeyName) - && schema.equals(other.schema) - && remoteEndpointInfo.equals(other.remoteEndpointInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteEndpointInfoStage builder() { - return new Builder(); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); - - Builder from(FieldMappingApiInstanceRemoteField other); - } - - public interface _FinalStage { - FieldMappingApiInstanceRemoteField build(); - - _FinalStage remoteKeyName(Optional remoteKeyName); - - _FinalStage remoteKeyName(String remoteKeyName); - - _FinalStage schema(Optional> schema); - - _FinalStage schema(Map schema); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private Optional> schema = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceRemoteField other) { - remoteKeyName(other.getRemoteKeyName()); - schema(other.getSchema()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage schema(Map schema) { - this.schema = Optional.ofNullable(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Optional> schema) { - this.schema = schema; - return this; - } - - @java.lang.Override - public _FinalStage remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public _FinalStage remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceRemoteField build() { - return new FieldMappingApiInstanceRemoteField( - remoteKeyName, schema, remoteEndpointInfo, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java deleted file mode 100644 index 68fbe7fb1..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) -public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { - private final Optional method; - - private final Optional urlPath; - - private final Optional> fieldTraversalPath; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - Optional method, - Optional urlPath, - Optional> fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public Optional getMethod() { - return method; - } - - @JsonProperty("url_path") - public Optional getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public Optional> getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional method = Optional.empty(); - - private Optional urlPath = Optional.empty(); - - private Optional> fieldTraversalPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @JsonSetter(value = "method", nulls = Nulls.SKIP) - public Builder method(Optional method) { - this.method = method; - return this; - } - - public Builder method(String method) { - this.method = Optional.ofNullable(method); - return this; - } - - @JsonSetter(value = "url_path", nulls = Nulls.SKIP) - public Builder urlPath(Optional urlPath) { - this.urlPath = urlPath; - return this; - } - - public Builder urlPath(String urlPath) { - this.urlPath = Optional.ofNullable(urlPath); - return this; - } - - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public Builder fieldTraversalPath(Optional> fieldTraversalPath) { - this.fieldTraversalPath = fieldTraversalPath; - return this; - } - - public Builder fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); - return this; - } - - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { - return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceResponse.java deleted file mode 100644 index 7438196df..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceResponse.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) -public final class FieldMappingApiInstanceResponse { - private final Optional> file; - - private final Optional> folder; - - private final Optional> drive; - - private final Optional> group; - - private final Optional> user; - - private final Map additionalProperties; - - private FieldMappingApiInstanceResponse( - Optional> file, - Optional> folder, - Optional> drive, - Optional> group, - Optional> user, - Map additionalProperties) { - this.file = file; - this.folder = folder; - this.drive = drive; - this.group = group; - this.user = user; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("File") - public Optional> getFile() { - return file; - } - - @JsonProperty("Folder") - public Optional> getFolder() { - return folder; - } - - @JsonProperty("Drive") - public Optional> getDrive() { - return drive; - } - - @JsonProperty("Group") - public Optional> getGroup() { - return group; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceResponse other) { - return file.equals(other.file) - && folder.equals(other.folder) - && drive.equals(other.drive) - && group.equals(other.group) - && user.equals(other.user); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> file = Optional.empty(); - - private Optional> folder = Optional.empty(); - - private Optional> drive = Optional.empty(); - - private Optional> group = Optional.empty(); - - private Optional> user = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceResponse other) { - file(other.getFile()); - folder(other.getFolder()); - drive(other.getDrive()); - group(other.getGroup()); - user(other.getUser()); - return this; - } - - @JsonSetter(value = "File", nulls = Nulls.SKIP) - public Builder file(Optional> file) { - this.file = file; - return this; - } - - public Builder file(List file) { - this.file = Optional.ofNullable(file); - return this; - } - - @JsonSetter(value = "Folder", nulls = Nulls.SKIP) - public Builder folder(Optional> folder) { - this.folder = folder; - return this; - } - - public Builder folder(List folder) { - this.folder = Optional.ofNullable(folder); - return this; - } - - @JsonSetter(value = "Drive", nulls = Nulls.SKIP) - public Builder drive(Optional> drive) { - this.drive = drive; - return this; - } - - public Builder drive(List drive) { - this.drive = Optional.ofNullable(drive); - return this; - } - - @JsonSetter(value = "Group", nulls = Nulls.SKIP) - public Builder group(Optional> group) { - this.group = group; - return this; - } - - public Builder group(List group) { - this.group = Optional.ofNullable(group); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - public FieldMappingApiInstanceResponse build() { - return new FieldMappingApiInstanceResponse(file, folder, drive, group, user, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceTargetField.java deleted file mode 100644 index ec4625e0e..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingApiInstanceTargetField.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) -public final class FieldMappingApiInstanceTargetField { - private final String name; - - private final String description; - - private final boolean isOrganizationWide; - - private final Map additionalProperties; - - private FieldMappingApiInstanceTargetField( - String name, String description, boolean isOrganizationWide, Map additionalProperties) { - this.name = name; - this.description = description; - this.isOrganizationWide = isOrganizationWide; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("is_organization_wide") - public boolean getIsOrganizationWide() { - return isOrganizationWide; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceTargetField - && equalTo((FieldMappingApiInstanceTargetField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceTargetField other) { - return name.equals(other.name) - && description.equals(other.description) - && isOrganizationWide == other.isOrganizationWide; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isOrganizationWide); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DescriptionStage name(@NotNull String name); - - Builder from(FieldMappingApiInstanceTargetField other); - } - - public interface DescriptionStage { - IsOrganizationWideStage description(@NotNull String description); - } - - public interface IsOrganizationWideStage { - _FinalStage isOrganizationWide(boolean isOrganizationWide); - } - - public interface _FinalStage { - FieldMappingApiInstanceTargetField build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { - private String name; - - private String description; - - private boolean isOrganizationWide; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceTargetField other) { - name(other.getName()); - description(other.getDescription()); - isOrganizationWide(other.getIsOrganizationWide()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public DescriptionStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("description") - public IsOrganizationWideStage description(@NotNull String description) { - this.description = description; - return this; - } - - @java.lang.Override - @JsonSetter("is_organization_wide") - public _FinalStage isOrganizationWide(boolean isOrganizationWide) { - this.isOrganizationWide = isOrganizationWide; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceTargetField build() { - return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingInstanceResponse.java deleted file mode 100644 index 20b12661f..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldMappingInstanceResponse.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) -public final class FieldMappingInstanceResponse { - private final FieldMappingApiInstance model; - - private final List warnings; - - private final List errors; - - private final Optional> logs; - - private final Map additionalProperties; - - private FieldMappingInstanceResponse( - FieldMappingApiInstance model, - List warnings, - List errors, - Optional> logs, - Map additionalProperties) { - this.model = model; - this.warnings = warnings; - this.errors = errors; - this.logs = logs; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model") - public FieldMappingApiInstance getModel() { - return model; - } - - @JsonProperty("warnings") - public List getWarnings() { - return warnings; - } - - @JsonProperty("errors") - public List getErrors() { - return errors; - } - - @JsonProperty("logs") - public Optional> getLogs() { - return logs; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingInstanceResponse other) { - return model.equals(other.model) - && warnings.equals(other.warnings) - && errors.equals(other.errors) - && logs.equals(other.logs); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.warnings, this.errors, this.logs); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelStage builder() { - return new Builder(); - } - - public interface ModelStage { - _FinalStage model(@NotNull FieldMappingApiInstance model); - - Builder from(FieldMappingInstanceResponse other); - } - - public interface _FinalStage { - FieldMappingInstanceResponse build(); - - _FinalStage warnings(List warnings); - - _FinalStage addWarnings(WarningValidationProblem warnings); - - _FinalStage addAllWarnings(List warnings); - - _FinalStage errors(List errors); - - _FinalStage addErrors(ErrorValidationProblem errors); - - _FinalStage addAllErrors(List errors); - - _FinalStage logs(Optional> logs); - - _FinalStage logs(List logs); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelStage, _FinalStage { - private FieldMappingApiInstance model; - - private Optional> logs = Optional.empty(); - - private List errors = new ArrayList<>(); - - private List warnings = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingInstanceResponse other) { - model(other.getModel()); - warnings(other.getWarnings()); - errors(other.getErrors()); - logs(other.getLogs()); - return this; - } - - @java.lang.Override - @JsonSetter("model") - public _FinalStage model(@NotNull FieldMappingApiInstance model) { - this.model = model; - return this; - } - - @java.lang.Override - public _FinalStage logs(List logs) { - this.logs = Optional.ofNullable(logs); - return this; - } - - @java.lang.Override - @JsonSetter(value = "logs", nulls = Nulls.SKIP) - public _FinalStage logs(Optional> logs) { - this.logs = logs; - return this; - } - - @java.lang.Override - public _FinalStage addAllErrors(List errors) { - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addErrors(ErrorValidationProblem errors) { - this.errors.add(errors); - return this; - } - - @java.lang.Override - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public _FinalStage errors(List errors) { - this.errors.clear(); - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addAllWarnings(List warnings) { - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public _FinalStage addWarnings(WarningValidationProblem warnings) { - this.warnings.add(warnings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public _FinalStage warnings(List warnings) { - this.warnings.clear(); - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public FieldMappingInstanceResponse build() { - return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldPermissionDeserializer.java deleted file mode 100644 index 5e6143022..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldPermissionDeserializer.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) -public final class FieldPermissionDeserializer { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializer( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializer other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializer other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializer build() { - return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/filestorage/types/FieldPermissionDeserializerRequest.java deleted file mode 100644 index f3579fe46..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/FieldPermissionDeserializerRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) -public final class FieldPermissionDeserializerRequest { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializerRequest( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializerRequest - && equalTo((FieldPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializerRequest other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializerRequest other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializerRequest build() { - return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/Group.java b/src/main/java/com/merge/api/resources/filestorage/types/Group.java deleted file mode 100644 index 8dff8e855..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/Group.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Group.Builder.class) -public final class Group { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final List users; - - private final Optional> childGroups; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Group( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - List users, - Optional> childGroups, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.users = users; - this.childGroups = childGroups; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The group's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The users that belong in the group. If null, this typically means it's either a domain or the third-party platform does not surface this information. - */ - @JsonProperty("users") - public List getUsers() { - return users; - } - - /** - * @return Groups that inherit the permissions of the parent group. - */ - @JsonProperty("child_groups") - public Optional> getChildGroups() { - return childGroups; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Group && equalTo((Group) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Group other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && users.equals(other.users) - && childGroups.equals(other.childGroups) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.users, - this.childGroups, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private List users = new ArrayList<>(); - - private Optional> childGroups = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Group other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - users(other.getUsers()); - childGroups(other.getChildGroups()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "users", nulls = Nulls.SKIP) - public Builder users(List users) { - this.users.clear(); - this.users.addAll(users); - return this; - } - - public Builder addUsers(String users) { - this.users.add(users); - return this; - } - - public Builder addAllUsers(List users) { - this.users.addAll(users); - return this; - } - - @JsonSetter(value = "child_groups", nulls = Nulls.SKIP) - public Builder childGroups(Optional> childGroups) { - this.childGroups = childGroups; - return this; - } - - public Builder childGroups(List childGroups) { - this.childGroups = Optional.ofNullable(childGroups); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Group build() { - return new Group( - id, - remoteId, - createdAt, - modifiedAt, - name, - users, - childGroups, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/resources/filestorage/types/IndividualCommonModelScopeDeserializer.java deleted file mode 100644 index 5fd34e25c..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/IndividualCommonModelScopeDeserializer.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) -public final class IndividualCommonModelScopeDeserializer { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializer( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializer - && equalTo((IndividualCommonModelScopeDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializer other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializer other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializer build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializer other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions(Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializer build() { - return new IndividualCommonModelScopeDeserializer( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 3bd1c5aa0..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/IndividualCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) -public final class IndividualCommonModelScopeDeserializerRequest { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializerRequest( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializerRequest - && equalTo((IndividualCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializerRequest other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializerRequest build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializerRequest other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions( - Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializerRequest build() { - return new IndividualCommonModelScopeDeserializerRequest( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/Issue.java b/src/main/java/com/merge/api/resources/filestorage/types/Issue.java deleted file mode 100644 index 1dcd8706f..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/Issue.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Issue.Builder.class) -public final class Issue { - private final Optional id; - - private final Optional status; - - private final String errorDescription; - - private final Optional> endUser; - - private final Optional firstIncidentTime; - - private final Optional lastIncidentTime; - - private final Optional isMuted; - - private final Optional> errorDetails; - - private final Map additionalProperties; - - private Issue( - Optional id, - Optional status, - String errorDescription, - Optional> endUser, - Optional firstIncidentTime, - Optional lastIncidentTime, - Optional isMuted, - Optional> errorDetails, - Map additionalProperties) { - this.id = id; - this.status = status; - this.errorDescription = errorDescription; - this.endUser = endUser; - this.firstIncidentTime = firstIncidentTime; - this.lastIncidentTime = lastIncidentTime; - this.isMuted = isMuted; - this.errorDetails = errorDetails; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("error_description") - public String getErrorDescription() { - return errorDescription; - } - - @JsonProperty("end_user") - public Optional> getEndUser() { - return endUser; - } - - @JsonProperty("first_incident_time") - public Optional getFirstIncidentTime() { - return firstIncidentTime; - } - - @JsonProperty("last_incident_time") - public Optional getLastIncidentTime() { - return lastIncidentTime; - } - - @JsonProperty("is_muted") - public Optional getIsMuted() { - return isMuted; - } - - @JsonProperty("error_details") - public Optional> getErrorDetails() { - return errorDetails; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Issue && equalTo((Issue) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Issue other) { - return id.equals(other.id) - && status.equals(other.status) - && errorDescription.equals(other.errorDescription) - && endUser.equals(other.endUser) - && firstIncidentTime.equals(other.firstIncidentTime) - && lastIncidentTime.equals(other.lastIncidentTime) - && isMuted.equals(other.isMuted) - && errorDetails.equals(other.errorDetails); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.status, - this.errorDescription, - this.endUser, - this.firstIncidentTime, - this.lastIncidentTime, - this.isMuted, - this.errorDetails); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ErrorDescriptionStage builder() { - return new Builder(); - } - - public interface ErrorDescriptionStage { - _FinalStage errorDescription(@NotNull String errorDescription); - - Builder from(Issue other); - } - - public interface _FinalStage { - Issue build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage status(Optional status); - - _FinalStage status(IssueStatus status); - - _FinalStage endUser(Optional> endUser); - - _FinalStage endUser(Map endUser); - - _FinalStage firstIncidentTime(Optional firstIncidentTime); - - _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); - - _FinalStage lastIncidentTime(Optional lastIncidentTime); - - _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); - - _FinalStage isMuted(Optional isMuted); - - _FinalStage isMuted(Boolean isMuted); - - _FinalStage errorDetails(Optional> errorDetails); - - _FinalStage errorDetails(List errorDetails); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ErrorDescriptionStage, _FinalStage { - private String errorDescription; - - private Optional> errorDetails = Optional.empty(); - - private Optional isMuted = Optional.empty(); - - private Optional lastIncidentTime = Optional.empty(); - - private Optional firstIncidentTime = Optional.empty(); - - private Optional> endUser = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Issue other) { - id(other.getId()); - status(other.getStatus()); - errorDescription(other.getErrorDescription()); - endUser(other.getEndUser()); - firstIncidentTime(other.getFirstIncidentTime()); - lastIncidentTime(other.getLastIncidentTime()); - isMuted(other.getIsMuted()); - errorDetails(other.getErrorDetails()); - return this; - } - - @java.lang.Override - @JsonSetter("error_description") - public _FinalStage errorDescription(@NotNull String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - @java.lang.Override - public _FinalStage errorDetails(List errorDetails) { - this.errorDetails = Optional.ofNullable(errorDetails); - return this; - } - - @java.lang.Override - @JsonSetter(value = "error_details", nulls = Nulls.SKIP) - public _FinalStage errorDetails(Optional> errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - @java.lang.Override - public _FinalStage isMuted(Boolean isMuted) { - this.isMuted = Optional.ofNullable(isMuted); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) - public _FinalStage isMuted(Optional isMuted) { - this.isMuted = isMuted; - return this; - } - - @java.lang.Override - public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { - this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) - public _FinalStage lastIncidentTime(Optional lastIncidentTime) { - this.lastIncidentTime = lastIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { - this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) - public _FinalStage firstIncidentTime(Optional firstIncidentTime) { - this.firstIncidentTime = firstIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage endUser(Map endUser) { - this.endUser = Optional.ofNullable(endUser); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user", nulls = Nulls.SKIP) - public _FinalStage endUser(Optional> endUser) { - this.endUser = endUser; - return this; - } - - /** - *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

- *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage status(IssueStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public Issue build() { - return new Issue( - id, - status, - errorDescription, - endUser, - firstIncidentTime, - lastIncidentTime, - isMuted, - errorDetails, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/IssueStatus.java b/src/main/java/com/merge/api/resources/filestorage/types/IssueStatus.java deleted file mode 100644 index 80fb54a0b..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/IssueStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IssueStatus.Deserializer.class) -public final class IssueStatus { - private final Object value; - - private final int type; - - private IssueStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((IssueStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssueStatus && equalTo((IssueStatus) other); - } - - private boolean equalTo(IssueStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IssueStatus of(IssueStatusEnum value) { - return new IssueStatus(value, 0); - } - - public static IssueStatus of(String value) { - return new IssueStatus(value, 1); - } - - public interface Visitor { - T visit(IssueStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IssueStatus.class); - } - - @java.lang.Override - public IssueStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/IssueStatusEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/IssueStatusEnum.java deleted file mode 100644 index 16a88a43c..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/IssueStatusEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssueStatusEnum { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssueStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/LanguageEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/LanguageEnum.java deleted file mode 100644 index 94b0419f7..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/LanguageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LanguageEnum { - EN("en"), - - DE("de"); - - private final String value; - - LanguageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/LinkToken.java b/src/main/java/com/merge/api/resources/filestorage/types/LinkToken.java deleted file mode 100644 index 0ba7623bb..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/LinkToken.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkToken.Builder.class) -public final class LinkToken { - private final String linkToken; - - private final Optional integrationName; - - private final Optional magicLinkUrl; - - private final Map additionalProperties; - - private LinkToken( - String linkToken, - Optional integrationName, - Optional magicLinkUrl, - Map additionalProperties) { - this.linkToken = linkToken; - this.integrationName = integrationName; - this.magicLinkUrl = magicLinkUrl; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("link_token") - public String getLinkToken() { - return linkToken; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - @JsonProperty("magic_link_url") - public Optional getMagicLinkUrl() { - return magicLinkUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkToken && equalTo((LinkToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkToken other) { - return linkToken.equals(other.linkToken) - && integrationName.equals(other.integrationName) - && magicLinkUrl.equals(other.magicLinkUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkTokenStage builder() { - return new Builder(); - } - - public interface LinkTokenStage { - _FinalStage linkToken(@NotNull String linkToken); - - Builder from(LinkToken other); - } - - public interface _FinalStage { - LinkToken build(); - - _FinalStage integrationName(Optional integrationName); - - _FinalStage integrationName(String integrationName); - - _FinalStage magicLinkUrl(Optional magicLinkUrl); - - _FinalStage magicLinkUrl(String magicLinkUrl); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkTokenStage, _FinalStage { - private String linkToken; - - private Optional magicLinkUrl = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkToken other) { - linkToken(other.getLinkToken()); - integrationName(other.getIntegrationName()); - magicLinkUrl(other.getMagicLinkUrl()); - return this; - } - - @java.lang.Override - @JsonSetter("link_token") - public _FinalStage linkToken(@NotNull String linkToken) { - this.linkToken = linkToken; - return this; - } - - @java.lang.Override - public _FinalStage magicLinkUrl(String magicLinkUrl) { - this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) - public _FinalStage magicLinkUrl(Optional magicLinkUrl) { - this.magicLinkUrl = magicLinkUrl; - return this; - } - - @java.lang.Override - public _FinalStage integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public _FinalStage integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - @java.lang.Override - public LinkToken build() { - return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/resources/filestorage/types/LinkedAccountStatus.java deleted file mode 100644 index 6622fd700..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/LinkedAccountStatus.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) -public final class LinkedAccountStatus { - private final String linkedAccountStatus; - - private final boolean canMakeRequest; - - private final Map additionalProperties; - - private LinkedAccountStatus( - String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { - this.linkedAccountStatus = linkedAccountStatus; - this.canMakeRequest = canMakeRequest; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("linked_account_status") - public String getLinkedAccountStatus() { - return linkedAccountStatus; - } - - @JsonProperty("can_make_request") - public boolean getCanMakeRequest() { - return canMakeRequest; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountStatus other) { - return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkedAccountStatusStage builder() { - return new Builder(); - } - - public interface LinkedAccountStatusStage { - CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); - - Builder from(LinkedAccountStatus other); - } - - public interface CanMakeRequestStage { - _FinalStage canMakeRequest(boolean canMakeRequest); - } - - public interface _FinalStage { - LinkedAccountStatus build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { - private String linkedAccountStatus; - - private boolean canMakeRequest; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkedAccountStatus other) { - linkedAccountStatus(other.getLinkedAccountStatus()); - canMakeRequest(other.getCanMakeRequest()); - return this; - } - - @java.lang.Override - @JsonSetter("linked_account_status") - public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { - this.linkedAccountStatus = linkedAccountStatus; - return this; - } - - @java.lang.Override - @JsonSetter("can_make_request") - public _FinalStage canMakeRequest(boolean canMakeRequest) { - this.canMakeRequest = canMakeRequest; - return this; - } - - @java.lang.Override - public LinkedAccountStatus build() { - return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/MetaResponse.java b/src/main/java/com/merge/api/resources/filestorage/types/MetaResponse.java deleted file mode 100644 index e3699b18e..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/MetaResponse.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MetaResponse.Builder.class) -public final class MetaResponse { - private final Map requestSchema; - - private final Optional> remoteFieldClasses; - - private final Optional status; - - private final boolean hasConditionalParams; - - private final boolean hasRequiredLinkedAccountParams; - - private final Map additionalProperties; - - private MetaResponse( - Map requestSchema, - Optional> remoteFieldClasses, - Optional status, - boolean hasConditionalParams, - boolean hasRequiredLinkedAccountParams, - Map additionalProperties) { - this.requestSchema = requestSchema; - this.remoteFieldClasses = remoteFieldClasses; - this.status = status; - this.hasConditionalParams = hasConditionalParams; - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("request_schema") - public Map getRequestSchema() { - return requestSchema; - } - - @JsonProperty("remote_field_classes") - public Optional> getRemoteFieldClasses() { - return remoteFieldClasses; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("has_conditional_params") - public boolean getHasConditionalParams() { - return hasConditionalParams; - } - - @JsonProperty("has_required_linked_account_params") - public boolean getHasRequiredLinkedAccountParams() { - return hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MetaResponse && equalTo((MetaResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MetaResponse other) { - return requestSchema.equals(other.requestSchema) - && remoteFieldClasses.equals(other.remoteFieldClasses) - && status.equals(other.status) - && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.requestSchema, - this.remoteFieldClasses, - this.status, - this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static HasConditionalParamsStage builder() { - return new Builder(); - } - - public interface HasConditionalParamsStage { - HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); - - Builder from(MetaResponse other); - } - - public interface HasRequiredLinkedAccountParamsStage { - _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); - } - - public interface _FinalStage { - MetaResponse build(); - - _FinalStage requestSchema(Map requestSchema); - - _FinalStage putAllRequestSchema(Map requestSchema); - - _FinalStage requestSchema(String key, JsonNode value); - - _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); - - _FinalStage remoteFieldClasses(Map remoteFieldClasses); - - _FinalStage status(Optional status); - - _FinalStage status(LinkedAccountStatus status); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { - private boolean hasConditionalParams; - - private boolean hasRequiredLinkedAccountParams; - - private Optional status = Optional.empty(); - - private Optional> remoteFieldClasses = Optional.empty(); - - private Map requestSchema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MetaResponse other) { - requestSchema(other.getRequestSchema()); - remoteFieldClasses(other.getRemoteFieldClasses()); - status(other.getStatus()); - hasConditionalParams(other.getHasConditionalParams()); - hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); - return this; - } - - @java.lang.Override - @JsonSetter("has_conditional_params") - public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { - this.hasConditionalParams = hasConditionalParams; - return this; - } - - @java.lang.Override - @JsonSetter("has_required_linked_account_params") - public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - return this; - } - - @java.lang.Override - public _FinalStage status(LinkedAccountStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { - this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) - public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { - this.remoteFieldClasses = remoteFieldClasses; - return this; - } - - @java.lang.Override - public _FinalStage requestSchema(String key, JsonNode value) { - this.requestSchema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllRequestSchema(Map requestSchema) { - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) - public _FinalStage requestSchema(Map requestSchema) { - this.requestSchema.clear(); - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - public MetaResponse build() { - return new MetaResponse( - requestSchema, - remoteFieldClasses, - status, - hasConditionalParams, - hasRequiredLinkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/MethodEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/MethodEnum.java deleted file mode 100644 index bbb4d1f18..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/MethodEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum MethodEnum { - GET("GET"), - - OPTIONS("OPTIONS"), - - HEAD("HEAD"), - - POST("POST"), - - PUT("PUT"), - - PATCH("PATCH"), - - DELETE("DELETE"); - - private final String value; - - MethodEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ModelOperation.java b/src/main/java/com/merge/api/resources/filestorage/types/ModelOperation.java deleted file mode 100644 index e47821240..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ModelOperation.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelOperation.Builder.class) -public final class ModelOperation { - private final String modelName; - - private final List availableOperations; - - private final List requiredPostParameters; - - private final List supportedFields; - - private final Map additionalProperties; - - private ModelOperation( - String modelName, - List availableOperations, - List requiredPostParameters, - List supportedFields, - Map additionalProperties) { - this.modelName = modelName; - this.availableOperations = availableOperations; - this.requiredPostParameters = requiredPostParameters; - this.supportedFields = supportedFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("available_operations") - public List getAvailableOperations() { - return availableOperations; - } - - @JsonProperty("required_post_parameters") - public List getRequiredPostParameters() { - return requiredPostParameters; - } - - @JsonProperty("supported_fields") - public List getSupportedFields() { - return supportedFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelOperation && equalTo((ModelOperation) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelOperation other) { - return modelName.equals(other.modelName) - && availableOperations.equals(other.availableOperations) - && requiredPostParameters.equals(other.requiredPostParameters) - && supportedFields.equals(other.supportedFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(ModelOperation other); - } - - public interface _FinalStage { - ModelOperation build(); - - _FinalStage availableOperations(List availableOperations); - - _FinalStage addAvailableOperations(String availableOperations); - - _FinalStage addAllAvailableOperations(List availableOperations); - - _FinalStage requiredPostParameters(List requiredPostParameters); - - _FinalStage addRequiredPostParameters(String requiredPostParameters); - - _FinalStage addAllRequiredPostParameters(List requiredPostParameters); - - _FinalStage supportedFields(List supportedFields); - - _FinalStage addSupportedFields(String supportedFields); - - _FinalStage addAllSupportedFields(List supportedFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private List supportedFields = new ArrayList<>(); - - private List requiredPostParameters = new ArrayList<>(); - - private List availableOperations = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ModelOperation other) { - modelName(other.getModelName()); - availableOperations(other.getAvailableOperations()); - requiredPostParameters(other.getRequiredPostParameters()); - supportedFields(other.getSupportedFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage addAllSupportedFields(List supportedFields) { - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addSupportedFields(String supportedFields) { - this.supportedFields.add(supportedFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) - public _FinalStage supportedFields(List supportedFields) { - this.supportedFields.clear(); - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addRequiredPostParameters(String requiredPostParameters) { - this.requiredPostParameters.add(requiredPostParameters); - return this; - } - - @java.lang.Override - @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) - public _FinalStage requiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.clear(); - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addAllAvailableOperations(List availableOperations) { - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public _FinalStage addAvailableOperations(String availableOperations) { - this.availableOperations.add(availableOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) - public _FinalStage availableOperations(List availableOperations) { - this.availableOperations.clear(); - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public ModelOperation build() { - return new ModelOperation( - modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/resources/filestorage/types/ModelPermissionDeserializer.java deleted file mode 100644 index 7317bdbb6..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ModelPermissionDeserializer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) -public final class ModelPermissionDeserializer { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializer other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializer other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializer build() { - return new ModelPermissionDeserializer(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/filestorage/types/ModelPermissionDeserializerRequest.java deleted file mode 100644 index 576b58e3a..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ModelPermissionDeserializerRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) -public final class ModelPermissionDeserializerRequest { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializerRequest - && equalTo((ModelPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializerRequest other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializerRequest other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializerRequest build() { - return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/resources/filestorage/types/MultipartFormFieldRequest.java deleted file mode 100644 index b982e3d76..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/MultipartFormFieldRequest.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) -public final class MultipartFormFieldRequest { - private final String name; - - private final String data; - - private final Optional encoding; - - private final Optional fileName; - - private final Optional contentType; - - private final Map additionalProperties; - - private MultipartFormFieldRequest( - String name, - String data, - Optional encoding, - Optional fileName, - Optional contentType, - Map additionalProperties) { - this.name = name; - this.data = data; - this.encoding = encoding; - this.fileName = fileName; - this.contentType = contentType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the form field - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The data for the form field. - */ - @JsonProperty("data") - public String getData() { - return data; - } - - /** - * @return The encoding of the value of data. Defaults to RAW if not defined. - *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- */ - @JsonProperty("encoding") - public Optional getEncoding() { - return encoding; - } - - /** - * @return The file name of the form field, if the field is for a file. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The MIME type of the file, if the field is for a file. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MultipartFormFieldRequest other) { - return name.equals(other.name) - && data.equals(other.data) - && encoding.equals(other.encoding) - && fileName.equals(other.fileName) - && contentType.equals(other.contentType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DataStage name(@NotNull String name); - - Builder from(MultipartFormFieldRequest other); - } - - public interface DataStage { - _FinalStage data(@NotNull String data); - } - - public interface _FinalStage { - MultipartFormFieldRequest build(); - - _FinalStage encoding(Optional encoding); - - _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); - - _FinalStage fileName(Optional fileName); - - _FinalStage fileName(String fileName); - - _FinalStage contentType(Optional contentType); - - _FinalStage contentType(String contentType); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DataStage, _FinalStage { - private String name; - - private String data; - - private Optional contentType = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional encoding = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MultipartFormFieldRequest other) { - name(other.getName()); - data(other.getData()); - encoding(other.getEncoding()); - fileName(other.getFileName()); - contentType(other.getContentType()); - return this; - } - - /** - *

The name of the form field

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public DataStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

The data for the form field.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull String data) { - this.data = data; - return this; - } - - /** - *

The MIME type of the file, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public _FinalStage contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - /** - *

The file name of the form field, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public _FinalStage fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - /** - *

The encoding of the value of data. Defaults to RAW if not defined.

- *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { - this.encoding = Optional.ofNullable(encoding); - return this; - } - - @java.lang.Override - @JsonSetter(value = "encoding", nulls = Nulls.SKIP) - public _FinalStage encoding(Optional encoding) { - this.encoding = encoding; - return this; - } - - @java.lang.Override - public MultipartFormFieldRequest build() { - return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/resources/filestorage/types/MultipartFormFieldRequestEncoding.java deleted file mode 100644 index 87b53edea..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/MultipartFormFieldRequestEncoding.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) -public final class MultipartFormFieldRequestEncoding { - private final Object value; - - private final int type; - - private MultipartFormFieldRequestEncoding(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EncodingEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); - } - - private boolean equalTo(MultipartFormFieldRequestEncoding other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { - return new MultipartFormFieldRequestEncoding(value, 0); - } - - public static MultipartFormFieldRequestEncoding of(String value) { - return new MultipartFormFieldRequestEncoding(value, 1); - } - - public interface Visitor { - T visit(EncodingEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MultipartFormFieldRequestEncoding.class); - } - - @java.lang.Override - public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/resources/filestorage/types/PaginatedAccountDetailsAndActionsList.java deleted file mode 100644 index d9b25c3e8..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedAccountDetailsAndActionsList.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) -public final class PaginatedAccountDetailsAndActionsList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountDetailsAndActionsList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountDetailsAndActionsList - && equalTo((PaginatedAccountDetailsAndActionsList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountDetailsAndActionsList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountDetailsAndActionsList build() { - return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/resources/filestorage/types/PaginatedAuditLogEventList.java deleted file mode 100644 index b8a64979e..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedAuditLogEventList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) -public final class PaginatedAuditLogEventList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAuditLogEventList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAuditLogEventList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAuditLogEventList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAuditLogEventList build() { - return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedGroupList.java b/src/main/java/com/merge/api/resources/filestorage/types/PaginatedGroupList.java deleted file mode 100644 index 91a33672a..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedGroupList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedGroupList.Builder.class) -public final class PaginatedGroupList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedGroupList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedGroupList && equalTo((PaginatedGroupList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedGroupList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedGroupList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedGroupList build() { - return new PaginatedGroupList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedIssueList.java b/src/main/java/com/merge/api/resources/filestorage/types/PaginatedIssueList.java deleted file mode 100644 index fc2db8dd3..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedIssueList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedIssueList.Builder.class) -public final class PaginatedIssueList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedIssueList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedIssueList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedIssueList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedIssueList build() { - return new PaginatedIssueList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/resources/filestorage/types/PaginatedSyncStatusList.java deleted file mode 100644 index 3b57618d3..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedSyncStatusList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) -public final class PaginatedSyncStatusList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedSyncStatusList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedSyncStatusList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedSyncStatusList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedSyncStatusList build() { - return new PaginatedSyncStatusList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedUserList.java b/src/main/java/com/merge/api/resources/filestorage/types/PaginatedUserList.java deleted file mode 100644 index 45d845336..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PaginatedUserList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedUserList.Builder.class) -public final class PaginatedUserList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedUserList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedUserList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedUserList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedUserList build() { - return new PaginatedUserList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestRolesItem.java b/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestRolesItem.java deleted file mode 100644 index 2d423b8e8..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestRolesItem.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PermissionRequestRolesItem.Deserializer.class) -public final class PermissionRequestRolesItem { - private final Object value; - - private final int type; - - private PermissionRequestRolesItem(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RolesEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PermissionRequestRolesItem && equalTo((PermissionRequestRolesItem) other); - } - - private boolean equalTo(PermissionRequestRolesItem other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PermissionRequestRolesItem of(RolesEnum value) { - return new PermissionRequestRolesItem(value, 0); - } - - public static PermissionRequestRolesItem of(String value) { - return new PermissionRequestRolesItem(value, 1); - } - - public interface Visitor { - T visit(RolesEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PermissionRequestRolesItem.class); - } - - @java.lang.Override - public PermissionRequestRolesItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RolesEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestType.java b/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestType.java deleted file mode 100644 index 37481dcf0..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRequestType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PermissionRequestType.Deserializer.class) -public final class PermissionRequestType { - private final Object value; - - private final int type; - - private PermissionRequestType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PermissionRequestType && equalTo((PermissionRequestType) other); - } - - private boolean equalTo(PermissionRequestType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PermissionRequestType of(TypeEnum value) { - return new PermissionRequestType(value, 0); - } - - public static PermissionRequestType of(String value) { - return new PermissionRequestType(value, 1); - } - - public interface Visitor { - T visit(TypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PermissionRequestType.class); - } - - @java.lang.Override - public PermissionRequestType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRolesItem.java b/src/main/java/com/merge/api/resources/filestorage/types/PermissionRolesItem.java deleted file mode 100644 index 749ea9ca9..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionRolesItem.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PermissionRolesItem.Deserializer.class) -public final class PermissionRolesItem { - private final Object value; - - private final int type; - - private PermissionRolesItem(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RolesEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PermissionRolesItem && equalTo((PermissionRolesItem) other); - } - - private boolean equalTo(PermissionRolesItem other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PermissionRolesItem of(RolesEnum value) { - return new PermissionRolesItem(value, 0); - } - - public static PermissionRolesItem of(String value) { - return new PermissionRolesItem(value, 1); - } - - public interface Visitor { - T visit(RolesEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PermissionRolesItem.class); - } - - @java.lang.Override - public PermissionRolesItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RolesEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/PermissionType.java b/src/main/java/com/merge/api/resources/filestorage/types/PermissionType.java deleted file mode 100644 index 08cc374f6..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/PermissionType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PermissionType.Deserializer.class) -public final class PermissionType { - private final Object value; - - private final int type; - - private PermissionType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PermissionType && equalTo((PermissionType) other); - } - - private boolean equalTo(PermissionType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PermissionType of(TypeEnum value) { - return new PermissionType(value, 0); - } - - public static PermissionType of(String value) { - return new PermissionType(value, 1); - } - - public interface Visitor { - T visit(TypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PermissionType.class); - } - - @java.lang.Override - public PermissionType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RemoteData.java b/src/main/java/com/merge/api/resources/filestorage/types/RemoteData.java deleted file mode 100644 index 5f7dee53c..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RemoteData.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteData.Builder.class) -public final class RemoteData { - private final String path; - - private final Optional data; - - private final Map additionalProperties; - - private RemoteData(String path, Optional data, Map additionalProperties) { - this.path = path; - this.data = data; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API path that is being called. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("data") - public Optional getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteData && equalTo((RemoteData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteData other) { - return path.equals(other.path) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.path, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PathStage builder() { - return new Builder(); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - - Builder from(RemoteData other); - } - - public interface _FinalStage { - RemoteData build(); - - _FinalStage data(Optional data); - - _FinalStage data(JsonNode data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PathStage, _FinalStage { - private String path; - - private Optional data = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteData other) { - path(other.getPath()); - data(other.getData()); - return this; - } - - /** - *

The third-party API path that is being called.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - public _FinalStage data(JsonNode data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - @java.lang.Override - public RemoteData build() { - return new RemoteData(path, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/filestorage/types/RemoteEndpointInfo.java deleted file mode 100644 index a57b0fd1a..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RemoteEndpointInfo.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) -public final class RemoteEndpointInfo { - private final String method; - - private final String urlPath; - - private final List fieldTraversalPath; - - private final Map additionalProperties; - - private RemoteEndpointInfo( - String method, - String urlPath, - List fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("url_path") - public String getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public List getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - UrlPathStage method(@NotNull String method); - - Builder from(RemoteEndpointInfo other); - } - - public interface UrlPathStage { - _FinalStage urlPath(@NotNull String urlPath); - } - - public interface _FinalStage { - RemoteEndpointInfo build(); - - _FinalStage fieldTraversalPath(List fieldTraversalPath); - - _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); - - _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { - private String method; - - private String urlPath; - - private List fieldTraversalPath = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public UrlPathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("url_path") - public _FinalStage urlPath(@NotNull String urlPath) { - this.urlPath = urlPath; - return this; - } - - @java.lang.Override - public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { - this.fieldTraversalPath.add(fieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.clear(); - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public RemoteEndpointInfo build() { - return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApi.java b/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApi.java deleted file mode 100644 index 544c1cb45..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApi.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApi.Builder.class) -public final class RemoteFieldApi { - private final Map schema; - - private final String remoteKeyName; - - private final RemoteEndpointInfo remoteEndpointInfo; - - private final Optional> exampleValues; - - private final Optional advancedMetadata; - - private final Optional coverage; - - private final Map additionalProperties; - - private RemoteFieldApi( - Map schema, - String remoteKeyName, - RemoteEndpointInfo remoteEndpointInfo, - Optional> exampleValues, - Optional advancedMetadata, - Optional coverage, - Map additionalProperties) { - this.schema = schema; - this.remoteKeyName = remoteKeyName; - this.remoteEndpointInfo = remoteEndpointInfo; - this.exampleValues = exampleValues; - this.advancedMetadata = advancedMetadata; - this.coverage = coverage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("schema") - public Map getSchema() { - return schema; - } - - @JsonProperty("remote_key_name") - public String getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("remote_endpoint_info") - public RemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @JsonProperty("example_values") - public Optional> getExampleValues() { - return exampleValues; - } - - @JsonProperty("advanced_metadata") - public Optional getAdvancedMetadata() { - return advancedMetadata; - } - - @JsonProperty("coverage") - public Optional getCoverage() { - return coverage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApi other) { - return schema.equals(other.schema) - && remoteKeyName.equals(other.remoteKeyName) - && remoteEndpointInfo.equals(other.remoteEndpointInfo) - && exampleValues.equals(other.exampleValues) - && advancedMetadata.equals(other.advancedMetadata) - && coverage.equals(other.coverage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.schema, - this.remoteKeyName, - this.remoteEndpointInfo, - this.exampleValues, - this.advancedMetadata, - this.coverage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteKeyNameStage builder() { - return new Builder(); - } - - public interface RemoteKeyNameStage { - RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); - - Builder from(RemoteFieldApi other); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); - } - - public interface _FinalStage { - RemoteFieldApi build(); - - _FinalStage schema(Map schema); - - _FinalStage putAllSchema(Map schema); - - _FinalStage schema(String key, JsonNode value); - - _FinalStage exampleValues(Optional> exampleValues); - - _FinalStage exampleValues(List exampleValues); - - _FinalStage advancedMetadata(Optional advancedMetadata); - - _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); - - _FinalStage coverage(Optional coverage); - - _FinalStage coverage(RemoteFieldApiCoverage coverage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { - private String remoteKeyName; - - private RemoteEndpointInfo remoteEndpointInfo; - - private Optional coverage = Optional.empty(); - - private Optional advancedMetadata = Optional.empty(); - - private Optional> exampleValues = Optional.empty(); - - private Map schema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldApi other) { - schema(other.getSchema()); - remoteKeyName(other.getRemoteKeyName()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - exampleValues(other.getExampleValues()); - advancedMetadata(other.getAdvancedMetadata()); - coverage(other.getCoverage()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_key_name") - public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage coverage(RemoteFieldApiCoverage coverage) { - this.coverage = Optional.ofNullable(coverage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "coverage", nulls = Nulls.SKIP) - public _FinalStage coverage(Optional coverage) { - this.coverage = coverage; - return this; - } - - @java.lang.Override - public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { - this.advancedMetadata = Optional.ofNullable(advancedMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) - public _FinalStage advancedMetadata(Optional advancedMetadata) { - this.advancedMetadata = advancedMetadata; - return this; - } - - @java.lang.Override - public _FinalStage exampleValues(List exampleValues) { - this.exampleValues = Optional.ofNullable(exampleValues); - return this; - } - - @java.lang.Override - @JsonSetter(value = "example_values", nulls = Nulls.SKIP) - public _FinalStage exampleValues(Optional> exampleValues) { - this.exampleValues = exampleValues; - return this; - } - - @java.lang.Override - public _FinalStage schema(String key, JsonNode value) { - this.schema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllSchema(Map schema) { - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Map schema) { - this.schema.clear(); - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - public RemoteFieldApi build() { - return new RemoteFieldApi( - schema, - remoteKeyName, - remoteEndpointInfo, - exampleValues, - advancedMetadata, - coverage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApiCoverage.java deleted file mode 100644 index 759fd9ac2..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApiCoverage.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) -public final class RemoteFieldApiCoverage { - private final Object value; - - private final int type; - - private RemoteFieldApiCoverage(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((int) this.value); - } else if (this.type == 1) { - return visitor.visit((double) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); - } - - private boolean equalTo(RemoteFieldApiCoverage other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldApiCoverage of(int value) { - return new RemoteFieldApiCoverage(value, 0); - } - - public static RemoteFieldApiCoverage of(double value) { - return new RemoteFieldApiCoverage(value, 1); - } - - public interface Visitor { - T visit(int value); - - T visit(double value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldApiCoverage.class); - } - - @java.lang.Override - public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - if (value instanceof Integer) { - return of((Integer) value); - } - if (value instanceof Double) { - return of((Double) value); - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApiResponse.java deleted file mode 100644 index 9464902a6..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RemoteFieldApiResponse.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) -public final class RemoteFieldApiResponse { - private final Optional> file; - - private final Optional> folder; - - private final Optional> drive; - - private final Optional> group; - - private final Optional> user; - - private final Map additionalProperties; - - private RemoteFieldApiResponse( - Optional> file, - Optional> folder, - Optional> drive, - Optional> group, - Optional> user, - Map additionalProperties) { - this.file = file; - this.folder = folder; - this.drive = drive; - this.group = group; - this.user = user; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("File") - public Optional> getFile() { - return file; - } - - @JsonProperty("Folder") - public Optional> getFolder() { - return folder; - } - - @JsonProperty("Drive") - public Optional> getDrive() { - return drive; - } - - @JsonProperty("Group") - public Optional> getGroup() { - return group; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApiResponse other) { - return file.equals(other.file) - && folder.equals(other.folder) - && drive.equals(other.drive) - && group.equals(other.group) - && user.equals(other.user); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.file, this.folder, this.drive, this.group, this.user); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> file = Optional.empty(); - - private Optional> folder = Optional.empty(); - - private Optional> drive = Optional.empty(); - - private Optional> group = Optional.empty(); - - private Optional> user = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldApiResponse other) { - file(other.getFile()); - folder(other.getFolder()); - drive(other.getDrive()); - group(other.getGroup()); - user(other.getUser()); - return this; - } - - @JsonSetter(value = "File", nulls = Nulls.SKIP) - public Builder file(Optional> file) { - this.file = file; - return this; - } - - public Builder file(List file) { - this.file = Optional.ofNullable(file); - return this; - } - - @JsonSetter(value = "Folder", nulls = Nulls.SKIP) - public Builder folder(Optional> folder) { - this.folder = folder; - return this; - } - - public Builder folder(List folder) { - this.folder = Optional.ofNullable(folder); - return this; - } - - @JsonSetter(value = "Drive", nulls = Nulls.SKIP) - public Builder drive(Optional> drive) { - this.drive = drive; - return this; - } - - public Builder drive(List drive) { - this.drive = Optional.ofNullable(drive); - return this; - } - - @JsonSetter(value = "Group", nulls = Nulls.SKIP) - public Builder group(Optional> group) { - this.group = group; - return this; - } - - public Builder group(List group) { - this.group = Optional.ofNullable(group); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - public RemoteFieldApiResponse build() { - return new RemoteFieldApiResponse(file, folder, drive, group, user, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RemoteKey.java b/src/main/java/com/merge/api/resources/filestorage/types/RemoteKey.java deleted file mode 100644 index 2b7882b45..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RemoteKey.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKey.Builder.class) -public final class RemoteKey { - private final String name; - - private final String key; - - private final Map additionalProperties; - - private RemoteKey(String name, String key, Map additionalProperties) { - this.name = name; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("key") - public String getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKey && equalTo((RemoteKey) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKey other) { - return name.equals(other.name) && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - KeyStage name(@NotNull String name); - - Builder from(RemoteKey other); - } - - public interface KeyStage { - _FinalStage key(@NotNull String key); - } - - public interface _FinalStage { - RemoteKey build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, KeyStage, _FinalStage { - private String name; - - private String key; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKey other) { - name(other.getName()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public KeyStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("key") - public _FinalStage key(@NotNull String key) { - this.key = key; - return this; - } - - @java.lang.Override - public RemoteKey build() { - return new RemoteKey(name, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RemoteResponse.java b/src/main/java/com/merge/api/resources/filestorage/types/RemoteResponse.java deleted file mode 100644 index 5dcc62a3b..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RemoteResponse.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteResponse.Builder.class) -public final class RemoteResponse { - private final String method; - - private final String path; - - private final int status; - - private final JsonNode response; - - private final Optional> responseHeaders; - - private final Optional responseType; - - private final Optional> headers; - - private final Map additionalProperties; - - private RemoteResponse( - String method, - String path, - int status, - JsonNode response, - Optional> responseHeaders, - Optional responseType, - Optional> headers, - Map additionalProperties) { - this.method = method; - this.path = path; - this.status = status; - this.response = response; - this.responseHeaders = responseHeaders; - this.responseType = responseType; - this.headers = headers; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("status") - public int getStatus() { - return status; - } - - @JsonProperty("response") - public JsonNode getResponse() { - return response; - } - - @JsonProperty("response_headers") - public Optional> getResponseHeaders() { - return responseHeaders; - } - - @JsonProperty("response_type") - public Optional getResponseType() { - return responseType; - } - - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponse && equalTo((RemoteResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteResponse other) { - return method.equals(other.method) - && path.equals(other.path) - && status == other.status - && response.equals(other.response) - && responseHeaders.equals(other.responseHeaders) - && responseType.equals(other.responseType) - && headers.equals(other.headers); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.status, - this.response, - this.responseHeaders, - this.responseType, - this.headers); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull String method); - - Builder from(RemoteResponse other); - } - - public interface PathStage { - StatusStage path(@NotNull String path); - } - - public interface StatusStage { - ResponseStage status(int status); - } - - public interface ResponseStage { - _FinalStage response(@NotNull JsonNode response); - } - - public interface _FinalStage { - RemoteResponse build(); - - _FinalStage responseHeaders(Optional> responseHeaders); - - _FinalStage responseHeaders(Map responseHeaders); - - _FinalStage responseType(Optional responseType); - - _FinalStage responseType(ResponseTypeEnum responseType); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { - private String method; - - private String path; - - private int status; - - private JsonNode response; - - private Optional> headers = Optional.empty(); - - private Optional responseType = Optional.empty(); - - private Optional> responseHeaders = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteResponse other) { - method(other.getMethod()); - path(other.getPath()); - status(other.getStatus()); - response(other.getResponse()); - responseHeaders(other.getResponseHeaders()); - responseType(other.getResponseType()); - headers(other.getHeaders()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("path") - public StatusStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public ResponseStage status(int status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("response") - public _FinalStage response(@NotNull JsonNode response) { - this.response = response; - return this; - } - - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - @java.lang.Override - public _FinalStage responseType(ResponseTypeEnum responseType) { - this.responseType = Optional.ofNullable(responseType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_type", nulls = Nulls.SKIP) - public _FinalStage responseType(Optional responseType) { - this.responseType = responseType; - return this; - } - - @java.lang.Override - public _FinalStage responseHeaders(Map responseHeaders) { - this.responseHeaders = Optional.ofNullable(responseHeaders); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) - public _FinalStage responseHeaders(Optional> responseHeaders) { - this.responseHeaders = responseHeaders; - return this; - } - - @java.lang.Override - public RemoteResponse build() { - return new RemoteResponse( - method, path, status, response, responseHeaders, responseType, headers, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RequestFormatEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/RequestFormatEnum.java deleted file mode 100644 index 0618d396a..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RequestFormatEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RequestFormatEnum { - JSON("JSON"), - - XML("XML"), - - MULTIPART("MULTIPART"); - - private final String value; - - RequestFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/ResponseTypeEnum.java deleted file mode 100644 index 2ee0613f4..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ResponseTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ResponseTypeEnum { - JSON("JSON"), - - BASE_64_GZIP("BASE64_GZIP"); - - private final String value; - - ResponseTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/RoleEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/RoleEnum.java deleted file mode 100644 index 939955325..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/RoleEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RoleEnum { - ADMIN("ADMIN"), - - DEVELOPER("DEVELOPER"), - - MEMBER("MEMBER"), - - API("API"), - - SYSTEM("SYSTEM"), - - MERGE_TEAM("MERGE_TEAM"); - - private final String value; - - RoleEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java deleted file mode 100644 index b8eeefb6c..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/SelectiveSyncConfigurationsUsageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SelectiveSyncConfigurationsUsageEnum { - IN_NEXT_SYNC("IN_NEXT_SYNC"), - - IN_LAST_SYNC("IN_LAST_SYNC"); - - private final String value; - - SelectiveSyncConfigurationsUsageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/SyncStatus.java b/src/main/java/com/merge/api/resources/filestorage/types/SyncStatus.java deleted file mode 100644 index a3733ef3c..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/SyncStatus.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatus.Builder.class) -public final class SyncStatus { - private final String modelName; - - private final String modelId; - - private final Optional lastSyncStart; - - private final Optional nextSyncStart; - - private final SyncStatusStatusEnum status; - - private final boolean isInitialSync; - - private final Optional selectiveSyncConfigurationsUsage; - - private final Map additionalProperties; - - private SyncStatus( - String modelName, - String modelId, - Optional lastSyncStart, - Optional nextSyncStart, - SyncStatusStatusEnum status, - boolean isInitialSync, - Optional selectiveSyncConfigurationsUsage, - Map additionalProperties) { - this.modelName = modelName; - this.modelId = modelId; - this.lastSyncStart = lastSyncStart; - this.nextSyncStart = nextSyncStart; - this.status = status; - this.isInitialSync = isInitialSync; - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("last_sync_start") - public Optional getLastSyncStart() { - return lastSyncStart; - } - - @JsonProperty("next_sync_start") - public Optional getNextSyncStart() { - return nextSyncStart; - } - - @JsonProperty("status") - public SyncStatusStatusEnum getStatus() { - return status; - } - - @JsonProperty("is_initial_sync") - public boolean getIsInitialSync() { - return isInitialSync; - } - - @JsonProperty("selective_sync_configurations_usage") - public Optional getSelectiveSyncConfigurationsUsage() { - return selectiveSyncConfigurationsUsage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatus && equalTo((SyncStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatus other) { - return modelName.equals(other.modelName) - && modelId.equals(other.modelId) - && lastSyncStart.equals(other.lastSyncStart) - && nextSyncStart.equals(other.nextSyncStart) - && status.equals(other.status) - && isInitialSync == other.isInitialSync - && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, - this.modelId, - this.lastSyncStart, - this.nextSyncStart, - this.status, - this.isInitialSync, - this.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - ModelIdStage modelName(@NotNull String modelName); - - Builder from(SyncStatus other); - } - - public interface ModelIdStage { - StatusStage modelId(@NotNull String modelId); - } - - public interface StatusStage { - IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status); - } - - public interface IsInitialSyncStage { - _FinalStage isInitialSync(boolean isInitialSync); - } - - public interface _FinalStage { - SyncStatus build(); - - _FinalStage lastSyncStart(Optional lastSyncStart); - - _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); - - _FinalStage nextSyncStart(Optional nextSyncStart); - - _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); - - _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage); - - _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { - private String modelName; - - private String modelId; - - private SyncStatusStatusEnum status; - - private boolean isInitialSync; - - private Optional selectiveSyncConfigurationsUsage = Optional.empty(); - - private Optional nextSyncStart = Optional.empty(); - - private Optional lastSyncStart = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(SyncStatus other) { - modelName(other.getModelName()); - modelId(other.getModelId()); - lastSyncStart(other.getLastSyncStart()); - nextSyncStart(other.getNextSyncStart()); - status(other.getStatus()); - isInitialSync(other.getIsInitialSync()); - selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public ModelIdStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public StatusStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("is_initial_sync") - public _FinalStage isInitialSync(boolean isInitialSync) { - this.isInitialSync = isInitialSync; - return this; - } - - @java.lang.Override - public _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) - public _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - return this; - } - - @java.lang.Override - public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { - this.nextSyncStart = Optional.ofNullable(nextSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) - public _FinalStage nextSyncStart(Optional nextSyncStart) { - this.nextSyncStart = nextSyncStart; - return this; - } - - @java.lang.Override - public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { - this.lastSyncStart = Optional.ofNullable(lastSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) - public _FinalStage lastSyncStart(Optional lastSyncStart) { - this.lastSyncStart = lastSyncStart; - return this; - } - - @java.lang.Override - public SyncStatus build() { - return new SyncStatus( - modelName, - modelId, - lastSyncStart, - nextSyncStart, - status, - isInitialSync, - selectiveSyncConfigurationsUsage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/api/resources/filestorage/types/SyncStatusStatusEnum.java deleted file mode 100644 index 9e5dd7a11..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/SyncStatusStatusEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SyncStatusStatusEnum { - SYNCING("SYNCING"), - - DONE("DONE"), - - FAILED("FAILED"), - - DISABLED("DISABLED"), - - PAUSED("PAUSED"), - - PARTIALLY_SYNCED("PARTIALLY_SYNCED"); - - private final String value; - - SyncStatusStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/User.java b/src/main/java/com/merge/api/resources/filestorage/types/User.java deleted file mode 100644 index 5152ddc77..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/User.java +++ /dev/null @@ -1,358 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = User.Builder.class) -public final class User { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional emailAddress; - - private final Optional isMe; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private User( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional emailAddress, - Optional isMe, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.emailAddress = emailAddress; - this.isMe = isMe; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The user's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The user's email address. This is typically used to identify a user across linked accounts. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return Whether the user is the one who linked this account. - */ - @JsonProperty("is_me") - public Optional getIsMe() { - return isMe; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof User && equalTo((User) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(User other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && emailAddress.equals(other.emailAddress) - && isMe.equals(other.isMe) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.emailAddress, - this.isMe, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional isMe = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(User other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - emailAddress(other.getEmailAddress()); - isMe(other.getIsMe()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "is_me", nulls = Nulls.SKIP) - public Builder isMe(Optional isMe) { - this.isMe = isMe; - return this; - } - - public Builder isMe(Boolean isMe) { - this.isMe = Optional.ofNullable(isMe); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public User build() { - return new User( - id, - remoteId, - createdAt, - modifiedAt, - name, - emailAddress, - isMe, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/ValidationProblemSource.java b/src/main/java/com/merge/api/resources/filestorage/types/ValidationProblemSource.java deleted file mode 100644 index 2acfdb98a..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/ValidationProblemSource.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ValidationProblemSource.Builder.class) -public final class ValidationProblemSource { - private final String pointer; - - private final Map additionalProperties; - - private ValidationProblemSource(String pointer, Map additionalProperties) { - this.pointer = pointer; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("pointer") - public String getPointer() { - return pointer; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidationProblemSource other) { - return pointer.equals(other.pointer); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.pointer); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PointerStage builder() { - return new Builder(); - } - - public interface PointerStage { - _FinalStage pointer(@NotNull String pointer); - - Builder from(ValidationProblemSource other); - } - - public interface _FinalStage { - ValidationProblemSource build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PointerStage, _FinalStage { - private String pointer; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ValidationProblemSource other) { - pointer(other.getPointer()); - return this; - } - - @java.lang.Override - @JsonSetter("pointer") - public _FinalStage pointer(@NotNull String pointer) { - this.pointer = pointer; - return this; - } - - @java.lang.Override - public ValidationProblemSource build() { - return new ValidationProblemSource(pointer, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/WarningValidationProblem.java b/src/main/java/com/merge/api/resources/filestorage/types/WarningValidationProblem.java deleted file mode 100644 index 78f1e4cb6..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/WarningValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WarningValidationProblem.Builder.class) -public final class WarningValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private WarningValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WarningValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(WarningValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - WarningValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WarningValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public WarningValidationProblem build() { - return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/types/WebhookReceiver.java b/src/main/java/com/merge/api/resources/filestorage/types/WebhookReceiver.java deleted file mode 100644 index 3cf4b93bd..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/types/WebhookReceiver.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiver.Builder.class) -public final class WebhookReceiver { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiver( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiver other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiver other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiver build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiver other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiver build() { - return new WebhookReceiver(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/users/UsersClient.java b/src/main/java/com/merge/api/resources/filestorage/users/UsersClient.java deleted file mode 100644 index 416861fba..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/users/UsersClient.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.users; - -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.filestorage.types.PaginatedUserList; -import com.merge.api.resources.filestorage.types.User; -import com.merge.api.resources.filestorage.users.requests.UsersListRequest; -import com.merge.api.resources.filestorage.users.requests.UsersRetrieveRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class UsersClient { - protected final ClientOptions clientOptions; - - public UsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list() { - return list(UsersListRequest.builder().build()); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list(UsersListRequest request) { - return list(request, null); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list(UsersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/users"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsMe().isPresent()) { - httpUrl.addQueryParameter("is_me", request.getIsMe().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedUserList.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); - } - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id) { - return retrieve(id, UsersRetrieveRequest.builder().build()); - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id, UsersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/users") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), User.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/users/requests/UsersListRequest.java b/src/main/java/com/merge/api/resources/filestorage/users/requests/UsersListRequest.java deleted file mode 100644 index 524b4681b..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/users/requests/UsersListRequest.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersListRequest.Builder.class) -public final class UsersListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional isMe; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private UsersListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional isMe, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.isMe = isMe; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, will only return the user object for requestor. - */ - @JsonProperty("is_me") - public Optional getIsMe() { - return isMe; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersListRequest && equalTo((UsersListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && isMe.equals(other.isMe) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.isMe, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional isMe = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - isMe(other.getIsMe()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "is_me", nulls = Nulls.SKIP) - public Builder isMe(Optional isMe) { - this.isMe = isMe; - return this; - } - - public Builder isMe(String isMe) { - this.isMe = Optional.ofNullable(isMe); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public UsersListRequest build() { - return new UsersListRequest( - createdAfter, - createdBefore, - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - isMe, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/api/resources/filestorage/users/requests/UsersRetrieveRequest.java deleted file mode 100644 index 7e2023f73..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/users/requests/UsersRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) -public final class UsersRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private UsersRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public UsersRetrieveRequest build() { - return new UsersRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/api/resources/filestorage/webhookreceivers/WebhookReceiversClient.java deleted file mode 100644 index 565a856ee..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/webhookreceivers/WebhookReceiversClient.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.webhookreceivers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.filestorage.types.WebhookReceiver; -import com.merge.api.resources.filestorage.webhookreceivers.requests.WebhookReceiverRequest; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class WebhookReceiversClient { - protected final ClientOptions clientOptions; - - public WebhookReceiversClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list() { - return list(null); - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/webhook-receivers") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request) { - return create(request, null); - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("filestorage/v1/webhook-receivers") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), WebhookReceiver.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/filestorage/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/api/resources/filestorage/webhookreceivers/requests/WebhookReceiverRequest.java deleted file mode 100644 index 653e468d5..000000000 --- a/src/main/java/com/merge/api/resources/filestorage/webhookreceivers/requests/WebhookReceiverRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.filestorage.webhookreceivers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) -public final class WebhookReceiverRequest { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiverRequest( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiverRequest other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiverRequest other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiverRequest build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiverRequest other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiverRequest build() { - return new WebhookReceiverRequest(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/api/resources/hris/accountdetails/AccountDetailsClient.java deleted file mode 100644 index 1c7970ea4..000000000 --- a/src/main/java/com/merge/api/resources/hris/accountdetails/AccountDetailsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.accountdetails; - -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.hris.types.AccountDetails; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountDetailsClient { - protected final ClientOptions clientOptions; - - public AccountDetailsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve() { - return retrieve(null); - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/account-details") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountDetails.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/api/resources/hris/accounttoken/AccountTokenClient.java deleted file mode 100644 index f677e3b19..000000000 --- a/src/main/java/com/merge/api/resources/hris/accounttoken/AccountTokenClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.accounttoken; - -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.hris.types.AccountToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountTokenClient { - protected final ClientOptions clientOptions; - - public AccountTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken) { - return retrieve(publicToken, null); - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/account-token") - .addPathSegment(publicToken) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/api/resources/hris/asyncpassthrough/AsyncPassthroughClient.java deleted file mode 100644 index c70b057da..000000000 --- a/src/main/java/com/merge/api/resources/hris/asyncpassthrough/AsyncPassthroughClient.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.asyncpassthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; -import com.merge.api.resources.hris.types.AsyncPassthroughReciept; -import com.merge.api.resources.hris.types.DataPassthroughRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AsyncPassthroughClient { - protected final ClientOptions clientOptions; - - public AsyncPassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/async-passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), AsyncPassthroughReciept.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); - } - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/async-passthrough") - .addPathSegment(asyncPassthroughReceiptId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AsyncPassthroughRetrieveResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/resources/hris/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java deleted file mode 100644 index 492f45945..000000000 --- a/src/main/java/com/merge/api/resources/hris/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.asyncpassthrough.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.types.RemoteResponse; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) -public final class AsyncPassthroughRetrieveResponse { - private final Object value; - - private final int type; - - private AsyncPassthroughRetrieveResponse(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RemoteResponse) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); - } - - private boolean equalTo(AsyncPassthroughRetrieveResponse other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { - return new AsyncPassthroughRetrieveResponse(value, 0); - } - - public static AsyncPassthroughRetrieveResponse of(String value) { - return new AsyncPassthroughRetrieveResponse(value, 1); - } - - public interface Visitor { - T visit(RemoteResponse value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AsyncPassthroughRetrieveResponse.class); - } - - @java.lang.Override - public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/audittrail/AuditTrailClient.java b/src/main/java/com/merge/api/resources/hris/audittrail/AuditTrailClient.java deleted file mode 100644 index a5537eea6..000000000 --- a/src/main/java/com/merge/api/resources/hris/audittrail/AuditTrailClient.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.audittrail; - -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.hris.audittrail.requests.AuditTrailListRequest; -import com.merge.api.resources.hris.types.PaginatedAuditLogEventList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AuditTrailClient { - protected final ClientOptions clientOptions; - - public AuditTrailClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list() { - return list(AuditTrailListRequest.builder().build()); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request) { - return list(request, null); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/audit-trail"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEventType().isPresent()) { - httpUrl.addQueryParameter("event_type", request.getEventType().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getUserEmail().isPresent()) { - httpUrl.addQueryParameter("user_email", request.getUserEmail().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAuditLogEventList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/api/resources/hris/audittrail/requests/AuditTrailListRequest.java deleted file mode 100644 index 8841a60c8..000000000 --- a/src/main/java/com/merge/api/resources/hris/audittrail/requests/AuditTrailListRequest.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.audittrail.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) -public final class AuditTrailListRequest { - private final Optional cursor; - - private final Optional endDate; - - private final Optional eventType; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional userEmail; - - private final Map additionalProperties; - - private AuditTrailListRequest( - Optional cursor, - Optional endDate, - Optional eventType, - Optional pageSize, - Optional startDate, - Optional userEmail, - Map additionalProperties) { - this.cursor = cursor; - this.endDate = endDate; - this.eventType = eventType; - this.pageSize = pageSize; - this.startDate = startDate; - this.userEmail = userEmail; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include audit trail events that occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - /** - * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED - */ - @JsonProperty("event_type") - public Optional getEventType() { - return eventType; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include audit trail events that occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditTrailListRequest other) { - return cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && eventType.equals(other.eventType) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && userEmail.equals(other.userEmail); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional eventType = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AuditTrailListRequest other) { - cursor(other.getCursor()); - endDate(other.getEndDate()); - eventType(other.getEventType()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - userEmail(other.getUserEmail()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "event_type", nulls = Nulls.SKIP) - public Builder eventType(Optional eventType) { - this.eventType = eventType; - return this; - } - - public Builder eventType(String eventType) { - this.eventType = Optional.ofNullable(eventType); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public Builder userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - public Builder userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - public AuditTrailListRequest build() { - return new AuditTrailListRequest( - cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/api/resources/hris/availableactions/AvailableActionsClient.java deleted file mode 100644 index a7c3252db..000000000 --- a/src/main/java/com/merge/api/resources/hris/availableactions/AvailableActionsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.availableactions; - -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.hris.types.AvailableActions; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AvailableActionsClient { - protected final ClientOptions clientOptions; - - public AvailableActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve() { - return retrieve(null); - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/available-actions") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AvailableActions.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/bankinfo/BankInfoClient.java b/src/main/java/com/merge/api/resources/hris/bankinfo/BankInfoClient.java deleted file mode 100644 index edf4ce888..000000000 --- a/src/main/java/com/merge/api/resources/hris/bankinfo/BankInfoClient.java +++ /dev/null @@ -1,199 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.bankinfo; - -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.hris.bankinfo.requests.BankInfoListRequest; -import com.merge.api.resources.hris.bankinfo.requests.BankInfoRetrieveRequest; -import com.merge.api.resources.hris.types.BankInfo; -import com.merge.api.resources.hris.types.PaginatedBankInfoList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class BankInfoClient { - protected final ClientOptions clientOptions; - - public BankInfoClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of BankInfo objects. - */ - public PaginatedBankInfoList list() { - return list(BankInfoListRequest.builder().build()); - } - - /** - * Returns a list of BankInfo objects. - */ - public PaginatedBankInfoList list(BankInfoListRequest request) { - return list(request, null); - } - - /** - * Returns a list of BankInfo objects. - */ - public PaginatedBankInfoList list(BankInfoListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/bank-info"); - if (request.getAccountType().isPresent()) { - httpUrl.addQueryParameter( - "account_type", request.getAccountType().get().toString()); - } - if (request.getBankName().isPresent()) { - httpUrl.addQueryParameter("bank_name", request.getBankName().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmployeeId().isPresent()) { - httpUrl.addQueryParameter("employee_id", request.getEmployeeId().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOrderBy().isPresent()) { - httpUrl.addQueryParameter("order_by", request.getOrderBy().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedBankInfoList.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); - } - } - - /** - * Returns a BankInfo object with the given id. - */ - public BankInfo retrieve(String id) { - return retrieve(id, BankInfoRetrieveRequest.builder().build()); - } - - /** - * Returns a BankInfo object with the given id. - */ - public BankInfo retrieve(String id, BankInfoRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a BankInfo object with the given id. - */ - public BankInfo retrieve(String id, BankInfoRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/bank-info") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), BankInfo.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/benefits/BenefitsClient.java b/src/main/java/com/merge/api/resources/hris/benefits/BenefitsClient.java deleted file mode 100644 index 550f35e81..000000000 --- a/src/main/java/com/merge/api/resources/hris/benefits/BenefitsClient.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.benefits; - -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.hris.benefits.requests.BenefitsListRequest; -import com.merge.api.resources.hris.benefits.requests.BenefitsRetrieveRequest; -import com.merge.api.resources.hris.types.Benefit; -import com.merge.api.resources.hris.types.PaginatedBenefitList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class BenefitsClient { - protected final ClientOptions clientOptions; - - public BenefitsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Benefit objects. - */ - public PaginatedBenefitList list() { - return list(BenefitsListRequest.builder().build()); - } - - /** - * Returns a list of Benefit objects. - */ - public PaginatedBenefitList list(BenefitsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Benefit objects. - */ - public PaginatedBenefitList list(BenefitsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/benefits"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmployeeId().isPresent()) { - httpUrl.addQueryParameter("employee_id", request.getEmployeeId().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedBenefitList.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); - } - } - - /** - * Returns a Benefit object with the given id. - */ - public Benefit retrieve(String id) { - return retrieve(id, BenefitsRetrieveRequest.builder().build()); - } - - /** - * Returns a Benefit object with the given id. - */ - public Benefit retrieve(String id, BenefitsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Benefit object with the given id. - */ - public Benefit retrieve(String id, BenefitsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/benefits") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Benefit.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/benefits/requests/BenefitsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/benefits/requests/BenefitsRetrieveRequest.java deleted file mode 100644 index 4f1744baf..000000000 --- a/src/main/java/com/merge/api/resources/hris/benefits/requests/BenefitsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.benefits.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = BenefitsRetrieveRequest.Builder.class) -public final class BenefitsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private BenefitsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BenefitsRetrieveRequest && equalTo((BenefitsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(BenefitsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(BenefitsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public BenefitsRetrieveRequest build() { - return new BenefitsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/companies/CompaniesClient.java b/src/main/java/com/merge/api/resources/hris/companies/CompaniesClient.java deleted file mode 100644 index 6c205aead..000000000 --- a/src/main/java/com/merge/api/resources/hris/companies/CompaniesClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.companies; - -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.hris.companies.requests.CompaniesListRequest; -import com.merge.api.resources.hris.companies.requests.CompaniesRetrieveRequest; -import com.merge.api.resources.hris.types.Company; -import com.merge.api.resources.hris.types.PaginatedCompanyList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CompaniesClient { - protected final ClientOptions clientOptions; - - public CompaniesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Company objects. - */ - public PaginatedCompanyList list() { - return list(CompaniesListRequest.builder().build()); - } - - /** - * Returns a list of Company objects. - */ - public PaginatedCompanyList list(CompaniesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Company objects. - */ - public PaginatedCompanyList list(CompaniesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/companies"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCompanyList.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); - } - } - - /** - * Returns a Company object with the given id. - */ - public Company retrieve(String id) { - return retrieve(id, CompaniesRetrieveRequest.builder().build()); - } - - /** - * Returns a Company object with the given id. - */ - public Company retrieve(String id, CompaniesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Company object with the given id. - */ - public Company retrieve(String id, CompaniesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/companies") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Company.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/companies/requests/CompaniesRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/companies/requests/CompaniesRetrieveRequest.java deleted file mode 100644 index 039d346cb..000000000 --- a/src/main/java/com/merge/api/resources/hris/companies/requests/CompaniesRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.companies.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CompaniesRetrieveRequest.Builder.class) -public final class CompaniesRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private CompaniesRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CompaniesRetrieveRequest && equalTo((CompaniesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CompaniesRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CompaniesRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public CompaniesRetrieveRequest build() { - return new CompaniesRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/api/resources/hris/deleteaccount/DeleteAccountClient.java deleted file mode 100644 index 034c27ba0..000000000 --- a/src/main/java/com/merge/api/resources/hris/deleteaccount/DeleteAccountClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.deleteaccount; - -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 java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DeleteAccountClient { - protected final ClientOptions clientOptions; - - public DeleteAccountClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Delete a linked account. - */ - public void delete() { - delete(null); - } - - /** - * Delete a linked account. - */ - public void delete(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/delete-account") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .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; - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/dependents/DependentsClient.java b/src/main/java/com/merge/api/resources/hris/dependents/DependentsClient.java deleted file mode 100644 index 1b3f0fb7f..000000000 --- a/src/main/java/com/merge/api/resources/hris/dependents/DependentsClient.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.dependents; - -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.hris.dependents.requests.DependentsListRequest; -import com.merge.api.resources.hris.dependents.requests.DependentsRetrieveRequest; -import com.merge.api.resources.hris.types.Dependent; -import com.merge.api.resources.hris.types.PaginatedDependentList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DependentsClient { - protected final ClientOptions clientOptions; - - public DependentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Dependent objects. - */ - public PaginatedDependentList list() { - return list(DependentsListRequest.builder().build()); - } - - /** - * Returns a list of Dependent objects. - */ - public PaginatedDependentList list(DependentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Dependent objects. - */ - public PaginatedDependentList list(DependentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/dependents"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeSensitiveFields().isPresent()) { - httpUrl.addQueryParameter( - "include_sensitive_fields", - request.getIncludeSensitiveFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedDependentList.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); - } - } - - /** - * Returns a Dependent object with the given id. - */ - public Dependent retrieve(String id) { - return retrieve(id, DependentsRetrieveRequest.builder().build()); - } - - /** - * Returns a Dependent object with the given id. - */ - public Dependent retrieve(String id, DependentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Dependent object with the given id. - */ - public Dependent retrieve(String id, DependentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/dependents") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeSensitiveFields().isPresent()) { - httpUrl.addQueryParameter( - "include_sensitive_fields", - request.getIncludeSensitiveFields().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Dependent.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/EmployeePayrollRunsClient.java b/src/main/java/com/merge/api/resources/hris/employeepayrollruns/EmployeePayrollRunsClient.java deleted file mode 100644 index 5c60c87bb..000000000 --- a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/EmployeePayrollRunsClient.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employeepayrollruns; - -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.hris.employeepayrollruns.requests.EmployeePayrollRunsListRequest; -import com.merge.api.resources.hris.employeepayrollruns.requests.EmployeePayrollRunsRetrieveRequest; -import com.merge.api.resources.hris.types.EmployeePayrollRun; -import com.merge.api.resources.hris.types.PaginatedEmployeePayrollRunList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EmployeePayrollRunsClient { - protected final ClientOptions clientOptions; - - public EmployeePayrollRunsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of EmployeePayrollRun objects. - */ - public PaginatedEmployeePayrollRunList list() { - return list(EmployeePayrollRunsListRequest.builder().build()); - } - - /** - * Returns a list of EmployeePayrollRun objects. - */ - public PaginatedEmployeePayrollRunList list(EmployeePayrollRunsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of EmployeePayrollRun objects. - */ - public PaginatedEmployeePayrollRunList list(EmployeePayrollRunsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employee-payroll-runs"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmployeeId().isPresent()) { - httpUrl.addQueryParameter("employee_id", request.getEmployeeId().get()); - } - if (request.getEndedAfter().isPresent()) { - httpUrl.addQueryParameter( - "ended_after", request.getEndedAfter().get().toString()); - } - if (request.getEndedBefore().isPresent()) { - httpUrl.addQueryParameter( - "ended_before", request.getEndedBefore().get().toString()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getPayrollRunId().isPresent()) { - httpUrl.addQueryParameter( - "payroll_run_id", request.getPayrollRunId().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getStartedAfter().isPresent()) { - httpUrl.addQueryParameter( - "started_after", request.getStartedAfter().get().toString()); - } - if (request.getStartedBefore().isPresent()) { - httpUrl.addQueryParameter( - "started_before", request.getStartedBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEmployeePayrollRunList.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); - } - } - - /** - * Returns an EmployeePayrollRun object with the given id. - */ - public EmployeePayrollRun retrieve(String id) { - return retrieve(id, EmployeePayrollRunsRetrieveRequest.builder().build()); - } - - /** - * Returns an EmployeePayrollRun object with the given id. - */ - public EmployeePayrollRun retrieve(String id, EmployeePayrollRunsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an EmployeePayrollRun object with the given id. - */ - public EmployeePayrollRun retrieve( - String id, EmployeePayrollRunsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employee-payroll-runs") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), EmployeePayrollRun.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsRetrieveRequest.java deleted file mode 100644 index aa36ef087..000000000 --- a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/requests/EmployeePayrollRunsRetrieveRequest.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employeepayrollruns.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.employeepayrollruns.types.EmployeePayrollRunsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmployeePayrollRunsRetrieveRequest.Builder.class) -public final class EmployeePayrollRunsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private EmployeePayrollRunsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeePayrollRunsRetrieveRequest - && equalTo((EmployeePayrollRunsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmployeePayrollRunsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmployeePayrollRunsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EmployeePayrollRunsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public EmployeePayrollRunsRetrieveRequest build() { - return new EmployeePayrollRunsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsListRequestExpand.java b/src/main/java/com/merge/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsListRequestExpand.java deleted file mode 100644 index e8746e79c..000000000 --- a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employeepayrollruns.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EmployeePayrollRunsListRequestExpand { - EMPLOYEE("employee"), - - EMPLOYEE_PAYROLL_RUN("employee,payroll_run"), - - PAYROLL_RUN("payroll_run"); - - private final String value; - - EmployeePayrollRunsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsRetrieveRequestExpand.java deleted file mode 100644 index facc3cefd..000000000 --- a/src/main/java/com/merge/api/resources/hris/employeepayrollruns/types/EmployeePayrollRunsRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employeepayrollruns.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EmployeePayrollRunsRetrieveRequestExpand { - EMPLOYEE("employee"), - - EMPLOYEE_PAYROLL_RUN("employee,payroll_run"), - - PAYROLL_RUN("payroll_run"); - - private final String value; - - EmployeePayrollRunsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employees/EmployeesClient.java b/src/main/java/com/merge/api/resources/hris/employees/EmployeesClient.java deleted file mode 100644 index 6fc7645e0..000000000 --- a/src/main/java/com/merge/api/resources/hris/employees/EmployeesClient.java +++ /dev/null @@ -1,419 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employees; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.employees.requests.EmployeeEndpointRequest; -import com.merge.api.resources.hris.employees.requests.EmployeesListRequest; -import com.merge.api.resources.hris.employees.requests.EmployeesRetrieveRequest; -import com.merge.api.resources.hris.employees.requests.IgnoreCommonModelRequest; -import com.merge.api.resources.hris.types.Employee; -import com.merge.api.resources.hris.types.EmployeeResponse; -import com.merge.api.resources.hris.types.MetaResponse; -import com.merge.api.resources.hris.types.PaginatedEmployeeList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EmployeesClient { - protected final ClientOptions clientOptions; - - public EmployeesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Employee objects. - */ - public PaginatedEmployeeList list() { - return list(EmployeesListRequest.builder().build()); - } - - /** - * Returns a list of Employee objects. - */ - public PaginatedEmployeeList list(EmployeesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Employee objects. - */ - public PaginatedEmployeeList list(EmployeesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employees"); - if (request.getCompanyId().isPresent()) { - httpUrl.addQueryParameter("company_id", request.getCompanyId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getDisplayFullName().isPresent()) { - httpUrl.addQueryParameter( - "display_full_name", request.getDisplayFullName().get()); - } - if (request.getEmploymentStatus().isPresent()) { - httpUrl.addQueryParameter( - "employment_status", request.getEmploymentStatus().get().toString()); - } - if (request.getEmploymentType().isPresent()) { - httpUrl.addQueryParameter( - "employment_type", request.getEmploymentType().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getFirstName().isPresent()) { - httpUrl.addQueryParameter("first_name", request.getFirstName().get()); - } - if (request.getGroups().isPresent()) { - httpUrl.addQueryParameter("groups", request.getGroups().get()); - } - if (request.getHomeLocationId().isPresent()) { - httpUrl.addQueryParameter( - "home_location_id", request.getHomeLocationId().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeSensitiveFields().isPresent()) { - httpUrl.addQueryParameter( - "include_sensitive_fields", - request.getIncludeSensitiveFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getJobTitle().isPresent()) { - httpUrl.addQueryParameter("job_title", request.getJobTitle().get()); - } - if (request.getLastName().isPresent()) { - httpUrl.addQueryParameter("last_name", request.getLastName().get()); - } - if (request.getManagerId().isPresent()) { - httpUrl.addQueryParameter("manager_id", request.getManagerId().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getPayGroupId().isPresent()) { - httpUrl.addQueryParameter("pay_group_id", request.getPayGroupId().get()); - } - if (request.getPersonalEmail().isPresent()) { - httpUrl.addQueryParameter( - "personal_email", request.getPersonalEmail().get()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - if (request.getStartedAfter().isPresent()) { - httpUrl.addQueryParameter( - "started_after", request.getStartedAfter().get().toString()); - } - if (request.getStartedBefore().isPresent()) { - httpUrl.addQueryParameter( - "started_before", request.getStartedBefore().get().toString()); - } - if (request.getTeamId().isPresent()) { - httpUrl.addQueryParameter("team_id", request.getTeamId().get()); - } - if (request.getTerminatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "terminated_after", request.getTerminatedAfter().get().toString()); - } - if (request.getTerminatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "terminated_before", request.getTerminatedBefore().get().toString()); - } - if (request.getWorkEmail().isPresent()) { - httpUrl.addQueryParameter("work_email", request.getWorkEmail().get()); - } - if (request.getWorkLocationId().isPresent()) { - httpUrl.addQueryParameter( - "work_location_id", request.getWorkLocationId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEmployeeList.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); - } - } - - /** - * Creates an Employee object with the given values. - */ - public EmployeeResponse create(EmployeeEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Employee object with the given values. - */ - public EmployeeResponse create(EmployeeEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employees"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), EmployeeResponse.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); - } - } - - /** - * Returns an Employee object with the given id. - */ - public Employee retrieve(String id) { - return retrieve(id, EmployeesRetrieveRequest.builder().build()); - } - - /** - * Returns an Employee object with the given id. - */ - public Employee retrieve(String id, EmployeesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Employee object with the given id. - */ - public Employee retrieve(String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employees") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeSensitiveFields().isPresent()) { - httpUrl.addQueryParameter( - "include_sensitive_fields", - request.getIncludeSensitiveFields().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Employee.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); - } - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { - ignoreCreate(modelId, request, null); - } - - /** - * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employees/ignore") - .addPathSegment(modelId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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; - } - 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); - } - } - - /** - * Returns metadata for Employee POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Employee POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employees/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeesListRequest.java b/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeesListRequest.java deleted file mode 100644 index 55c26a0f4..000000000 --- a/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeesListRequest.java +++ /dev/null @@ -1,1041 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employees.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.employees.types.EmployeesListRequestEmploymentStatus; -import com.merge.api.resources.hris.employees.types.EmployeesListRequestExpand; -import com.merge.api.resources.hris.employees.types.EmployeesListRequestRemoteFields; -import com.merge.api.resources.hris.employees.types.EmployeesListRequestShowEnumOrigins; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmployeesListRequest.Builder.class) -public final class EmployeesListRequest { - private final Optional companyId; - - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional displayFullName; - - private final Optional employmentStatus; - - private final Optional employmentType; - - private final Optional expand; - - private final Optional firstName; - - private final Optional groups; - - private final Optional homeLocationId; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeSensitiveFields; - - private final Optional includeShellData; - - private final Optional jobTitle; - - private final Optional lastName; - - private final Optional managerId; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional payGroupId; - - private final Optional personalEmail; - - private final Optional remoteFields; - - private final Optional remoteId; - - private final Optional showEnumOrigins; - - private final Optional startedAfter; - - private final Optional startedBefore; - - private final Optional teamId; - - private final Optional terminatedAfter; - - private final Optional terminatedBefore; - - private final Optional workEmail; - - private final Optional workLocationId; - - private final Map additionalProperties; - - private EmployeesListRequest( - Optional companyId, - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional displayFullName, - Optional employmentStatus, - Optional employmentType, - Optional expand, - Optional firstName, - Optional groups, - Optional homeLocationId, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeSensitiveFields, - Optional includeShellData, - Optional jobTitle, - Optional lastName, - Optional managerId, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional payGroupId, - Optional personalEmail, - Optional remoteFields, - Optional remoteId, - Optional showEnumOrigins, - Optional startedAfter, - Optional startedBefore, - Optional teamId, - Optional terminatedAfter, - Optional terminatedBefore, - Optional workEmail, - Optional workLocationId, - Map additionalProperties) { - this.companyId = companyId; - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.displayFullName = displayFullName; - this.employmentStatus = employmentStatus; - this.employmentType = employmentType; - this.expand = expand; - this.firstName = firstName; - this.groups = groups; - this.homeLocationId = homeLocationId; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeSensitiveFields = includeSensitiveFields; - this.includeShellData = includeShellData; - this.jobTitle = jobTitle; - this.lastName = lastName; - this.managerId = managerId; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.payGroupId = payGroupId; - this.personalEmail = personalEmail; - this.remoteFields = remoteFields; - this.remoteId = remoteId; - this.showEnumOrigins = showEnumOrigins; - this.startedAfter = startedAfter; - this.startedBefore = startedBefore; - this.teamId = teamId; - this.terminatedAfter = terminatedAfter; - this.terminatedBefore = terminatedBefore; - this.workEmail = workEmail; - this.workLocationId = workLocationId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return employees for this company. - */ - @JsonProperty("company_id") - public Optional getCompanyId() { - return companyId; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return employees with this display name. - */ - @JsonProperty("display_full_name") - public Optional getDisplayFullName() { - return displayFullName; - } - - /** - * @return If provided, will only return employees with this employment status. - *
    - *
  • ACTIVE - ACTIVE
  • - *
  • PENDING - PENDING
  • - *
  • INACTIVE - INACTIVE
  • - *
- */ - @JsonProperty("employment_status") - public Optional getEmploymentStatus() { - return employmentStatus; - } - - /** - * @return If provided, will only return employees that have an employment of the specified employment_type. - */ - @JsonProperty("employment_type") - public Optional getEmploymentType() { - return employmentType; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return If provided, will only return employees with this first name. - */ - @JsonProperty("first_name") - public Optional getFirstName() { - return firstName; - } - - /** - * @return If provided, will only return employees matching the group ids; multiple groups can be separated by commas. - */ - @JsonProperty("groups") - public Optional getGroups() { - return groups; - } - - /** - * @return If provided, will only return employees for this home location. - */ - @JsonProperty("home_location_id") - public Optional getHomeLocationId() { - return homeLocationId; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include sensitive fields (such as social security numbers) in the response. - */ - @JsonProperty("include_sensitive_fields") - public Optional getIncludeSensitiveFields() { - return includeSensitiveFields; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, will only return employees that have an employment of the specified job_title. - */ - @JsonProperty("job_title") - public Optional getJobTitle() { - return jobTitle; - } - - /** - * @return If provided, will only return employees with this last name. - */ - @JsonProperty("last_name") - public Optional getLastName() { - return lastName; - } - - /** - * @return If provided, will only return employees for this manager. - */ - @JsonProperty("manager_id") - public Optional getManagerId() { - return managerId; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If provided, will only return employees for this pay group - */ - @JsonProperty("pay_group_id") - public Optional getPayGroupId() { - return payGroupId; - } - - /** - * @return If provided, will only return Employees with this personal email - */ - @JsonProperty("personal_email") - public Optional getPersonalEmail() { - return personalEmail; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - /** - * @return If provided, will only return employees that started after this datetime. - */ - @JsonProperty("started_after") - public Optional getStartedAfter() { - return startedAfter; - } - - /** - * @return If provided, will only return employees that started before this datetime. - */ - @JsonProperty("started_before") - public Optional getStartedBefore() { - return startedBefore; - } - - /** - * @return If provided, will only return employees for this team. - */ - @JsonProperty("team_id") - public Optional getTeamId() { - return teamId; - } - - /** - * @return If provided, will only return employees that were terminated after this datetime. - */ - @JsonProperty("terminated_after") - public Optional getTerminatedAfter() { - return terminatedAfter; - } - - /** - * @return If provided, will only return employees that were terminated before this datetime. - */ - @JsonProperty("terminated_before") - public Optional getTerminatedBefore() { - return terminatedBefore; - } - - /** - * @return If provided, will only return Employees with this work email - */ - @JsonProperty("work_email") - public Optional getWorkEmail() { - return workEmail; - } - - /** - * @return If provided, will only return employees for this location. - */ - @JsonProperty("work_location_id") - public Optional getWorkLocationId() { - return workLocationId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeesListRequest && equalTo((EmployeesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmployeesListRequest other) { - return companyId.equals(other.companyId) - && createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && displayFullName.equals(other.displayFullName) - && employmentStatus.equals(other.employmentStatus) - && employmentType.equals(other.employmentType) - && expand.equals(other.expand) - && firstName.equals(other.firstName) - && groups.equals(other.groups) - && homeLocationId.equals(other.homeLocationId) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeSensitiveFields.equals(other.includeSensitiveFields) - && includeShellData.equals(other.includeShellData) - && jobTitle.equals(other.jobTitle) - && lastName.equals(other.lastName) - && managerId.equals(other.managerId) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && payGroupId.equals(other.payGroupId) - && personalEmail.equals(other.personalEmail) - && remoteFields.equals(other.remoteFields) - && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins) - && startedAfter.equals(other.startedAfter) - && startedBefore.equals(other.startedBefore) - && teamId.equals(other.teamId) - && terminatedAfter.equals(other.terminatedAfter) - && terminatedBefore.equals(other.terminatedBefore) - && workEmail.equals(other.workEmail) - && workLocationId.equals(other.workLocationId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.companyId, - this.createdAfter, - this.createdBefore, - this.cursor, - this.displayFullName, - this.employmentStatus, - this.employmentType, - this.expand, - this.firstName, - this.groups, - this.homeLocationId, - this.includeDeletedData, - this.includeRemoteData, - this.includeSensitiveFields, - this.includeShellData, - this.jobTitle, - this.lastName, - this.managerId, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.payGroupId, - this.personalEmail, - this.remoteFields, - this.remoteId, - this.showEnumOrigins, - this.startedAfter, - this.startedBefore, - this.teamId, - this.terminatedAfter, - this.terminatedBefore, - this.workEmail, - this.workLocationId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional companyId = Optional.empty(); - - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional displayFullName = Optional.empty(); - - private Optional employmentStatus = Optional.empty(); - - private Optional employmentType = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional firstName = Optional.empty(); - - private Optional groups = Optional.empty(); - - private Optional homeLocationId = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeSensitiveFields = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional jobTitle = Optional.empty(); - - private Optional lastName = Optional.empty(); - - private Optional managerId = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional payGroupId = Optional.empty(); - - private Optional personalEmail = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - private Optional startedAfter = Optional.empty(); - - private Optional startedBefore = Optional.empty(); - - private Optional teamId = Optional.empty(); - - private Optional terminatedAfter = Optional.empty(); - - private Optional terminatedBefore = Optional.empty(); - - private Optional workEmail = Optional.empty(); - - private Optional workLocationId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmployeesListRequest other) { - companyId(other.getCompanyId()); - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - displayFullName(other.getDisplayFullName()); - employmentStatus(other.getEmploymentStatus()); - employmentType(other.getEmploymentType()); - expand(other.getExpand()); - firstName(other.getFirstName()); - groups(other.getGroups()); - homeLocationId(other.getHomeLocationId()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeSensitiveFields(other.getIncludeSensitiveFields()); - includeShellData(other.getIncludeShellData()); - jobTitle(other.getJobTitle()); - lastName(other.getLastName()); - managerId(other.getManagerId()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - payGroupId(other.getPayGroupId()); - personalEmail(other.getPersonalEmail()); - remoteFields(other.getRemoteFields()); - remoteId(other.getRemoteId()); - showEnumOrigins(other.getShowEnumOrigins()); - startedAfter(other.getStartedAfter()); - startedBefore(other.getStartedBefore()); - teamId(other.getTeamId()); - terminatedAfter(other.getTerminatedAfter()); - terminatedBefore(other.getTerminatedBefore()); - workEmail(other.getWorkEmail()); - workLocationId(other.getWorkLocationId()); - return this; - } - - @JsonSetter(value = "company_id", nulls = Nulls.SKIP) - public Builder companyId(Optional companyId) { - this.companyId = companyId; - return this; - } - - public Builder companyId(String companyId) { - this.companyId = Optional.ofNullable(companyId); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "display_full_name", nulls = Nulls.SKIP) - public Builder displayFullName(Optional displayFullName) { - this.displayFullName = displayFullName; - return this; - } - - public Builder displayFullName(String displayFullName) { - this.displayFullName = Optional.ofNullable(displayFullName); - return this; - } - - @JsonSetter(value = "employment_status", nulls = Nulls.SKIP) - public Builder employmentStatus(Optional employmentStatus) { - this.employmentStatus = employmentStatus; - return this; - } - - public Builder employmentStatus(EmployeesListRequestEmploymentStatus employmentStatus) { - this.employmentStatus = Optional.ofNullable(employmentStatus); - return this; - } - - @JsonSetter(value = "employment_type", nulls = Nulls.SKIP) - public Builder employmentType(Optional employmentType) { - this.employmentType = employmentType; - return this; - } - - public Builder employmentType(String employmentType) { - this.employmentType = Optional.ofNullable(employmentType); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EmployeesListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "first_name", nulls = Nulls.SKIP) - public Builder firstName(Optional firstName) { - this.firstName = firstName; - return this; - } - - public Builder firstName(String firstName) { - this.firstName = Optional.ofNullable(firstName); - return this; - } - - @JsonSetter(value = "groups", nulls = Nulls.SKIP) - public Builder groups(Optional groups) { - this.groups = groups; - return this; - } - - public Builder groups(String groups) { - this.groups = Optional.ofNullable(groups); - return this; - } - - @JsonSetter(value = "home_location_id", nulls = Nulls.SKIP) - public Builder homeLocationId(Optional homeLocationId) { - this.homeLocationId = homeLocationId; - return this; - } - - public Builder homeLocationId(String homeLocationId) { - this.homeLocationId = Optional.ofNullable(homeLocationId); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_sensitive_fields", nulls = Nulls.SKIP) - public Builder includeSensitiveFields(Optional includeSensitiveFields) { - this.includeSensitiveFields = includeSensitiveFields; - return this; - } - - public Builder includeSensitiveFields(Boolean includeSensitiveFields) { - this.includeSensitiveFields = Optional.ofNullable(includeSensitiveFields); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "job_title", nulls = Nulls.SKIP) - public Builder jobTitle(Optional jobTitle) { - this.jobTitle = jobTitle; - return this; - } - - public Builder jobTitle(String jobTitle) { - this.jobTitle = Optional.ofNullable(jobTitle); - return this; - } - - @JsonSetter(value = "last_name", nulls = Nulls.SKIP) - public Builder lastName(Optional lastName) { - this.lastName = lastName; - return this; - } - - public Builder lastName(String lastName) { - this.lastName = Optional.ofNullable(lastName); - return this; - } - - @JsonSetter(value = "manager_id", nulls = Nulls.SKIP) - public Builder managerId(Optional managerId) { - this.managerId = managerId; - return this; - } - - public Builder managerId(String managerId) { - this.managerId = Optional.ofNullable(managerId); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "pay_group_id", nulls = Nulls.SKIP) - public Builder payGroupId(Optional payGroupId) { - this.payGroupId = payGroupId; - return this; - } - - public Builder payGroupId(String payGroupId) { - this.payGroupId = Optional.ofNullable(payGroupId); - return this; - } - - @JsonSetter(value = "personal_email", nulls = Nulls.SKIP) - public Builder personalEmail(Optional personalEmail) { - this.personalEmail = personalEmail; - return this; - } - - public Builder personalEmail(String personalEmail) { - this.personalEmail = Optional.ofNullable(personalEmail); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(EmployeesListRequestRemoteFields remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(EmployeesListRequestShowEnumOrigins showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - @JsonSetter(value = "started_after", nulls = Nulls.SKIP) - public Builder startedAfter(Optional startedAfter) { - this.startedAfter = startedAfter; - return this; - } - - public Builder startedAfter(OffsetDateTime startedAfter) { - this.startedAfter = Optional.ofNullable(startedAfter); - return this; - } - - @JsonSetter(value = "started_before", nulls = Nulls.SKIP) - public Builder startedBefore(Optional startedBefore) { - this.startedBefore = startedBefore; - return this; - } - - public Builder startedBefore(OffsetDateTime startedBefore) { - this.startedBefore = Optional.ofNullable(startedBefore); - return this; - } - - @JsonSetter(value = "team_id", nulls = Nulls.SKIP) - public Builder teamId(Optional teamId) { - this.teamId = teamId; - return this; - } - - public Builder teamId(String teamId) { - this.teamId = Optional.ofNullable(teamId); - return this; - } - - @JsonSetter(value = "terminated_after", nulls = Nulls.SKIP) - public Builder terminatedAfter(Optional terminatedAfter) { - this.terminatedAfter = terminatedAfter; - return this; - } - - public Builder terminatedAfter(OffsetDateTime terminatedAfter) { - this.terminatedAfter = Optional.ofNullable(terminatedAfter); - return this; - } - - @JsonSetter(value = "terminated_before", nulls = Nulls.SKIP) - public Builder terminatedBefore(Optional terminatedBefore) { - this.terminatedBefore = terminatedBefore; - return this; - } - - public Builder terminatedBefore(OffsetDateTime terminatedBefore) { - this.terminatedBefore = Optional.ofNullable(terminatedBefore); - return this; - } - - @JsonSetter(value = "work_email", nulls = Nulls.SKIP) - public Builder workEmail(Optional workEmail) { - this.workEmail = workEmail; - return this; - } - - public Builder workEmail(String workEmail) { - this.workEmail = Optional.ofNullable(workEmail); - return this; - } - - @JsonSetter(value = "work_location_id", nulls = Nulls.SKIP) - public Builder workLocationId(Optional workLocationId) { - this.workLocationId = workLocationId; - return this; - } - - public Builder workLocationId(String workLocationId) { - this.workLocationId = Optional.ofNullable(workLocationId); - return this; - } - - public EmployeesListRequest build() { - return new EmployeesListRequest( - companyId, - createdAfter, - createdBefore, - cursor, - displayFullName, - employmentStatus, - employmentType, - expand, - firstName, - groups, - homeLocationId, - includeDeletedData, - includeRemoteData, - includeSensitiveFields, - includeShellData, - jobTitle, - lastName, - managerId, - modifiedAfter, - modifiedBefore, - pageSize, - payGroupId, - personalEmail, - remoteFields, - remoteId, - showEnumOrigins, - startedAfter, - startedBefore, - teamId, - terminatedAfter, - terminatedBefore, - workEmail, - workLocationId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeesRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeesRetrieveRequest.java deleted file mode 100644 index b9b16a87d..000000000 --- a/src/main/java/com/merge/api/resources/hris/employees/requests/EmployeesRetrieveRequest.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employees.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.employees.types.EmployeesRetrieveRequestExpand; -import com.merge.api.resources.hris.employees.types.EmployeesRetrieveRequestRemoteFields; -import com.merge.api.resources.hris.employees.types.EmployeesRetrieveRequestShowEnumOrigins; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmployeesRetrieveRequest.Builder.class) -public final class EmployeesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional includeSensitiveFields; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private EmployeesRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional includeSensitiveFields, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.includeSensitiveFields = includeSensitiveFields; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include sensitive fields (such as social security numbers) in the response. - */ - @JsonProperty("include_sensitive_fields") - public Optional getIncludeSensitiveFields() { - return includeSensitiveFields; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeesRetrieveRequest && equalTo((EmployeesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmployeesRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && includeSensitiveFields.equals(other.includeSensitiveFields) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.expand, - this.includeRemoteData, - this.includeSensitiveFields, - this.remoteFields, - this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeSensitiveFields = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmployeesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - includeSensitiveFields(other.getIncludeSensitiveFields()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EmployeesRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_sensitive_fields", nulls = Nulls.SKIP) - public Builder includeSensitiveFields(Optional includeSensitiveFields) { - this.includeSensitiveFields = includeSensitiveFields; - return this; - } - - public Builder includeSensitiveFields(Boolean includeSensitiveFields) { - this.includeSensitiveFields = Optional.ofNullable(includeSensitiveFields); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(EmployeesRetrieveRequestRemoteFields remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(EmployeesRetrieveRequestShowEnumOrigins showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public EmployeesRetrieveRequest build() { - return new EmployeesRetrieveRequest( - expand, - includeRemoteData, - includeSensitiveFields, - remoteFields, - showEnumOrigins, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employees/requests/IgnoreCommonModelRequest.java b/src/main/java/com/merge/api/resources/hris/employees/requests/IgnoreCommonModelRequest.java deleted file mode 100644 index 7675eca84..000000000 --- a/src/main/java/com/merge/api/resources/hris/employees/requests/IgnoreCommonModelRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employees.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.employees.types.IgnoreCommonModelRequestReason; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IgnoreCommonModelRequest.Builder.class) -public final class IgnoreCommonModelRequest { - private final IgnoreCommonModelRequestReason reason; - - private final Optional message; - - private final Map additionalProperties; - - private IgnoreCommonModelRequest( - IgnoreCommonModelRequestReason reason, Optional message, Map additionalProperties) { - this.reason = reason; - this.message = message; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("reason") - public IgnoreCommonModelRequestReason getReason() { - return reason; - } - - @JsonProperty("message") - public Optional getMessage() { - return message; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IgnoreCommonModelRequest && equalTo((IgnoreCommonModelRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IgnoreCommonModelRequest other) { - return reason.equals(other.reason) && message.equals(other.message); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.reason, this.message); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ReasonStage builder() { - return new Builder(); - } - - public interface ReasonStage { - _FinalStage reason(@NotNull IgnoreCommonModelRequestReason reason); - - Builder from(IgnoreCommonModelRequest other); - } - - public interface _FinalStage { - IgnoreCommonModelRequest build(); - - _FinalStage message(Optional message); - - _FinalStage message(String message); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ReasonStage, _FinalStage { - private IgnoreCommonModelRequestReason reason; - - private Optional message = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IgnoreCommonModelRequest other) { - reason(other.getReason()); - message(other.getMessage()); - return this; - } - - @java.lang.Override - @JsonSetter("reason") - public _FinalStage reason(@NotNull IgnoreCommonModelRequestReason reason) { - this.reason = reason; - return this; - } - - @java.lang.Override - public _FinalStage message(String message) { - this.message = Optional.ofNullable(message); - return this; - } - - @java.lang.Override - @JsonSetter(value = "message", nulls = Nulls.SKIP) - public _FinalStage message(Optional message) { - this.message = message; - return this; - } - - @java.lang.Override - public IgnoreCommonModelRequest build() { - return new IgnoreCommonModelRequest(reason, message, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestExpand.java b/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestExpand.java deleted file mode 100644 index f92f35628..000000000 --- a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesListRequestExpand.java +++ /dev/null @@ -1,560 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employees.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EmployeesListRequestExpand { - COMPANY("company"), - - COMPANY_PAY_GROUP("company,pay_group"), - - EMPLOYMENTS("employments"), - - EMPLOYMENTS_COMPANY("employments,company"), - - EMPLOYMENTS_COMPANY_PAY_GROUP("employments,company,pay_group"), - - EMPLOYMENTS_GROUPS("employments,groups"), - - EMPLOYMENTS_GROUPS_COMPANY("employments,groups,company"), - - EMPLOYMENTS_GROUPS_COMPANY_PAY_GROUP("employments,groups,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION("employments,groups,home_location"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_COMPANY("employments,groups,home_location,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_COMPANY_PAY_GROUP("employments,groups,home_location,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER("employments,groups,home_location,manager"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_COMPANY("employments,groups,home_location,manager,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,groups,home_location,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_PAY_GROUP("employments,groups,home_location,manager,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM("employments,groups,home_location,manager,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY("employments,groups,home_location,manager,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,groups,home_location,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,groups,home_location,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_PAY_GROUP("employments,groups,home_location,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM("employments,groups,home_location,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM_COMPANY("employments,groups,home_location,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,groups,home_location,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM_PAY_GROUP("employments,groups,home_location,team,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION("employments,groups,home_location,work_location"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY("employments,groups,home_location,work_location,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER("employments,groups,home_location,work_location,manager"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY( - "employments,groups,home_location,work_location,manager,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP( - "employments,groups,home_location,work_location,manager,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM( - "employments,groups,home_location,work_location,manager,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY( - "employments,groups,home_location,work_location,manager,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP( - "employments,groups,home_location,work_location,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_PAY_GROUP( - "employments,groups,home_location,work_location,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM("employments,groups,home_location,work_location,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY( - "employments,groups,home_location,work_location,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP( - "employments,groups,home_location,work_location,team,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER("employments,groups,manager"), - - EMPLOYMENTS_GROUPS_MANAGER_COMPANY("employments,groups,manager,company"), - - EMPLOYMENTS_GROUPS_MANAGER_COMPANY_PAY_GROUP("employments,groups,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER_PAY_GROUP("employments,groups,manager,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM("employments,groups,manager,team"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM_COMPANY("employments,groups,manager,team,company"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM_COMPANY_PAY_GROUP("employments,groups,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM_PAY_GROUP("employments,groups,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_PAY_GROUP("employments,groups,pay_group"), - - EMPLOYMENTS_GROUPS_TEAM("employments,groups,team"), - - EMPLOYMENTS_GROUPS_TEAM_COMPANY("employments,groups,team,company"), - - EMPLOYMENTS_GROUPS_TEAM_COMPANY_PAY_GROUP("employments,groups,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_TEAM_PAY_GROUP("employments,groups,team,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION("employments,groups,work_location"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_COMPANY("employments,groups,work_location,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_COMPANY_PAY_GROUP("employments,groups,work_location,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER("employments,groups,work_location,manager"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_COMPANY("employments,groups,work_location,manager,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,groups,work_location,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_PAY_GROUP("employments,groups,work_location,manager,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM("employments,groups,work_location,manager,team"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY("employments,groups,work_location,manager,team,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,groups,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,groups,work_location,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_PAY_GROUP("employments,groups,work_location,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM("employments,groups,work_location,team"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM_COMPANY("employments,groups,work_location,team,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,groups,work_location,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM_PAY_GROUP("employments,groups,work_location,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION("employments,home_location"), - - EMPLOYMENTS_HOME_LOCATION_COMPANY("employments,home_location,company"), - - EMPLOYMENTS_HOME_LOCATION_COMPANY_PAY_GROUP("employments,home_location,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER("employments,home_location,manager"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_COMPANY("employments,home_location,manager,company"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP("employments,home_location,manager,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_PAY_GROUP("employments,home_location,manager,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM("employments,home_location,manager,team"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM_COMPANY("employments,home_location,manager,team,company"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,home_location,manager,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,home_location,manager,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_PAY_GROUP("employments,home_location,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_TEAM("employments,home_location,team"), - - EMPLOYMENTS_HOME_LOCATION_TEAM_COMPANY("employments,home_location,team,company"), - - EMPLOYMENTS_HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,home_location,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_TEAM_PAY_GROUP("employments,home_location,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION("employments,home_location,work_location"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_COMPANY("employments,home_location,work_location,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP( - "employments,home_location,work_location,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER("employments,home_location,work_location,manager"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY("employments,home_location,work_location,manager,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,home_location,work_location,manager,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP( - "employments,home_location,work_location,manager,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM("employments,home_location,work_location,manager,team"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY( - "employments,home_location,work_location,manager,team,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,home_location,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP( - "employments,home_location,work_location,manager,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_PAY_GROUP("employments,home_location,work_location,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM("employments,home_location,work_location,team"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY("employments,home_location,work_location,team,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP( - "employments,home_location,work_location,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP("employments,home_location,work_location,team,pay_group"), - - EMPLOYMENTS_MANAGER("employments,manager"), - - EMPLOYMENTS_MANAGER_COMPANY("employments,manager,company"), - - EMPLOYMENTS_MANAGER_COMPANY_PAY_GROUP("employments,manager,company,pay_group"), - - EMPLOYMENTS_MANAGER_PAY_GROUP("employments,manager,pay_group"), - - EMPLOYMENTS_MANAGER_TEAM("employments,manager,team"), - - EMPLOYMENTS_MANAGER_TEAM_COMPANY("employments,manager,team,company"), - - EMPLOYMENTS_MANAGER_TEAM_COMPANY_PAY_GROUP("employments,manager,team,company,pay_group"), - - EMPLOYMENTS_MANAGER_TEAM_PAY_GROUP("employments,manager,team,pay_group"), - - EMPLOYMENTS_PAY_GROUP("employments,pay_group"), - - EMPLOYMENTS_TEAM("employments,team"), - - EMPLOYMENTS_TEAM_COMPANY("employments,team,company"), - - EMPLOYMENTS_TEAM_COMPANY_PAY_GROUP("employments,team,company,pay_group"), - - EMPLOYMENTS_TEAM_PAY_GROUP("employments,team,pay_group"), - - EMPLOYMENTS_WORK_LOCATION("employments,work_location"), - - EMPLOYMENTS_WORK_LOCATION_COMPANY("employments,work_location,company"), - - EMPLOYMENTS_WORK_LOCATION_COMPANY_PAY_GROUP("employments,work_location,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER("employments,work_location,manager"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_COMPANY("employments,work_location,manager,company"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("employments,work_location,manager,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_PAY_GROUP("employments,work_location,manager,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM("employments,work_location,manager,team"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM_COMPANY("employments,work_location,manager,team,company"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,work_location,manager,team,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_PAY_GROUP("employments,work_location,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_TEAM("employments,work_location,team"), - - EMPLOYMENTS_WORK_LOCATION_TEAM_COMPANY("employments,work_location,team,company"), - - EMPLOYMENTS_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,work_location,team,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_TEAM_PAY_GROUP("employments,work_location,team,pay_group"), - - GROUPS("groups"), - - GROUPS_COMPANY("groups,company"), - - GROUPS_COMPANY_PAY_GROUP("groups,company,pay_group"), - - GROUPS_HOME_LOCATION("groups,home_location"), - - GROUPS_HOME_LOCATION_COMPANY("groups,home_location,company"), - - GROUPS_HOME_LOCATION_COMPANY_PAY_GROUP("groups,home_location,company,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER("groups,home_location,manager"), - - GROUPS_HOME_LOCATION_MANAGER_COMPANY("groups,home_location,manager,company"), - - GROUPS_HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP("groups,home_location,manager,company,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER_PAY_GROUP("groups,home_location,manager,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM("groups,home_location,manager,team"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY("groups,home_location,manager,team,company"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("groups,home_location,manager,team,company,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("groups,home_location,manager,team,pay_group"), - - GROUPS_HOME_LOCATION_PAY_GROUP("groups,home_location,pay_group"), - - GROUPS_HOME_LOCATION_TEAM("groups,home_location,team"), - - GROUPS_HOME_LOCATION_TEAM_COMPANY("groups,home_location,team,company"), - - GROUPS_HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("groups,home_location,team,company,pay_group"), - - GROUPS_HOME_LOCATION_TEAM_PAY_GROUP("groups,home_location,team,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION("groups,home_location,work_location"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY("groups,home_location,work_location,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP("groups,home_location,work_location,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER("groups,home_location,work_location,manager"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY("groups,home_location,work_location,manager,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "groups,home_location,work_location,manager,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP("groups,home_location,work_location,manager,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM("groups,home_location,work_location,manager,team"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY("groups,home_location,work_location,manager,team,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "groups,home_location,work_location,manager,team,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP( - "groups,home_location,work_location,manager,team,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_PAY_GROUP("groups,home_location,work_location,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM("groups,home_location,work_location,team"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY("groups,home_location,work_location,team,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP( - "groups,home_location,work_location,team,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP("groups,home_location,work_location,team,pay_group"), - - GROUPS_MANAGER("groups,manager"), - - GROUPS_MANAGER_COMPANY("groups,manager,company"), - - GROUPS_MANAGER_COMPANY_PAY_GROUP("groups,manager,company,pay_group"), - - GROUPS_MANAGER_PAY_GROUP("groups,manager,pay_group"), - - GROUPS_MANAGER_TEAM("groups,manager,team"), - - GROUPS_MANAGER_TEAM_COMPANY("groups,manager,team,company"), - - GROUPS_MANAGER_TEAM_COMPANY_PAY_GROUP("groups,manager,team,company,pay_group"), - - GROUPS_MANAGER_TEAM_PAY_GROUP("groups,manager,team,pay_group"), - - GROUPS_PAY_GROUP("groups,pay_group"), - - GROUPS_TEAM("groups,team"), - - GROUPS_TEAM_COMPANY("groups,team,company"), - - GROUPS_TEAM_COMPANY_PAY_GROUP("groups,team,company,pay_group"), - - GROUPS_TEAM_PAY_GROUP("groups,team,pay_group"), - - GROUPS_WORK_LOCATION("groups,work_location"), - - GROUPS_WORK_LOCATION_COMPANY("groups,work_location,company"), - - GROUPS_WORK_LOCATION_COMPANY_PAY_GROUP("groups,work_location,company,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER("groups,work_location,manager"), - - GROUPS_WORK_LOCATION_MANAGER_COMPANY("groups,work_location,manager,company"), - - GROUPS_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("groups,work_location,manager,company,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER_PAY_GROUP("groups,work_location,manager,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM("groups,work_location,manager,team"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY("groups,work_location,manager,team,company"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("groups,work_location,manager,team,company,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("groups,work_location,manager,team,pay_group"), - - GROUPS_WORK_LOCATION_PAY_GROUP("groups,work_location,pay_group"), - - GROUPS_WORK_LOCATION_TEAM("groups,work_location,team"), - - GROUPS_WORK_LOCATION_TEAM_COMPANY("groups,work_location,team,company"), - - GROUPS_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("groups,work_location,team,company,pay_group"), - - GROUPS_WORK_LOCATION_TEAM_PAY_GROUP("groups,work_location,team,pay_group"), - - HOME_LOCATION("home_location"), - - HOME_LOCATION_COMPANY("home_location,company"), - - HOME_LOCATION_COMPANY_PAY_GROUP("home_location,company,pay_group"), - - HOME_LOCATION_MANAGER("home_location,manager"), - - HOME_LOCATION_MANAGER_COMPANY("home_location,manager,company"), - - HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP("home_location,manager,company,pay_group"), - - HOME_LOCATION_MANAGER_PAY_GROUP("home_location,manager,pay_group"), - - HOME_LOCATION_MANAGER_TEAM("home_location,manager,team"), - - HOME_LOCATION_MANAGER_TEAM_COMPANY("home_location,manager,team,company"), - - HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("home_location,manager,team,company,pay_group"), - - HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("home_location,manager,team,pay_group"), - - HOME_LOCATION_PAY_GROUP("home_location,pay_group"), - - HOME_LOCATION_TEAM("home_location,team"), - - HOME_LOCATION_TEAM_COMPANY("home_location,team,company"), - - HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("home_location,team,company,pay_group"), - - HOME_LOCATION_TEAM_PAY_GROUP("home_location,team,pay_group"), - - HOME_LOCATION_WORK_LOCATION("home_location,work_location"), - - HOME_LOCATION_WORK_LOCATION_COMPANY("home_location,work_location,company"), - - HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP("home_location,work_location,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER("home_location,work_location,manager"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY("home_location,work_location,manager,company"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("home_location,work_location,manager,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP("home_location,work_location,manager,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM("home_location,work_location,manager,team"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY("home_location,work_location,manager,team,company"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "home_location,work_location,manager,team,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("home_location,work_location,manager,team,pay_group"), - - HOME_LOCATION_WORK_LOCATION_PAY_GROUP("home_location,work_location,pay_group"), - - HOME_LOCATION_WORK_LOCATION_TEAM("home_location,work_location,team"), - - HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY("home_location,work_location,team,company"), - - HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("home_location,work_location,team,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP("home_location,work_location,team,pay_group"), - - MANAGER("manager"), - - MANAGER_COMPANY("manager,company"), - - MANAGER_COMPANY_PAY_GROUP("manager,company,pay_group"), - - MANAGER_PAY_GROUP("manager,pay_group"), - - MANAGER_TEAM("manager,team"), - - MANAGER_TEAM_COMPANY("manager,team,company"), - - MANAGER_TEAM_COMPANY_PAY_GROUP("manager,team,company,pay_group"), - - MANAGER_TEAM_PAY_GROUP("manager,team,pay_group"), - - PAY_GROUP("pay_group"), - - TEAM("team"), - - TEAM_COMPANY("team,company"), - - TEAM_COMPANY_PAY_GROUP("team,company,pay_group"), - - TEAM_PAY_GROUP("team,pay_group"), - - WORK_LOCATION("work_location"), - - WORK_LOCATION_COMPANY("work_location,company"), - - WORK_LOCATION_COMPANY_PAY_GROUP("work_location,company,pay_group"), - - WORK_LOCATION_MANAGER("work_location,manager"), - - WORK_LOCATION_MANAGER_COMPANY("work_location,manager,company"), - - WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("work_location,manager,company,pay_group"), - - WORK_LOCATION_MANAGER_PAY_GROUP("work_location,manager,pay_group"), - - WORK_LOCATION_MANAGER_TEAM("work_location,manager,team"), - - WORK_LOCATION_MANAGER_TEAM_COMPANY("work_location,manager,team,company"), - - WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("work_location,manager,team,company,pay_group"), - - WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("work_location,manager,team,pay_group"), - - WORK_LOCATION_PAY_GROUP("work_location,pay_group"), - - WORK_LOCATION_TEAM("work_location,team"), - - WORK_LOCATION_TEAM_COMPANY("work_location,team,company"), - - WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("work_location,team,company,pay_group"), - - WORK_LOCATION_TEAM_PAY_GROUP("work_location,team,pay_group"); - - private final String value; - - EmployeesListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestExpand.java deleted file mode 100644 index 52c8bf29b..000000000 --- a/src/main/java/com/merge/api/resources/hris/employees/types/EmployeesRetrieveRequestExpand.java +++ /dev/null @@ -1,560 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employees.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EmployeesRetrieveRequestExpand { - COMPANY("company"), - - COMPANY_PAY_GROUP("company,pay_group"), - - EMPLOYMENTS("employments"), - - EMPLOYMENTS_COMPANY("employments,company"), - - EMPLOYMENTS_COMPANY_PAY_GROUP("employments,company,pay_group"), - - EMPLOYMENTS_GROUPS("employments,groups"), - - EMPLOYMENTS_GROUPS_COMPANY("employments,groups,company"), - - EMPLOYMENTS_GROUPS_COMPANY_PAY_GROUP("employments,groups,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION("employments,groups,home_location"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_COMPANY("employments,groups,home_location,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_COMPANY_PAY_GROUP("employments,groups,home_location,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER("employments,groups,home_location,manager"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_COMPANY("employments,groups,home_location,manager,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,groups,home_location,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_PAY_GROUP("employments,groups,home_location,manager,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM("employments,groups,home_location,manager,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY("employments,groups,home_location,manager,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,groups,home_location,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,groups,home_location,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_PAY_GROUP("employments,groups,home_location,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM("employments,groups,home_location,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM_COMPANY("employments,groups,home_location,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,groups,home_location,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_TEAM_PAY_GROUP("employments,groups,home_location,team,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION("employments,groups,home_location,work_location"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY("employments,groups,home_location,work_location,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER("employments,groups,home_location,work_location,manager"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY( - "employments,groups,home_location,work_location,manager,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP( - "employments,groups,home_location,work_location,manager,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM( - "employments,groups,home_location,work_location,manager,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY( - "employments,groups,home_location,work_location,manager,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP( - "employments,groups,home_location,work_location,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_PAY_GROUP( - "employments,groups,home_location,work_location,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM("employments,groups,home_location,work_location,team"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY( - "employments,groups,home_location,work_location,team,company"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP( - "employments,groups,home_location,work_location,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP( - "employments,groups,home_location,work_location,team,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER("employments,groups,manager"), - - EMPLOYMENTS_GROUPS_MANAGER_COMPANY("employments,groups,manager,company"), - - EMPLOYMENTS_GROUPS_MANAGER_COMPANY_PAY_GROUP("employments,groups,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER_PAY_GROUP("employments,groups,manager,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM("employments,groups,manager,team"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM_COMPANY("employments,groups,manager,team,company"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM_COMPANY_PAY_GROUP("employments,groups,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_MANAGER_TEAM_PAY_GROUP("employments,groups,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_PAY_GROUP("employments,groups,pay_group"), - - EMPLOYMENTS_GROUPS_TEAM("employments,groups,team"), - - EMPLOYMENTS_GROUPS_TEAM_COMPANY("employments,groups,team,company"), - - EMPLOYMENTS_GROUPS_TEAM_COMPANY_PAY_GROUP("employments,groups,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_TEAM_PAY_GROUP("employments,groups,team,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION("employments,groups,work_location"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_COMPANY("employments,groups,work_location,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_COMPANY_PAY_GROUP("employments,groups,work_location,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER("employments,groups,work_location,manager"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_COMPANY("employments,groups,work_location,manager,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,groups,work_location,manager,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_PAY_GROUP("employments,groups,work_location,manager,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM("employments,groups,work_location,manager,team"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY("employments,groups,work_location,manager,team,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,groups,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,groups,work_location,manager,team,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_PAY_GROUP("employments,groups,work_location,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM("employments,groups,work_location,team"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM_COMPANY("employments,groups,work_location,team,company"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,groups,work_location,team,company,pay_group"), - - EMPLOYMENTS_GROUPS_WORK_LOCATION_TEAM_PAY_GROUP("employments,groups,work_location,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION("employments,home_location"), - - EMPLOYMENTS_HOME_LOCATION_COMPANY("employments,home_location,company"), - - EMPLOYMENTS_HOME_LOCATION_COMPANY_PAY_GROUP("employments,home_location,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER("employments,home_location,manager"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_COMPANY("employments,home_location,manager,company"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP("employments,home_location,manager,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_PAY_GROUP("employments,home_location,manager,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM("employments,home_location,manager,team"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM_COMPANY("employments,home_location,manager,team,company"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,home_location,manager,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,home_location,manager,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_PAY_GROUP("employments,home_location,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_TEAM("employments,home_location,team"), - - EMPLOYMENTS_HOME_LOCATION_TEAM_COMPANY("employments,home_location,team,company"), - - EMPLOYMENTS_HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,home_location,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_TEAM_PAY_GROUP("employments,home_location,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION("employments,home_location,work_location"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_COMPANY("employments,home_location,work_location,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP( - "employments,home_location,work_location,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER("employments,home_location,work_location,manager"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY("employments,home_location,work_location,manager,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "employments,home_location,work_location,manager,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP( - "employments,home_location,work_location,manager,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM("employments,home_location,work_location,manager,team"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY( - "employments,home_location,work_location,manager,team,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,home_location,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP( - "employments,home_location,work_location,manager,team,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_PAY_GROUP("employments,home_location,work_location,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM("employments,home_location,work_location,team"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY("employments,home_location,work_location,team,company"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP( - "employments,home_location,work_location,team,company,pay_group"), - - EMPLOYMENTS_HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP("employments,home_location,work_location,team,pay_group"), - - EMPLOYMENTS_MANAGER("employments,manager"), - - EMPLOYMENTS_MANAGER_COMPANY("employments,manager,company"), - - EMPLOYMENTS_MANAGER_COMPANY_PAY_GROUP("employments,manager,company,pay_group"), - - EMPLOYMENTS_MANAGER_PAY_GROUP("employments,manager,pay_group"), - - EMPLOYMENTS_MANAGER_TEAM("employments,manager,team"), - - EMPLOYMENTS_MANAGER_TEAM_COMPANY("employments,manager,team,company"), - - EMPLOYMENTS_MANAGER_TEAM_COMPANY_PAY_GROUP("employments,manager,team,company,pay_group"), - - EMPLOYMENTS_MANAGER_TEAM_PAY_GROUP("employments,manager,team,pay_group"), - - EMPLOYMENTS_PAY_GROUP("employments,pay_group"), - - EMPLOYMENTS_TEAM("employments,team"), - - EMPLOYMENTS_TEAM_COMPANY("employments,team,company"), - - EMPLOYMENTS_TEAM_COMPANY_PAY_GROUP("employments,team,company,pay_group"), - - EMPLOYMENTS_TEAM_PAY_GROUP("employments,team,pay_group"), - - EMPLOYMENTS_WORK_LOCATION("employments,work_location"), - - EMPLOYMENTS_WORK_LOCATION_COMPANY("employments,work_location,company"), - - EMPLOYMENTS_WORK_LOCATION_COMPANY_PAY_GROUP("employments,work_location,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER("employments,work_location,manager"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_COMPANY("employments,work_location,manager,company"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("employments,work_location,manager,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_PAY_GROUP("employments,work_location,manager,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM("employments,work_location,manager,team"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM_COMPANY("employments,work_location,manager,team,company"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "employments,work_location,manager,team,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("employments,work_location,manager,team,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_PAY_GROUP("employments,work_location,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_TEAM("employments,work_location,team"), - - EMPLOYMENTS_WORK_LOCATION_TEAM_COMPANY("employments,work_location,team,company"), - - EMPLOYMENTS_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("employments,work_location,team,company,pay_group"), - - EMPLOYMENTS_WORK_LOCATION_TEAM_PAY_GROUP("employments,work_location,team,pay_group"), - - GROUPS("groups"), - - GROUPS_COMPANY("groups,company"), - - GROUPS_COMPANY_PAY_GROUP("groups,company,pay_group"), - - GROUPS_HOME_LOCATION("groups,home_location"), - - GROUPS_HOME_LOCATION_COMPANY("groups,home_location,company"), - - GROUPS_HOME_LOCATION_COMPANY_PAY_GROUP("groups,home_location,company,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER("groups,home_location,manager"), - - GROUPS_HOME_LOCATION_MANAGER_COMPANY("groups,home_location,manager,company"), - - GROUPS_HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP("groups,home_location,manager,company,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER_PAY_GROUP("groups,home_location,manager,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM("groups,home_location,manager,team"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY("groups,home_location,manager,team,company"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("groups,home_location,manager,team,company,pay_group"), - - GROUPS_HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("groups,home_location,manager,team,pay_group"), - - GROUPS_HOME_LOCATION_PAY_GROUP("groups,home_location,pay_group"), - - GROUPS_HOME_LOCATION_TEAM("groups,home_location,team"), - - GROUPS_HOME_LOCATION_TEAM_COMPANY("groups,home_location,team,company"), - - GROUPS_HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("groups,home_location,team,company,pay_group"), - - GROUPS_HOME_LOCATION_TEAM_PAY_GROUP("groups,home_location,team,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION("groups,home_location,work_location"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY("groups,home_location,work_location,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP("groups,home_location,work_location,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER("groups,home_location,work_location,manager"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY("groups,home_location,work_location,manager,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP( - "groups,home_location,work_location,manager,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP("groups,home_location,work_location,manager,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM("groups,home_location,work_location,manager,team"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY("groups,home_location,work_location,manager,team,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "groups,home_location,work_location,manager,team,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP( - "groups,home_location,work_location,manager,team,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_PAY_GROUP("groups,home_location,work_location,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM("groups,home_location,work_location,team"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY("groups,home_location,work_location,team,company"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP( - "groups,home_location,work_location,team,company,pay_group"), - - GROUPS_HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP("groups,home_location,work_location,team,pay_group"), - - GROUPS_MANAGER("groups,manager"), - - GROUPS_MANAGER_COMPANY("groups,manager,company"), - - GROUPS_MANAGER_COMPANY_PAY_GROUP("groups,manager,company,pay_group"), - - GROUPS_MANAGER_PAY_GROUP("groups,manager,pay_group"), - - GROUPS_MANAGER_TEAM("groups,manager,team"), - - GROUPS_MANAGER_TEAM_COMPANY("groups,manager,team,company"), - - GROUPS_MANAGER_TEAM_COMPANY_PAY_GROUP("groups,manager,team,company,pay_group"), - - GROUPS_MANAGER_TEAM_PAY_GROUP("groups,manager,team,pay_group"), - - GROUPS_PAY_GROUP("groups,pay_group"), - - GROUPS_TEAM("groups,team"), - - GROUPS_TEAM_COMPANY("groups,team,company"), - - GROUPS_TEAM_COMPANY_PAY_GROUP("groups,team,company,pay_group"), - - GROUPS_TEAM_PAY_GROUP("groups,team,pay_group"), - - GROUPS_WORK_LOCATION("groups,work_location"), - - GROUPS_WORK_LOCATION_COMPANY("groups,work_location,company"), - - GROUPS_WORK_LOCATION_COMPANY_PAY_GROUP("groups,work_location,company,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER("groups,work_location,manager"), - - GROUPS_WORK_LOCATION_MANAGER_COMPANY("groups,work_location,manager,company"), - - GROUPS_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("groups,work_location,manager,company,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER_PAY_GROUP("groups,work_location,manager,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM("groups,work_location,manager,team"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY("groups,work_location,manager,team,company"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("groups,work_location,manager,team,company,pay_group"), - - GROUPS_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("groups,work_location,manager,team,pay_group"), - - GROUPS_WORK_LOCATION_PAY_GROUP("groups,work_location,pay_group"), - - GROUPS_WORK_LOCATION_TEAM("groups,work_location,team"), - - GROUPS_WORK_LOCATION_TEAM_COMPANY("groups,work_location,team,company"), - - GROUPS_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("groups,work_location,team,company,pay_group"), - - GROUPS_WORK_LOCATION_TEAM_PAY_GROUP("groups,work_location,team,pay_group"), - - HOME_LOCATION("home_location"), - - HOME_LOCATION_COMPANY("home_location,company"), - - HOME_LOCATION_COMPANY_PAY_GROUP("home_location,company,pay_group"), - - HOME_LOCATION_MANAGER("home_location,manager"), - - HOME_LOCATION_MANAGER_COMPANY("home_location,manager,company"), - - HOME_LOCATION_MANAGER_COMPANY_PAY_GROUP("home_location,manager,company,pay_group"), - - HOME_LOCATION_MANAGER_PAY_GROUP("home_location,manager,pay_group"), - - HOME_LOCATION_MANAGER_TEAM("home_location,manager,team"), - - HOME_LOCATION_MANAGER_TEAM_COMPANY("home_location,manager,team,company"), - - HOME_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("home_location,manager,team,company,pay_group"), - - HOME_LOCATION_MANAGER_TEAM_PAY_GROUP("home_location,manager,team,pay_group"), - - HOME_LOCATION_PAY_GROUP("home_location,pay_group"), - - HOME_LOCATION_TEAM("home_location,team"), - - HOME_LOCATION_TEAM_COMPANY("home_location,team,company"), - - HOME_LOCATION_TEAM_COMPANY_PAY_GROUP("home_location,team,company,pay_group"), - - HOME_LOCATION_TEAM_PAY_GROUP("home_location,team,pay_group"), - - HOME_LOCATION_WORK_LOCATION("home_location,work_location"), - - HOME_LOCATION_WORK_LOCATION_COMPANY("home_location,work_location,company"), - - HOME_LOCATION_WORK_LOCATION_COMPANY_PAY_GROUP("home_location,work_location,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER("home_location,work_location,manager"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY("home_location,work_location,manager,company"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("home_location,work_location,manager,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_PAY_GROUP("home_location,work_location,manager,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM("home_location,work_location,manager,team"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY("home_location,work_location,manager,team,company"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP( - "home_location,work_location,manager,team,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("home_location,work_location,manager,team,pay_group"), - - HOME_LOCATION_WORK_LOCATION_PAY_GROUP("home_location,work_location,pay_group"), - - HOME_LOCATION_WORK_LOCATION_TEAM("home_location,work_location,team"), - - HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY("home_location,work_location,team,company"), - - HOME_LOCATION_WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("home_location,work_location,team,company,pay_group"), - - HOME_LOCATION_WORK_LOCATION_TEAM_PAY_GROUP("home_location,work_location,team,pay_group"), - - MANAGER("manager"), - - MANAGER_COMPANY("manager,company"), - - MANAGER_COMPANY_PAY_GROUP("manager,company,pay_group"), - - MANAGER_PAY_GROUP("manager,pay_group"), - - MANAGER_TEAM("manager,team"), - - MANAGER_TEAM_COMPANY("manager,team,company"), - - MANAGER_TEAM_COMPANY_PAY_GROUP("manager,team,company,pay_group"), - - MANAGER_TEAM_PAY_GROUP("manager,team,pay_group"), - - PAY_GROUP("pay_group"), - - TEAM("team"), - - TEAM_COMPANY("team,company"), - - TEAM_COMPANY_PAY_GROUP("team,company,pay_group"), - - TEAM_PAY_GROUP("team,pay_group"), - - WORK_LOCATION("work_location"), - - WORK_LOCATION_COMPANY("work_location,company"), - - WORK_LOCATION_COMPANY_PAY_GROUP("work_location,company,pay_group"), - - WORK_LOCATION_MANAGER("work_location,manager"), - - WORK_LOCATION_MANAGER_COMPANY("work_location,manager,company"), - - WORK_LOCATION_MANAGER_COMPANY_PAY_GROUP("work_location,manager,company,pay_group"), - - WORK_LOCATION_MANAGER_PAY_GROUP("work_location,manager,pay_group"), - - WORK_LOCATION_MANAGER_TEAM("work_location,manager,team"), - - WORK_LOCATION_MANAGER_TEAM_COMPANY("work_location,manager,team,company"), - - WORK_LOCATION_MANAGER_TEAM_COMPANY_PAY_GROUP("work_location,manager,team,company,pay_group"), - - WORK_LOCATION_MANAGER_TEAM_PAY_GROUP("work_location,manager,team,pay_group"), - - WORK_LOCATION_PAY_GROUP("work_location,pay_group"), - - WORK_LOCATION_TEAM("work_location,team"), - - WORK_LOCATION_TEAM_COMPANY("work_location,team,company"), - - WORK_LOCATION_TEAM_COMPANY_PAY_GROUP("work_location,team,company,pay_group"), - - WORK_LOCATION_TEAM_PAY_GROUP("work_location,team,pay_group"); - - private final String value; - - EmployeesRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employees/types/IgnoreCommonModelRequestReason.java b/src/main/java/com/merge/api/resources/hris/employees/types/IgnoreCommonModelRequestReason.java deleted file mode 100644 index bdf41e70d..000000000 --- a/src/main/java/com/merge/api/resources/hris/employees/types/IgnoreCommonModelRequestReason.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employees.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.types.ReasonEnum; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IgnoreCommonModelRequestReason.Deserializer.class) -public final class IgnoreCommonModelRequestReason { - private final Object value; - - private final int type; - - private IgnoreCommonModelRequestReason(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ReasonEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IgnoreCommonModelRequestReason && equalTo((IgnoreCommonModelRequestReason) other); - } - - private boolean equalTo(IgnoreCommonModelRequestReason other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IgnoreCommonModelRequestReason of(ReasonEnum value) { - return new IgnoreCommonModelRequestReason(value, 0); - } - - public static IgnoreCommonModelRequestReason of(String value) { - return new IgnoreCommonModelRequestReason(value, 1); - } - - public interface Visitor { - T visit(ReasonEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IgnoreCommonModelRequestReason.class); - } - - @java.lang.Override - public IgnoreCommonModelRequestReason deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ReasonEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employerbenefits/EmployerBenefitsClient.java b/src/main/java/com/merge/api/resources/hris/employerbenefits/EmployerBenefitsClient.java deleted file mode 100644 index c59c243d3..000000000 --- a/src/main/java/com/merge/api/resources/hris/employerbenefits/EmployerBenefitsClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employerbenefits; - -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.hris.employerbenefits.requests.EmployerBenefitsListRequest; -import com.merge.api.resources.hris.employerbenefits.requests.EmployerBenefitsRetrieveRequest; -import com.merge.api.resources.hris.types.EmployerBenefit; -import com.merge.api.resources.hris.types.PaginatedEmployerBenefitList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EmployerBenefitsClient { - protected final ClientOptions clientOptions; - - public EmployerBenefitsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of EmployerBenefit objects. - */ - public PaginatedEmployerBenefitList list() { - return list(EmployerBenefitsListRequest.builder().build()); - } - - /** - * Returns a list of EmployerBenefit objects. - */ - public PaginatedEmployerBenefitList list(EmployerBenefitsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of EmployerBenefit objects. - */ - public PaginatedEmployerBenefitList list(EmployerBenefitsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employer-benefits"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEmployerBenefitList.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); - } - } - - /** - * Returns an EmployerBenefit object with the given id. - */ - public EmployerBenefit retrieve(String id) { - return retrieve(id, EmployerBenefitsRetrieveRequest.builder().build()); - } - - /** - * Returns an EmployerBenefit object with the given id. - */ - public EmployerBenefit retrieve(String id, EmployerBenefitsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an EmployerBenefit object with the given id. - */ - public EmployerBenefit retrieve(String id, EmployerBenefitsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employer-benefits") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), EmployerBenefit.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employerbenefits/requests/EmployerBenefitsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/employerbenefits/requests/EmployerBenefitsRetrieveRequest.java deleted file mode 100644 index c830bbfe7..000000000 --- a/src/main/java/com/merge/api/resources/hris/employerbenefits/requests/EmployerBenefitsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employerbenefits.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmployerBenefitsRetrieveRequest.Builder.class) -public final class EmployerBenefitsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private EmployerBenefitsRetrieveRequest( - Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployerBenefitsRetrieveRequest && equalTo((EmployerBenefitsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmployerBenefitsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmployerBenefitsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public EmployerBenefitsRetrieveRequest build() { - return new EmployerBenefitsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employments/EmploymentsClient.java b/src/main/java/com/merge/api/resources/hris/employments/EmploymentsClient.java deleted file mode 100644 index ba2704eb0..000000000 --- a/src/main/java/com/merge/api/resources/hris/employments/EmploymentsClient.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employments; - -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.hris.employments.requests.EmploymentsListRequest; -import com.merge.api.resources.hris.employments.requests.EmploymentsRetrieveRequest; -import com.merge.api.resources.hris.types.Employment; -import com.merge.api.resources.hris.types.PaginatedEmploymentList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class EmploymentsClient { - protected final ClientOptions clientOptions; - - public EmploymentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Employment objects. - */ - public PaginatedEmploymentList list() { - return list(EmploymentsListRequest.builder().build()); - } - - /** - * Returns a list of Employment objects. - */ - public PaginatedEmploymentList list(EmploymentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Employment objects. - */ - public PaginatedEmploymentList list(EmploymentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employments"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmployeeId().isPresent()) { - httpUrl.addQueryParameter("employee_id", request.getEmployeeId().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOrderBy().isPresent()) { - httpUrl.addQueryParameter("order_by", request.getOrderBy().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedEmploymentList.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); - } - } - - /** - * Returns an Employment object with the given id. - */ - public Employment retrieve(String id) { - return retrieve(id, EmploymentsRetrieveRequest.builder().build()); - } - - /** - * Returns an Employment object with the given id. - */ - public Employment retrieve(String id, EmploymentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Employment object with the given id. - */ - public Employment retrieve(String id, EmploymentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/employments") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Employment.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employments/requests/EmploymentsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/employments/requests/EmploymentsRetrieveRequest.java deleted file mode 100644 index 7e139618c..000000000 --- a/src/main/java/com/merge/api/resources/hris/employments/requests/EmploymentsRetrieveRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.employments.types.EmploymentsRetrieveRequestExpand; -import com.merge.api.resources.hris.employments.types.EmploymentsRetrieveRequestRemoteFields; -import com.merge.api.resources.hris.employments.types.EmploymentsRetrieveRequestShowEnumOrigins; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmploymentsRetrieveRequest.Builder.class) -public final class EmploymentsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private EmploymentsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmploymentsRetrieveRequest && equalTo((EmploymentsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmploymentsRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(EmploymentsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(EmploymentsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(EmploymentsRetrieveRequestRemoteFields remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(EmploymentsRetrieveRequestShowEnumOrigins showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public EmploymentsRetrieveRequest build() { - return new EmploymentsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestExpand.java b/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestExpand.java deleted file mode 100644 index 6b7949280..000000000 --- a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employments.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EmploymentsListRequestExpand { - EMPLOYEE("employee"), - - EMPLOYEE_PAY_GROUP("employee,pay_group"), - - PAY_GROUP("pay_group"); - - private final String value; - - EmploymentsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestExpand.java deleted file mode 100644 index 5d269f760..000000000 --- a/src/main/java/com/merge/api/resources/hris/employments/types/EmploymentsRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.employments.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EmploymentsRetrieveRequestExpand { - EMPLOYEE("employee"), - - EMPLOYEE_PAY_GROUP("employee,pay_group"), - - PAY_GROUP("pay_group"); - - private final String value; - - EmploymentsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/api/resources/hris/fieldmapping/FieldMappingClient.java deleted file mode 100644 index 305241370..000000000 --- a/src/main/java/com/merge/api/resources/hris/fieldmapping/FieldMappingClient.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.fieldmapping; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.fieldmapping.requests.CreateFieldMappingRequest; -import com.merge.api.resources.hris.fieldmapping.requests.FieldMappingsRetrieveRequest; -import com.merge.api.resources.hris.fieldmapping.requests.PatchedEditFieldMappingRequest; -import com.merge.api.resources.hris.fieldmapping.requests.RemoteFieldsRetrieveRequest; -import com.merge.api.resources.hris.types.ExternalTargetFieldApiResponse; -import com.merge.api.resources.hris.types.FieldMappingApiInstanceResponse; -import com.merge.api.resources.hris.types.FieldMappingInstanceResponse; -import com.merge.api.resources.hris.types.RemoteFieldApiResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FieldMappingClient { - protected final ClientOptions clientOptions; - - public FieldMappingClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { - return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { - return fieldMappingsRetrieve(request, null); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve( - FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingApiInstanceResponse.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); - } - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { - return fieldMappingsCreate(request, null); - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate( - CreateFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { - return fieldMappingsPartialUpdate( - fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request) { - return fieldMappingsPartialUpdate(fieldMappingId, request, null); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve() { - return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { - return remoteFieldsRetrieve(request, null); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve( - RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/remote-fields"); - if (request.getCommonModels().isPresent()) { - httpUrl.addQueryParameter("common_models", request.getCommonModels().get()); - } - if (request.getIncludeExampleValues().isPresent()) { - httpUrl.addQueryParameter( - "include_example_values", request.getIncludeExampleValues().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RemoteFieldApiResponse.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); - } - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve() { - return targetFieldsRetrieve(null); - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/target-fields") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), ExternalTargetFieldApiResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/CreateFieldMappingRequest.java deleted file mode 100644 index c23390afb..000000000 --- a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/CreateFieldMappingRequest.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) -public final class CreateFieldMappingRequest { - private final Optional excludeRemoteFieldMetadata; - - private final String targetFieldName; - - private final String targetFieldDescription; - - private final List remoteFieldTraversalPath; - - private final String remoteMethod; - - private final String remoteUrlPath; - - private final String commonModelName; - - private final Map additionalProperties; - - private CreateFieldMappingRequest( - Optional excludeRemoteFieldMetadata, - String targetFieldName, - String targetFieldDescription, - List remoteFieldTraversalPath, - String remoteMethod, - String remoteUrlPath, - String commonModelName, - Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.targetFieldName = targetFieldName; - this.targetFieldDescription = targetFieldDescription; - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.commonModelName = commonModelName; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - /** - * @return The name of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_name") - public String getTargetFieldName() { - return targetFieldName; - } - - /** - * @return The description of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_description") - public String getTargetFieldDescription() { - return targetFieldDescription; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public List getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public String getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public String getRemoteUrlPath() { - return remoteUrlPath; - } - - /** - * @return The name of the Common Model that the remote field corresponds to in a given category. - */ - @JsonProperty("common_model_name") - public String getCommonModelName() { - return commonModelName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateFieldMappingRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) - && targetFieldName.equals(other.targetFieldName) - && targetFieldDescription.equals(other.targetFieldDescription) - && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.excludeRemoteFieldMetadata, - this.targetFieldName, - this.targetFieldDescription, - this.remoteFieldTraversalPath, - this.remoteMethod, - this.remoteUrlPath, - this.commonModelName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TargetFieldNameStage builder() { - return new Builder(); - } - - public interface TargetFieldNameStage { - TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); - - Builder from(CreateFieldMappingRequest other); - } - - public interface TargetFieldDescriptionStage { - RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); - } - - public interface RemoteMethodStage { - RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); - } - - public interface RemoteUrlPathStage { - CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); - } - - public interface CommonModelNameStage { - _FinalStage commonModelName(@NotNull String commonModelName); - } - - public interface _FinalStage { - CreateFieldMappingRequest build(); - - _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); - - _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); - - _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); - - _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); - - _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements TargetFieldNameStage, - TargetFieldDescriptionStage, - RemoteMethodStage, - RemoteUrlPathStage, - CommonModelNameStage, - _FinalStage { - private String targetFieldName; - - private String targetFieldDescription; - - private String remoteMethod; - - private String remoteUrlPath; - - private String commonModelName; - - private List remoteFieldTraversalPath = new ArrayList<>(); - - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateFieldMappingRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - targetFieldName(other.getTargetFieldName()); - targetFieldDescription(other.getTargetFieldDescription()); - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - commonModelName(other.getCommonModelName()); - return this; - } - - /** - *

The name of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_name") - public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { - this.targetFieldName = targetFieldName; - return this; - } - - /** - *

The description of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_description") - public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { - this.targetFieldDescription = targetFieldDescription; - return this; - } - - /** - *

The method of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_method") - public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - /** - *

The path of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_url_path") - public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - /** - *

The name of the Common Model that the remote field corresponds to in a given category.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("common_model_name") - public _FinalStage commonModelName(@NotNull String commonModelName) { - this.commonModelName = commonModelName; - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.clear(); - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - @java.lang.Override - public CreateFieldMappingRequest build() { - return new CreateFieldMappingRequest( - excludeRemoteFieldMetadata, - targetFieldName, - targetFieldDescription, - remoteFieldTraversalPath, - remoteMethod, - remoteUrlPath, - commonModelName, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/FieldMappingsRetrieveRequest.java deleted file mode 100644 index 6b30b6bf7..000000000 --- a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/FieldMappingsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) -public final class FieldMappingsRetrieveRequest { - private final Optional excludeRemoteFieldMetadata; - - private final Map additionalProperties; - - private FieldMappingsRetrieveRequest( - Optional excludeRemoteFieldMetadata, Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingsRetrieveRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingsRetrieveRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - return this; - } - - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - public FieldMappingsRetrieveRequest build() { - return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/PatchedEditFieldMappingRequest.java deleted file mode 100644 index 19c0edb22..000000000 --- a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/PatchedEditFieldMappingRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) -public final class PatchedEditFieldMappingRequest { - private final Optional> remoteFieldTraversalPath; - - private final Optional remoteMethod; - - private final Optional remoteUrlPath; - - private final Map additionalProperties; - - private PatchedEditFieldMappingRequest( - Optional> remoteFieldTraversalPath, - Optional remoteMethod, - Optional remoteUrlPath, - Map additionalProperties) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.additionalProperties = additionalProperties; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public Optional> getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public Optional getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public Optional getRemoteUrlPath() { - return remoteUrlPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> remoteFieldTraversalPath = Optional.empty(); - - private Optional remoteMethod = Optional.empty(); - - private Optional remoteUrlPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PatchedEditFieldMappingRequest other) { - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - return this; - } - - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - return this; - } - - public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); - return this; - } - - @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) - public Builder remoteMethod(Optional remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - public Builder remoteMethod(String remoteMethod) { - this.remoteMethod = Optional.ofNullable(remoteMethod); - return this; - } - - @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) - public Builder remoteUrlPath(Optional remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - public Builder remoteUrlPath(String remoteUrlPath) { - this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); - return this; - } - - public PatchedEditFieldMappingRequest build() { - return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/RemoteFieldsRetrieveRequest.java deleted file mode 100644 index 530fbc692..000000000 --- a/src/main/java/com/merge/api/resources/hris/fieldmapping/requests/RemoteFieldsRetrieveRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) -public final class RemoteFieldsRetrieveRequest { - private final Optional commonModels; - - private final Optional includeExampleValues; - - private final Map additionalProperties; - - private RemoteFieldsRetrieveRequest( - Optional commonModels, - Optional includeExampleValues, - Map additionalProperties) { - this.commonModels = commonModels; - this.includeExampleValues = includeExampleValues; - this.additionalProperties = additionalProperties; - } - - /** - * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. - */ - @JsonProperty("common_models") - public Optional getCommonModels() { - return commonModels; - } - - /** - * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. - */ - @JsonProperty("include_example_values") - public Optional getIncludeExampleValues() { - return includeExampleValues; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldsRetrieveRequest other) { - return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels, this.includeExampleValues); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional commonModels = Optional.empty(); - - private Optional includeExampleValues = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldsRetrieveRequest other) { - commonModels(other.getCommonModels()); - includeExampleValues(other.getIncludeExampleValues()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(Optional commonModels) { - this.commonModels = commonModels; - return this; - } - - public Builder commonModels(String commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) - public Builder includeExampleValues(Optional includeExampleValues) { - this.includeExampleValues = includeExampleValues; - return this; - } - - public Builder includeExampleValues(String includeExampleValues) { - this.includeExampleValues = Optional.ofNullable(includeExampleValues); - return this; - } - - public RemoteFieldsRetrieveRequest build() { - return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/forceresync/ForceResyncClient.java b/src/main/java/com/merge/api/resources/hris/forceresync/ForceResyncClient.java deleted file mode 100644 index f2573fe6d..000000000 --- a/src/main/java/com/merge/api/resources/hris/forceresync/ForceResyncClient.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.forceresync; - -import com.fasterxml.jackson.core.type.TypeReference; -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.hris.types.SyncStatus; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ForceResyncClient { - protected final ClientOptions clientOptions; - - public ForceResyncClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate() { - return syncStatusResyncCreate(null); - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/sync-status/resync") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/api/resources/hris/generatekey/GenerateKeyClient.java deleted file mode 100644 index 675af7e16..000000000 --- a/src/main/java/com/merge/api/resources/hris/generatekey/GenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.generatekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.generatekey.requests.GenerateRemoteKeyRequest; -import com.merge.api.resources.hris.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GenerateKeyClient { - protected final ClientOptions clientOptions; - - public GenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request) { - return create(request, null); - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/generate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/resources/hris/generatekey/requests/GenerateRemoteKeyRequest.java deleted file mode 100644 index 71f14dd46..000000000 --- a/src/main/java/com/merge/api/resources/hris/generatekey/requests/GenerateRemoteKeyRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.generatekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) -public final class GenerateRemoteKeyRequest { - private final String name; - - private final Map additionalProperties; - - private GenerateRemoteKeyRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GenerateRemoteKeyRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(GenerateRemoteKeyRequest other); - } - - public interface _FinalStage { - GenerateRemoteKeyRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GenerateRemoteKeyRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public GenerateRemoteKeyRequest build() { - return new GenerateRemoteKeyRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/groups/GroupsClient.java b/src/main/java/com/merge/api/resources/hris/groups/GroupsClient.java deleted file mode 100644 index c2659723b..000000000 --- a/src/main/java/com/merge/api/resources/hris/groups/GroupsClient.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.groups; - -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.hris.groups.requests.GroupsListRequest; -import com.merge.api.resources.hris.groups.requests.GroupsRetrieveRequest; -import com.merge.api.resources.hris.types.Group; -import com.merge.api.resources.hris.types.PaginatedGroupList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GroupsClient { - protected final ClientOptions clientOptions; - - public GroupsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Group objects. - */ - public PaginatedGroupList list() { - return list(GroupsListRequest.builder().build()); - } - - /** - * Returns a list of Group objects. - */ - public PaginatedGroupList list(GroupsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Group objects. - */ - public PaginatedGroupList list(GroupsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/groups"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonlyUsedAsTeam().isPresent()) { - httpUrl.addQueryParameter( - "is_commonly_used_as_team", - request.getIsCommonlyUsedAsTeam().get()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getNames().isPresent()) { - httpUrl.addQueryParameter("names", request.getNames().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - if (request.getTypes().isPresent()) { - httpUrl.addQueryParameter("types", request.getTypes().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedGroupList.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); - } - } - - /** - * Returns a Group object with the given id. - */ - public Group retrieve(String id) { - return retrieve(id, GroupsRetrieveRequest.builder().build()); - } - - /** - * Returns a Group object with the given id. - */ - public Group retrieve(String id, GroupsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Group object with the given id. - */ - public Group retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/groups") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Group.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/groups/requests/GroupsListRequest.java b/src/main/java/com/merge/api/resources/hris/groups/requests/GroupsListRequest.java deleted file mode 100644 index 91e1d0f50..000000000 --- a/src/main/java/com/merge/api/resources/hris/groups/requests/GroupsListRequest.java +++ /dev/null @@ -1,510 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.groups.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GroupsListRequest.Builder.class) -public final class GroupsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional isCommonlyUsedAsTeam; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional names; - - private final Optional pageSize; - - private final Optional remoteFields; - - private final Optional remoteId; - - private final Optional showEnumOrigins; - - private final Optional types; - - private final Map additionalProperties; - - private GroupsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional isCommonlyUsedAsTeam, - Optional modifiedAfter, - Optional modifiedBefore, - Optional names, - Optional pageSize, - Optional remoteFields, - Optional remoteId, - Optional showEnumOrigins, - Optional types, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.names = names; - this.pageSize = pageSize; - this.remoteFields = remoteFields; - this.remoteId = remoteId; - this.showEnumOrigins = showEnumOrigins; - this.types = types; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, specifies whether to return only Group objects which refer to a team in the third party platform. Note that this is an opinionated view based on how a team may be represented in the third party platform. - */ - @JsonProperty("is_commonly_used_as_team") - public Optional getIsCommonlyUsedAsTeam() { - return isCommonlyUsedAsTeam; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return If provided, will only return groups with these names. Multiple values can be separated by commas. - */ - @JsonProperty("names") - public Optional getNames() { - return names; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - /** - * @return If provided, will only return groups of these types. Multiple values can be separated by commas. - */ - @JsonProperty("types") - public Optional getTypes() { - return types; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GroupsListRequest && equalTo((GroupsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GroupsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && isCommonlyUsedAsTeam.equals(other.isCommonlyUsedAsTeam) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && names.equals(other.names) - && pageSize.equals(other.pageSize) - && remoteFields.equals(other.remoteFields) - && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins) - && types.equals(other.types); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.isCommonlyUsedAsTeam, - this.modifiedAfter, - this.modifiedBefore, - this.names, - this.pageSize, - this.remoteFields, - this.remoteId, - this.showEnumOrigins, - this.types); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional isCommonlyUsedAsTeam = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional names = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - private Optional types = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GroupsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - isCommonlyUsedAsTeam(other.getIsCommonlyUsedAsTeam()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - names(other.getNames()); - pageSize(other.getPageSize()); - remoteFields(other.getRemoteFields()); - remoteId(other.getRemoteId()); - showEnumOrigins(other.getShowEnumOrigins()); - types(other.getTypes()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "is_commonly_used_as_team", nulls = Nulls.SKIP) - public Builder isCommonlyUsedAsTeam(Optional isCommonlyUsedAsTeam) { - this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; - return this; - } - - public Builder isCommonlyUsedAsTeam(String isCommonlyUsedAsTeam) { - this.isCommonlyUsedAsTeam = Optional.ofNullable(isCommonlyUsedAsTeam); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "names", nulls = Nulls.SKIP) - public Builder names(Optional names) { - this.names = names; - return this; - } - - public Builder names(String names) { - this.names = Optional.ofNullable(names); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - @JsonSetter(value = "types", nulls = Nulls.SKIP) - public Builder types(Optional types) { - this.types = types; - return this; - } - - public Builder types(String types) { - this.types = Optional.ofNullable(types); - return this; - } - - public GroupsListRequest build() { - return new GroupsListRequest( - createdAfter, - createdBefore, - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - isCommonlyUsedAsTeam, - modifiedAfter, - modifiedBefore, - names, - pageSize, - remoteFields, - remoteId, - showEnumOrigins, - types, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/groups/requests/GroupsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/groups/requests/GroupsRetrieveRequest.java deleted file mode 100644 index 0a465ae82..000000000 --- a/src/main/java/com/merge/api/resources/hris/groups/requests/GroupsRetrieveRequest.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.groups.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GroupsRetrieveRequest.Builder.class) -public final class GroupsRetrieveRequest { - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private GroupsRetrieveRequest( - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GroupsRetrieveRequest && equalTo((GroupsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GroupsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GroupsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(String remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(String showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public GroupsRetrieveRequest build() { - return new GroupsRetrieveRequest(includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/issues/IssuesClient.java b/src/main/java/com/merge/api/resources/hris/issues/IssuesClient.java deleted file mode 100644 index 659893f92..000000000 --- a/src/main/java/com/merge/api/resources/hris/issues/IssuesClient.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.issues; - -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.hris.issues.requests.IssuesListRequest; -import com.merge.api.resources.hris.types.Issue; -import com.merge.api.resources.hris.types.PaginatedIssueList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuesClient { - protected final ClientOptions clientOptions; - - public IssuesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list() { - return list(IssuesListRequest.builder().build()); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request) { - return list(request, null); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/issues"); - if (request.getAccountToken().isPresent()) { - httpUrl.addQueryParameter("account_token", request.getAccountToken().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getFirstIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_after", - request.getFirstIncidentTimeAfter().get().toString()); - } - if (request.getFirstIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_before", - request.getFirstIncidentTimeBefore().get().toString()); - } - if (request.getIncludeMuted().isPresent()) { - httpUrl.addQueryParameter("include_muted", request.getIncludeMuted().get()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getLastIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_after", - request.getLastIncidentTimeAfter().get().toString()); - } - if (request.getLastIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_before", - request.getLastIncidentTimeBefore().get().toString()); - } - if (request.getLinkedAccountId().isPresent()) { - httpUrl.addQueryParameter( - "linked_account_id", request.getLinkedAccountId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedIssueList.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); - } - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id) { - return retrieve(id, null); - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/issues") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), Issue.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/api/resources/hris/issues/requests/IssuesListRequest.java deleted file mode 100644 index 49cefd227..000000000 --- a/src/main/java/com/merge/api/resources/hris/issues/requests/IssuesListRequest.java +++ /dev/null @@ -1,477 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.issues.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.issues.types.IssuesListRequestStatus; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IssuesListRequest.Builder.class) -public final class IssuesListRequest { - private final Optional accountToken; - - private final Optional cursor; - - private final Optional endDate; - - private final Optional endUserOrganizationName; - - private final Optional firstIncidentTimeAfter; - - private final Optional firstIncidentTimeBefore; - - private final Optional includeMuted; - - private final Optional integrationName; - - private final Optional lastIncidentTimeAfter; - - private final Optional lastIncidentTimeBefore; - - private final Optional linkedAccountId; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional status; - - private final Map additionalProperties; - - private IssuesListRequest( - Optional accountToken, - Optional cursor, - Optional endDate, - Optional endUserOrganizationName, - Optional firstIncidentTimeAfter, - Optional firstIncidentTimeBefore, - Optional includeMuted, - Optional integrationName, - Optional lastIncidentTimeAfter, - Optional lastIncidentTimeBefore, - Optional linkedAccountId, - Optional pageSize, - Optional startDate, - Optional status, - Map additionalProperties) { - this.accountToken = accountToken; - this.cursor = cursor; - this.endDate = endDate; - this.endUserOrganizationName = endUserOrganizationName; - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - this.includeMuted = includeMuted; - this.integrationName = integrationName; - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - this.linkedAccountId = linkedAccountId; - this.pageSize = pageSize; - this.startDate = startDate; - this.status = status; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public Optional getAccountToken() { - return accountToken; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include issues whose most recent action occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return issues whose first incident time was after this datetime. - */ - @JsonProperty("first_incident_time_after") - public Optional getFirstIncidentTimeAfter() { - return firstIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose first incident time was before this datetime. - */ - @JsonProperty("first_incident_time_before") - public Optional getFirstIncidentTimeBefore() { - return firstIncidentTimeBefore; - } - - /** - * @return If true, will include muted issues - */ - @JsonProperty("include_muted") - public Optional getIncludeMuted() { - return includeMuted; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If provided, will only return issues whose last incident time was after this datetime. - */ - @JsonProperty("last_incident_time_after") - public Optional getLastIncidentTimeAfter() { - return lastIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose last incident time was before this datetime. - */ - @JsonProperty("last_incident_time_before") - public Optional getLastIncidentTimeBefore() { - return lastIncidentTimeBefore; - } - - /** - * @return If provided, will only include issues pertaining to the linked account passed in. - */ - @JsonProperty("linked_account_id") - public Optional getLinkedAccountId() { - return linkedAccountId; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include issues whose most recent action occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IssuesListRequest other) { - return accountToken.equals(other.accountToken) - && cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) - && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) - && includeMuted.equals(other.includeMuted) - && integrationName.equals(other.integrationName) - && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) - && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) - && linkedAccountId.equals(other.linkedAccountId) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountToken, - this.cursor, - this.endDate, - this.endUserOrganizationName, - this.firstIncidentTimeAfter, - this.firstIncidentTimeBefore, - this.includeMuted, - this.integrationName, - this.lastIncidentTimeAfter, - this.lastIncidentTimeBefore, - this.linkedAccountId, - this.pageSize, - this.startDate, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountToken = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional firstIncidentTimeAfter = Optional.empty(); - - private Optional firstIncidentTimeBefore = Optional.empty(); - - private Optional includeMuted = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional lastIncidentTimeAfter = Optional.empty(); - - private Optional lastIncidentTimeBefore = Optional.empty(); - - private Optional linkedAccountId = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(IssuesListRequest other) { - accountToken(other.getAccountToken()); - cursor(other.getCursor()); - endDate(other.getEndDate()); - endUserOrganizationName(other.getEndUserOrganizationName()); - firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); - firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); - includeMuted(other.getIncludeMuted()); - integrationName(other.getIntegrationName()); - lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); - lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); - linkedAccountId(other.getLinkedAccountId()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "account_token", nulls = Nulls.SKIP) - public Builder accountToken(Optional accountToken) { - this.accountToken = accountToken; - return this; - } - - public Builder accountToken(String accountToken) { - this.accountToken = Optional.ofNullable(accountToken); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) - public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - return this; - } - - public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) - public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - return this; - } - - public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) - public Builder includeMuted(Optional includeMuted) { - this.includeMuted = includeMuted; - return this; - } - - public Builder includeMuted(String includeMuted) { - this.includeMuted = Optional.ofNullable(includeMuted); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) - public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - return this; - } - - public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) - public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - return this; - } - - public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) - public Builder linkedAccountId(Optional linkedAccountId) { - this.linkedAccountId = linkedAccountId; - return this; - } - - public Builder linkedAccountId(String linkedAccountId) { - this.linkedAccountId = Optional.ofNullable(linkedAccountId); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(IssuesListRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - public IssuesListRequest build() { - return new IssuesListRequest( - accountToken, - cursor, - endDate, - endUserOrganizationName, - firstIncidentTimeAfter, - firstIncidentTimeBefore, - includeMuted, - integrationName, - lastIncidentTimeAfter, - lastIncidentTimeBefore, - linkedAccountId, - pageSize, - startDate, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/resources/hris/issues/types/IssuesListRequestStatus.java deleted file mode 100644 index 4ebaa803a..000000000 --- a/src/main/java/com/merge/api/resources/hris/issues/types/IssuesListRequestStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.issues.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssuesListRequestStatus { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssuesListRequestStatus(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/api/resources/hris/linkedaccounts/LinkedAccountsClient.java deleted file mode 100644 index 91e8a8bbd..000000000 --- a/src/main/java/com/merge/api/resources/hris/linkedaccounts/LinkedAccountsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.linkedaccounts; - -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.hris.linkedaccounts.requests.LinkedAccountsListRequest; -import com.merge.api.resources.hris.types.PaginatedAccountDetailsAndActionsList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkedAccountsClient { - protected final ClientOptions clientOptions; - - public LinkedAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list() { - return list(LinkedAccountsListRequest.builder().build()); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list(LinkedAccountsListRequest request) { - return list(request, null); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list( - LinkedAccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/linked-accounts"); - if (request.getCategory().isPresent()) { - httpUrl.addQueryParameter("category", request.getCategory().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndUserEmailAddress().isPresent()) { - httpUrl.addQueryParameter( - "end_user_email_address", request.getEndUserEmailAddress().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getEndUserOriginId().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_id", request.getEndUserOriginId().get()); - } - if (request.getEndUserOriginIds().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_ids", request.getEndUserOriginIds().get()); - } - if (request.getId().isPresent()) { - httpUrl.addQueryParameter("id", request.getId().get()); - } - if (request.getIds().isPresent()) { - httpUrl.addQueryParameter("ids", request.getIds().get()); - } - if (request.getIncludeDuplicates().isPresent()) { - httpUrl.addQueryParameter( - "include_duplicates", request.getIncludeDuplicates().get().toString()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getIsTestAccount().isPresent()) { - httpUrl.addQueryParameter( - "is_test_account", request.getIsTestAccount().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountDetailsAndActionsList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/resources/hris/linkedaccounts/requests/LinkedAccountsListRequest.java deleted file mode 100644 index aac10f43c..000000000 --- a/src/main/java/com/merge/api/resources/hris/linkedaccounts/requests/LinkedAccountsListRequest.java +++ /dev/null @@ -1,458 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.linkedaccounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.linkedaccounts.types.LinkedAccountsListRequestCategory; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) -public final class LinkedAccountsListRequest { - private final Optional category; - - private final Optional cursor; - - private final Optional endUserEmailAddress; - - private final Optional endUserOrganizationName; - - private final Optional endUserOriginId; - - private final Optional endUserOriginIds; - - private final Optional id; - - private final Optional ids; - - private final Optional includeDuplicates; - - private final Optional integrationName; - - private final Optional isTestAccount; - - private final Optional pageSize; - - private final Optional status; - - private final Map additionalProperties; - - private LinkedAccountsListRequest( - Optional category, - Optional cursor, - Optional endUserEmailAddress, - Optional endUserOrganizationName, - Optional endUserOriginId, - Optional endUserOriginIds, - Optional id, - Optional ids, - Optional includeDuplicates, - Optional integrationName, - Optional isTestAccount, - Optional pageSize, - Optional status, - Map additionalProperties) { - this.category = category; - this.cursor = cursor; - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.endUserOriginIds = endUserOriginIds; - this.id = id; - this.ids = ids; - this.includeDuplicates = includeDuplicates; - this.integrationName = integrationName; - this.isTestAccount = isTestAccount; - this.pageSize = pageSize; - this.status = status; - this.additionalProperties = additionalProperties; - } - - /** - * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing - *
    - *
  • hris - hris
  • - *
  • ats - ats
  • - *
  • accounting - accounting
  • - *
  • ticketing - ticketing
  • - *
  • crm - crm
  • - *
  • mktg - mktg
  • - *
  • filestorage - filestorage
  • - *
- */ - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return linked accounts associated with the given email address. - */ - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return If provided, will only return linked accounts associated with the given organization name. - */ - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return linked accounts associated with the given origin ID. - */ - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. - */ - @JsonProperty("end_user_origin_ids") - public Optional getEndUserOriginIds() { - return endUserOriginIds; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. - */ - @JsonProperty("ids") - public Optional getIds() { - return ids; - } - - /** - * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. - */ - @JsonProperty("include_duplicates") - public Optional getIncludeDuplicates() { - return includeDuplicates; - } - - /** - * @return If provided, will only return linked accounts associated with the given integration name. - */ - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. - */ - @JsonProperty("is_test_account") - public Optional getIsTestAccount() { - return isTestAccount; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountsListRequest other) { - return category.equals(other.category) - && cursor.equals(other.cursor) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOriginIds.equals(other.endUserOriginIds) - && id.equals(other.id) - && ids.equals(other.ids) - && includeDuplicates.equals(other.includeDuplicates) - && integrationName.equals(other.integrationName) - && isTestAccount.equals(other.isTestAccount) - && pageSize.equals(other.pageSize) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.category, - this.cursor, - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.endUserOriginIds, - this.id, - this.ids, - this.includeDuplicates, - this.integrationName, - this.isTestAccount, - this.pageSize, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional category = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOriginIds = Optional.empty(); - - private Optional id = Optional.empty(); - - private Optional ids = Optional.empty(); - - private Optional includeDuplicates = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional isTestAccount = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountsListRequest other) { - category(other.getCategory()); - cursor(other.getCursor()); - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - endUserOriginIds(other.getEndUserOriginIds()); - id(other.getId()); - ids(other.getIds()); - includeDuplicates(other.getIncludeDuplicates()); - integrationName(other.getIntegrationName()); - isTestAccount(other.getIsTestAccount()); - pageSize(other.getPageSize()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(LinkedAccountsListRequestCategory category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) - public Builder endUserOriginIds(Optional endUserOriginIds) { - this.endUserOriginIds = endUserOriginIds; - return this; - } - - public Builder endUserOriginIds(String endUserOriginIds) { - this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "ids", nulls = Nulls.SKIP) - public Builder ids(Optional ids) { - this.ids = ids; - return this; - } - - public Builder ids(String ids) { - this.ids = Optional.ofNullable(ids); - return this; - } - - @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) - public Builder includeDuplicates(Optional includeDuplicates) { - this.includeDuplicates = includeDuplicates; - return this; - } - - public Builder includeDuplicates(Boolean includeDuplicates) { - this.includeDuplicates = Optional.ofNullable(includeDuplicates); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) - public Builder isTestAccount(Optional isTestAccount) { - this.isTestAccount = isTestAccount; - return this; - } - - public Builder isTestAccount(String isTestAccount) { - this.isTestAccount = Optional.ofNullable(isTestAccount); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - public LinkedAccountsListRequest build() { - return new LinkedAccountsListRequest( - category, - cursor, - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - endUserOriginIds, - id, - ids, - includeDuplicates, - integrationName, - isTestAccount, - pageSize, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/resources/hris/linkedaccounts/types/LinkedAccountsListRequestCategory.java deleted file mode 100644 index 39edc4610..000000000 --- a/src/main/java/com/merge/api/resources/hris/linkedaccounts/types/LinkedAccountsListRequestCategory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.linkedaccounts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LinkedAccountsListRequestCategory { - ACCOUNTING("accounting"), - - ATS("ats"), - - CRM("crm"), - - FILESTORAGE("filestorage"), - - HRIS("hris"), - - MKTG("mktg"), - - TICKETING("ticketing"); - - private final String value; - - LinkedAccountsListRequestCategory(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/linktoken/LinkTokenClient.java b/src/main/java/com/merge/api/resources/hris/linktoken/LinkTokenClient.java deleted file mode 100644 index 09cf34fe5..000000000 --- a/src/main/java/com/merge/api/resources/hris/linktoken/LinkTokenClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.linktoken; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.linktoken.requests.EndUserDetailsRequest; -import com.merge.api.resources.hris.types.LinkToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkTokenClient { - protected final ClientOptions clientOptions; - - public LinkTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request) { - return create(request, null); - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/link-token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), LinkToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/api/resources/hris/linktoken/requests/EndUserDetailsRequest.java deleted file mode 100644 index b787089c1..000000000 --- a/src/main/java/com/merge/api/resources/hris/linktoken/requests/EndUserDetailsRequest.java +++ /dev/null @@ -1,611 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.linktoken.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.types.CategoriesEnum; -import com.merge.api.resources.hris.types.CommonModelScopesBodyRequest; -import com.merge.api.resources.hris.types.IndividualCommonModelScopeDeserializerRequest; -import com.merge.api.resources.hris.types.LanguageEnum; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) -public final class EndUserDetailsRequest { - private final String endUserEmailAddress; - - private final String endUserOrganizationName; - - private final String endUserOriginId; - - private final List categories; - - private final Optional integration; - - private final Optional linkExpiryMins; - - private final Optional shouldCreateMagicLinkUrl; - - private final Optional hideAdminMagicLink; - - private final Optional> commonModels; - - private final Optional>>> - categoryCommonModelScopes; - - private final Optional language; - - private final Optional areSyncsDisabled; - - private final Optional> integrationSpecificConfig; - - private final Map additionalProperties; - - private EndUserDetailsRequest( - String endUserEmailAddress, - String endUserOrganizationName, - String endUserOriginId, - List categories, - Optional integration, - Optional linkExpiryMins, - Optional shouldCreateMagicLinkUrl, - Optional hideAdminMagicLink, - Optional> commonModels, - Optional>>> - categoryCommonModelScopes, - Optional language, - Optional areSyncsDisabled, - Optional> integrationSpecificConfig, - Map additionalProperties) { - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.categories = categories; - this.integration = integration; - this.linkExpiryMins = linkExpiryMins; - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - this.hideAdminMagicLink = hideAdminMagicLink; - this.commonModels = commonModels; - this.categoryCommonModelScopes = categoryCommonModelScopes; - this.language = language; - this.areSyncsDisabled = areSyncsDisabled; - this.integrationSpecificConfig = integrationSpecificConfig; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. - */ - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return Your end user's organization. - */ - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. - */ - @JsonProperty("end_user_origin_id") - public String getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return The integration categories to show in Merge Link. - */ - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - /** - * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. - */ - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - /** - * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. - */ - @JsonProperty("link_expiry_mins") - public Optional getLinkExpiryMins() { - return linkExpiryMins; - } - - /** - * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("should_create_magic_link_url") - public Optional getShouldCreateMagicLinkUrl() { - return shouldCreateMagicLinkUrl; - } - - /** - * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("hide_admin_magic_link") - public Optional getHideAdminMagicLink() { - return hideAdminMagicLink; - } - - /** - * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. - */ - @JsonProperty("common_models") - public Optional> getCommonModels() { - return commonModels; - } - - /** - * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. - */ - @JsonProperty("category_common_model_scopes") - public Optional>>> - getCategoryCommonModelScopes() { - return categoryCommonModelScopes; - } - - /** - * @return The following subset of IETF language tags can be used to configure localization. - *
    - *
  • en - en
  • - *
  • de - de
  • - *
- */ - @JsonProperty("language") - public Optional getLanguage() { - return language; - } - - /** - * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. - */ - @JsonProperty("are_syncs_disabled") - public Optional getAreSyncsDisabled() { - return areSyncsDisabled; - } - - /** - * @return A JSON object containing integration-specific configuration options. - */ - @JsonProperty("integration_specific_config") - public Optional> getIntegrationSpecificConfig() { - return integrationSpecificConfig; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EndUserDetailsRequest other) { - return endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && categories.equals(other.categories) - && integration.equals(other.integration) - && linkExpiryMins.equals(other.linkExpiryMins) - && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) - && hideAdminMagicLink.equals(other.hideAdminMagicLink) - && commonModels.equals(other.commonModels) - && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) - && language.equals(other.language) - && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.categories, - this.integration, - this.linkExpiryMins, - this.shouldCreateMagicLinkUrl, - this.hideAdminMagicLink, - this.commonModels, - this.categoryCommonModelScopes, - this.language, - this.areSyncsDisabled, - this.integrationSpecificConfig); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EndUserEmailAddressStage builder() { - return new Builder(); - } - - public interface EndUserEmailAddressStage { - EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); - - Builder from(EndUserDetailsRequest other); - } - - public interface EndUserOrganizationNameStage { - EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserOriginIdStage { - _FinalStage endUserOriginId(@NotNull String endUserOriginId); - } - - public interface _FinalStage { - EndUserDetailsRequest build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage integration(Optional integration); - - _FinalStage integration(String integration); - - _FinalStage linkExpiryMins(Optional linkExpiryMins); - - _FinalStage linkExpiryMins(Integer linkExpiryMins); - - _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); - - _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); - - _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); - - _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); - - _FinalStage commonModels(Optional> commonModels); - - _FinalStage commonModels(List commonModels); - - _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes); - - _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes); - - _FinalStage language(Optional language); - - _FinalStage language(LanguageEnum language); - - _FinalStage areSyncsDisabled(Optional areSyncsDisabled); - - _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); - - _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); - - _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { - private String endUserEmailAddress; - - private String endUserOrganizationName; - - private String endUserOriginId; - - private Optional> integrationSpecificConfig = Optional.empty(); - - private Optional areSyncsDisabled = Optional.empty(); - - private Optional language = Optional.empty(); - - private Optional>>> - categoryCommonModelScopes = Optional.empty(); - - private Optional> commonModels = Optional.empty(); - - private Optional hideAdminMagicLink = Optional.empty(); - - private Optional shouldCreateMagicLinkUrl = Optional.empty(); - - private Optional linkExpiryMins = Optional.empty(); - - private Optional integration = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EndUserDetailsRequest other) { - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - categories(other.getCategories()); - integration(other.getIntegration()); - linkExpiryMins(other.getLinkExpiryMins()); - shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); - hideAdminMagicLink(other.getHideAdminMagicLink()); - commonModels(other.getCommonModels()); - categoryCommonModelScopes(other.getCategoryCommonModelScopes()); - language(other.getLanguage()); - areSyncsDisabled(other.getAreSyncsDisabled()); - integrationSpecificConfig(other.getIntegrationSpecificConfig()); - return this; - } - - /** - *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_email_address") - public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - /** - *

Your end user's organization.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - /** - *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_origin_id") - public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - /** - *

A JSON object containing integration-specific configuration options.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { - this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) - public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { - this.integrationSpecificConfig = integrationSpecificConfig; - return this; - } - - /** - *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { - this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) - public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { - this.areSyncsDisabled = areSyncsDisabled; - return this; - } - - /** - *

The following subset of IETF language tags can be used to configure localization.

- *
    - *
  • en - en
  • - *
  • de - de
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage language(LanguageEnum language) { - this.language = Optional.ofNullable(language); - return this; - } - - @java.lang.Override - @JsonSetter(value = "language", nulls = Nulls.SKIP) - public _FinalStage language(Optional language) { - this.language = language; - return this; - } - - /** - *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes) { - this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) - public _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes) { - this.categoryCommonModelScopes = categoryCommonModelScopes; - return this; - } - - /** - *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage commonModels(List commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @java.lang.Override - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public _FinalStage commonModels(Optional> commonModels) { - this.commonModels = commonModels; - return this; - } - - /** - *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { - this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); - return this; - } - - @java.lang.Override - @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) - public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { - this.hideAdminMagicLink = hideAdminMagicLink; - return this; - } - - /** - *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) - public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - return this; - } - - /** - *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage linkExpiryMins(Integer linkExpiryMins) { - this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); - return this; - } - - @java.lang.Override - @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) - public _FinalStage linkExpiryMins(Optional linkExpiryMins) { - this.linkExpiryMins = linkExpiryMins; - return this; - } - - /** - *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public EndUserDetailsRequest build() { - return new EndUserDetailsRequest( - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - categories, - integration, - linkExpiryMins, - shouldCreateMagicLinkUrl, - hideAdminMagicLink, - commonModels, - categoryCommonModelScopes, - language, - areSyncsDisabled, - integrationSpecificConfig, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/locations/LocationsClient.java b/src/main/java/com/merge/api/resources/hris/locations/LocationsClient.java deleted file mode 100644 index 666274ac0..000000000 --- a/src/main/java/com/merge/api/resources/hris/locations/LocationsClient.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.locations; - -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.hris.locations.requests.LocationsListRequest; -import com.merge.api.resources.hris.locations.requests.LocationsRetrieveRequest; -import com.merge.api.resources.hris.types.Location; -import com.merge.api.resources.hris.types.PaginatedLocationList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LocationsClient { - protected final ClientOptions clientOptions; - - public LocationsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Location objects. - */ - public PaginatedLocationList list() { - return list(LocationsListRequest.builder().build()); - } - - /** - * Returns a list of Location objects. - */ - public PaginatedLocationList list(LocationsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Location objects. - */ - public PaginatedLocationList list(LocationsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/locations"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getLocationType().isPresent()) { - httpUrl.addQueryParameter( - "location_type", request.getLocationType().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedLocationList.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); - } - } - - /** - * Returns a Location object with the given id. - */ - public Location retrieve(String id) { - return retrieve(id, LocationsRetrieveRequest.builder().build()); - } - - /** - * Returns a Location object with the given id. - */ - public Location retrieve(String id, LocationsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Location object with the given id. - */ - public Location retrieve(String id, LocationsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/locations") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Location.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/passthrough/PassthroughClient.java b/src/main/java/com/merge/api/resources/hris/passthrough/PassthroughClient.java deleted file mode 100644 index 54dae4fd7..000000000 --- a/src/main/java/com/merge/api/resources/hris/passthrough/PassthroughClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.passthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.types.DataPassthroughRequest; -import com.merge.api.resources.hris.types.RemoteResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PassthroughClient { - protected final ClientOptions clientOptions; - - public PassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), RemoteResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/paygroups/PayGroupsClient.java b/src/main/java/com/merge/api/resources/hris/paygroups/PayGroupsClient.java deleted file mode 100644 index 4f2206700..000000000 --- a/src/main/java/com/merge/api/resources/hris/paygroups/PayGroupsClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.paygroups; - -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.hris.paygroups.requests.PayGroupsListRequest; -import com.merge.api.resources.hris.paygroups.requests.PayGroupsRetrieveRequest; -import com.merge.api.resources.hris.types.PaginatedPayGroupList; -import com.merge.api.resources.hris.types.PayGroup; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PayGroupsClient { - protected final ClientOptions clientOptions; - - public PayGroupsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of PayGroup objects. - */ - public PaginatedPayGroupList list() { - return list(PayGroupsListRequest.builder().build()); - } - - /** - * Returns a list of PayGroup objects. - */ - public PaginatedPayGroupList list(PayGroupsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of PayGroup objects. - */ - public PaginatedPayGroupList list(PayGroupsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/pay-groups"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedPayGroupList.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); - } - } - - /** - * Returns a PayGroup object with the given id. - */ - public PayGroup retrieve(String id) { - return retrieve(id, PayGroupsRetrieveRequest.builder().build()); - } - - /** - * Returns a PayGroup object with the given id. - */ - public PayGroup retrieve(String id, PayGroupsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a PayGroup object with the given id. - */ - public PayGroup retrieve(String id, PayGroupsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/pay-groups") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PayGroup.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/paygroups/requests/PayGroupsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/paygroups/requests/PayGroupsRetrieveRequest.java deleted file mode 100644 index 88c31349a..000000000 --- a/src/main/java/com/merge/api/resources/hris/paygroups/requests/PayGroupsRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.paygroups.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PayGroupsRetrieveRequest.Builder.class) -public final class PayGroupsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private PayGroupsRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PayGroupsRetrieveRequest && equalTo((PayGroupsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PayGroupsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PayGroupsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public PayGroupsRetrieveRequest build() { - return new PayGroupsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/payrollruns/PayrollRunsClient.java b/src/main/java/com/merge/api/resources/hris/payrollruns/PayrollRunsClient.java deleted file mode 100644 index d761dc5c9..000000000 --- a/src/main/java/com/merge/api/resources/hris/payrollruns/PayrollRunsClient.java +++ /dev/null @@ -1,201 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.payrollruns; - -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.hris.payrollruns.requests.PayrollRunsListRequest; -import com.merge.api.resources.hris.payrollruns.requests.PayrollRunsRetrieveRequest; -import com.merge.api.resources.hris.types.PaginatedPayrollRunList; -import com.merge.api.resources.hris.types.PayrollRun; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PayrollRunsClient { - protected final ClientOptions clientOptions; - - public PayrollRunsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of PayrollRun objects. - */ - public PaginatedPayrollRunList list() { - return list(PayrollRunsListRequest.builder().build()); - } - - /** - * Returns a list of PayrollRun objects. - */ - public PaginatedPayrollRunList list(PayrollRunsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of PayrollRun objects. - */ - public PaginatedPayrollRunList list(PayrollRunsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/payroll-runs"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndedAfter().isPresent()) { - httpUrl.addQueryParameter( - "ended_after", request.getEndedAfter().get().toString()); - } - if (request.getEndedBefore().isPresent()) { - httpUrl.addQueryParameter( - "ended_before", request.getEndedBefore().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getRunType().isPresent()) { - httpUrl.addQueryParameter("run_type", request.getRunType().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - if (request.getStartedAfter().isPresent()) { - httpUrl.addQueryParameter( - "started_after", request.getStartedAfter().get().toString()); - } - if (request.getStartedBefore().isPresent()) { - httpUrl.addQueryParameter( - "started_before", request.getStartedBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedPayrollRunList.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); - } - } - - /** - * Returns a PayrollRun object with the given id. - */ - public PayrollRun retrieve(String id) { - return retrieve(id, PayrollRunsRetrieveRequest.builder().build()); - } - - /** - * Returns a PayrollRun object with the given id. - */ - public PayrollRun retrieve(String id, PayrollRunsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a PayrollRun object with the given id. - */ - public PayrollRun retrieve(String id, PayrollRunsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/payroll-runs") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PayrollRun.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/api/resources/hris/regeneratekey/RegenerateKeyClient.java deleted file mode 100644 index 4223fda41..000000000 --- a/src/main/java/com/merge/api/resources/hris/regeneratekey/RegenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.regeneratekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.regeneratekey.requests.RemoteKeyForRegenerationRequest; -import com.merge.api.resources.hris.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RegenerateKeyClient { - protected final ClientOptions clientOptions; - - public RegenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request) { - return create(request, null); - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/regenerate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/resources/hris/regeneratekey/requests/RemoteKeyForRegenerationRequest.java deleted file mode 100644 index 03928946f..000000000 --- a/src/main/java/com/merge/api/resources/hris/regeneratekey/requests/RemoteKeyForRegenerationRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.regeneratekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) -public final class RemoteKeyForRegenerationRequest { - private final String name; - - private final Map additionalProperties; - - private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKeyForRegenerationRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(RemoteKeyForRegenerationRequest other); - } - - public interface _FinalStage { - RemoteKeyForRegenerationRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKeyForRegenerationRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public RemoteKeyForRegenerationRequest build() { - return new RemoteKeyForRegenerationRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/scopes/ScopesClient.java b/src/main/java/com/merge/api/resources/hris/scopes/ScopesClient.java deleted file mode 100644 index 6987b0e72..000000000 --- a/src/main/java/com/merge/api/resources/hris/scopes/ScopesClient.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.scopes; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; -import com.merge.api.resources.hris.types.CommonModelScopeApi; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ScopesClient { - protected final ClientOptions clientOptions; - - public ScopesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve() { - return defaultScopesRetrieve(null); - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/default-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve() { - return linkedAccountScopesRetrieve(null); - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/linked-account-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { - return linkedAccountScopesCreate(request, null); - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate( - LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/linked-account-scopes") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/hris/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java deleted file mode 100644 index f56412645..000000000 --- a/src/main/java/com/merge/api/resources/hris/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.scopes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.types.IndividualCommonModelScopeDeserializerRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) -public final class LinkedAccountCommonModelScopeDeserializerRequest { - private final List commonModels; - - private final Map additionalProperties; - - private LinkedAccountCommonModelScopeDeserializerRequest( - List commonModels, - Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountCommonModelScopeDeserializerRequest - && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public LinkedAccountCommonModelScopeDeserializerRequest build() { - return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/api/resources/hris/syncstatus/SyncStatusClient.java deleted file mode 100644 index 02e60fd11..000000000 --- a/src/main/java/com/merge/api/resources/hris/syncstatus/SyncStatusClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.syncstatus; - -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.hris.syncstatus.requests.SyncStatusListRequest; -import com.merge.api.resources.hris.types.PaginatedSyncStatusList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SyncStatusClient { - protected final ClientOptions clientOptions; - - public SyncStatusClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list() { - return list(SyncStatusListRequest.builder().build()); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request) { - return list(request, null); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/sync-status"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedSyncStatusList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/api/resources/hris/syncstatus/requests/SyncStatusListRequest.java deleted file mode 100644 index bcca9b918..000000000 --- a/src/main/java/com/merge/api/resources/hris/syncstatus/requests/SyncStatusListRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.syncstatus.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) -public final class SyncStatusListRequest { - private final Optional cursor; - - private final Optional pageSize; - - private final Map additionalProperties; - - private SyncStatusListRequest( - Optional cursor, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatusListRequest other) { - return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(SyncStatusListRequest other) { - cursor(other.getCursor()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public SyncStatusListRequest build() { - return new SyncStatusListRequest(cursor, pageSize, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/teams/TeamsClient.java b/src/main/java/com/merge/api/resources/hris/teams/TeamsClient.java deleted file mode 100644 index be855d6aa..000000000 --- a/src/main/java/com/merge/api/resources/hris/teams/TeamsClient.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.teams; - -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.hris.teams.requests.TeamsListRequest; -import com.merge.api.resources.hris.teams.requests.TeamsRetrieveRequest; -import com.merge.api.resources.hris.types.PaginatedTeamList; -import com.merge.api.resources.hris.types.Team; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TeamsClient { - protected final ClientOptions clientOptions; - - public TeamsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Team objects. - */ - public PaginatedTeamList list() { - return list(TeamsListRequest.builder().build()); - } - - /** - * Returns a list of Team objects. - */ - public PaginatedTeamList list(TeamsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Team objects. - */ - public PaginatedTeamList list(TeamsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/teams"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getParentTeamId().isPresent()) { - httpUrl.addQueryParameter( - "parent_team_id", request.getParentTeamId().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTeamList.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); - } - } - - /** - * Returns a Team object with the given id. - */ - public Team retrieve(String id) { - return retrieve(id, TeamsRetrieveRequest.builder().build()); - } - - /** - * Returns a Team object with the given id. - */ - public Team retrieve(String id, TeamsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Team object with the given id. - */ - public Team retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/teams") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Team.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/teams/requests/TeamsListRequest.java b/src/main/java/com/merge/api/resources/hris/teams/requests/TeamsListRequest.java deleted file mode 100644 index 91437cb20..000000000 --- a/src/main/java/com/merge/api/resources/hris/teams/requests/TeamsListRequest.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.teams.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TeamsListRequest.Builder.class) -public final class TeamsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional parentTeamId; - - private final Optional remoteId; - - private final Map additionalProperties; - - private TeamsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional parentTeamId, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.parentTeamId = parentTeamId; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If provided, will only return teams with this parent team. - */ - @JsonProperty("parent_team_id") - public Optional getParentTeamId() { - return parentTeamId; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TeamsListRequest && equalTo((TeamsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TeamsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && parentTeamId.equals(other.parentTeamId) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.parentTeamId, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional parentTeamId = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TeamsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - parentTeamId(other.getParentTeamId()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "parent_team_id", nulls = Nulls.SKIP) - public Builder parentTeamId(Optional parentTeamId) { - this.parentTeamId = parentTeamId; - return this; - } - - public Builder parentTeamId(String parentTeamId) { - this.parentTeamId = Optional.ofNullable(parentTeamId); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public TeamsListRequest build() { - return new TeamsListRequest( - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - parentTeamId, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/teams/requests/TeamsRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/teams/requests/TeamsRetrieveRequest.java deleted file mode 100644 index 93812850b..000000000 --- a/src/main/java/com/merge/api/resources/hris/teams/requests/TeamsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.teams.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TeamsRetrieveRequest.Builder.class) -public final class TeamsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private TeamsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TeamsRetrieveRequest && equalTo((TeamsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TeamsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TeamsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public TeamsRetrieveRequest build() { - return new TeamsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/TimeOffClient.java b/src/main/java/com/merge/api/resources/hris/timeoff/TimeOffClient.java deleted file mode 100644 index 428a57a5e..000000000 --- a/src/main/java/com/merge/api/resources/hris/timeoff/TimeOffClient.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.timeoff; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.timeoff.requests.TimeOffEndpointRequest; -import com.merge.api.resources.hris.timeoff.requests.TimeOffListRequest; -import com.merge.api.resources.hris.timeoff.requests.TimeOffRetrieveRequest; -import com.merge.api.resources.hris.types.MetaResponse; -import com.merge.api.resources.hris.types.PaginatedTimeOffList; -import com.merge.api.resources.hris.types.TimeOff; -import com.merge.api.resources.hris.types.TimeOffResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TimeOffClient { - protected final ClientOptions clientOptions; - - public TimeOffClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of TimeOff objects. - */ - public PaginatedTimeOffList list() { - return list(TimeOffListRequest.builder().build()); - } - - /** - * Returns a list of TimeOff objects. - */ - public PaginatedTimeOffList list(TimeOffListRequest request) { - return list(request, null); - } - - /** - * Returns a list of TimeOff objects. - */ - public PaginatedTimeOffList list(TimeOffListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/time-off"); - if (request.getApproverId().isPresent()) { - httpUrl.addQueryParameter("approver_id", request.getApproverId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmployeeId().isPresent()) { - httpUrl.addQueryParameter("employee_id", request.getEmployeeId().get()); - } - if (request.getEndedAfter().isPresent()) { - httpUrl.addQueryParameter( - "ended_after", request.getEndedAfter().get().toString()); - } - if (request.getEndedBefore().isPresent()) { - httpUrl.addQueryParameter( - "ended_before", request.getEndedBefore().get().toString()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getRequestType().isPresent()) { - httpUrl.addQueryParameter( - "request_type", request.getRequestType().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - if (request.getStartedAfter().isPresent()) { - httpUrl.addQueryParameter( - "started_after", request.getStartedAfter().get().toString()); - } - if (request.getStartedBefore().isPresent()) { - httpUrl.addQueryParameter( - "started_before", request.getStartedBefore().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTimeOffList.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); - } - } - - /** - * Creates a TimeOff object with the given values. - */ - public TimeOffResponse create(TimeOffEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a TimeOff object with the given values. - */ - public TimeOffResponse create(TimeOffEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/time-off"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TimeOffResponse.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); - } - } - - /** - * Returns a TimeOff object with the given id. - */ - public TimeOff retrieve(String id) { - return retrieve(id, TimeOffRetrieveRequest.builder().build()); - } - - /** - * Returns a TimeOff object with the given id. - */ - public TimeOff retrieve(String id, TimeOffRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a TimeOff object with the given id. - */ - public TimeOff retrieve(String id, TimeOffRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/time-off") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TimeOff.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); - } - } - - /** - * Returns metadata for TimeOff POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for TimeOff POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/time-off/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffRetrieveRequest.java deleted file mode 100644 index 59bfb6a1e..000000000 --- a/src/main/java/com/merge/api/resources/hris/timeoff/requests/TimeOffRetrieveRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.timeoff.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.hris.timeoff.types.TimeOffRetrieveRequestExpand; -import com.merge.api.resources.hris.timeoff.types.TimeOffRetrieveRequestRemoteFields; -import com.merge.api.resources.hris.timeoff.types.TimeOffRetrieveRequestShowEnumOrigins; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TimeOffRetrieveRequest.Builder.class) -public final class TimeOffRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Optional remoteFields; - - private final Optional showEnumOrigins; - - private final Map additionalProperties; - - private TimeOffRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Optional remoteFields, - Optional showEnumOrigins, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.remoteFields = remoteFields; - this.showEnumOrigins = showEnumOrigins; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Deprecated. Use show_enum_origins. - */ - @JsonProperty("remote_fields") - public Optional getRemoteFields() { - return remoteFields; - } - - /** - * @return A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. Learn more - */ - @JsonProperty("show_enum_origins") - public Optional getShowEnumOrigins() { - return showEnumOrigins; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffRetrieveRequest && equalTo((TimeOffRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TimeOffRetrieveRequest other) { - return expand.equals(other.expand) - && includeRemoteData.equals(other.includeRemoteData) - && remoteFields.equals(other.remoteFields) - && showEnumOrigins.equals(other.showEnumOrigins); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional remoteFields = Optional.empty(); - - private Optional showEnumOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TimeOffRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - remoteFields(other.getRemoteFields()); - showEnumOrigins(other.getShowEnumOrigins()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(TimeOffRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { - this.remoteFields = remoteFields; - return this; - } - - public Builder remoteFields(TimeOffRetrieveRequestRemoteFields remoteFields) { - this.remoteFields = Optional.ofNullable(remoteFields); - return this; - } - - @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) - public Builder showEnumOrigins(Optional showEnumOrigins) { - this.showEnumOrigins = showEnumOrigins; - return this; - } - - public Builder showEnumOrigins(TimeOffRetrieveRequestShowEnumOrigins showEnumOrigins) { - this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); - return this; - } - - public TimeOffRetrieveRequest build() { - return new TimeOffRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestExpand.java b/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestExpand.java deleted file mode 100644 index f3e70395d..000000000 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.timeoff.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TimeOffListRequestExpand { - APPROVER("approver"), - - EMPLOYEE("employee"), - - EMPLOYEE_APPROVER("employee,approver"); - - private final String value; - - TimeOffListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestExpand.java deleted file mode 100644 index 0cabcc32f..000000000 --- a/src/main/java/com/merge/api/resources/hris/timeoff/types/TimeOffRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.timeoff.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TimeOffRetrieveRequestExpand { - APPROVER("approver"), - - EMPLOYEE("employee"), - - EMPLOYEE_APPROVER("employee,approver"); - - private final String value; - - TimeOffRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/timeoffbalances/TimeOffBalancesClient.java b/src/main/java/com/merge/api/resources/hris/timeoffbalances/TimeOffBalancesClient.java deleted file mode 100644 index 7b72a90c3..000000000 --- a/src/main/java/com/merge/api/resources/hris/timeoffbalances/TimeOffBalancesClient.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.timeoffbalances; - -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.hris.timeoffbalances.requests.TimeOffBalancesListRequest; -import com.merge.api.resources.hris.timeoffbalances.requests.TimeOffBalancesRetrieveRequest; -import com.merge.api.resources.hris.types.PaginatedTimeOffBalanceList; -import com.merge.api.resources.hris.types.TimeOffBalance; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TimeOffBalancesClient { - protected final ClientOptions clientOptions; - - public TimeOffBalancesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of TimeOffBalance objects. - */ - public PaginatedTimeOffBalanceList list() { - return list(TimeOffBalancesListRequest.builder().build()); - } - - /** - * Returns a list of TimeOffBalance objects. - */ - public PaginatedTimeOffBalanceList list(TimeOffBalancesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of TimeOffBalance objects. - */ - public PaginatedTimeOffBalanceList list(TimeOffBalancesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/time-off-balances"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmployeeId().isPresent()) { - httpUrl.addQueryParameter("employee_id", request.getEmployeeId().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getPolicyType().isPresent()) { - httpUrl.addQueryParameter( - "policy_type", request.getPolicyType().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTimeOffBalanceList.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); - } - } - - /** - * Returns a TimeOffBalance object with the given id. - */ - public TimeOffBalance retrieve(String id) { - return retrieve(id, TimeOffBalancesRetrieveRequest.builder().build()); - } - - /** - * Returns a TimeOffBalance object with the given id. - */ - public TimeOffBalance retrieve(String id, TimeOffBalancesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a TimeOffBalance object with the given id. - */ - public TimeOffBalance retrieve(String id, TimeOffBalancesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/time-off-balances") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TimeOffBalance.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/timesheetentries/TimesheetEntriesClient.java b/src/main/java/com/merge/api/resources/hris/timesheetentries/TimesheetEntriesClient.java deleted file mode 100644 index 2c0a69e9b..000000000 --- a/src/main/java/com/merge/api/resources/hris/timesheetentries/TimesheetEntriesClient.java +++ /dev/null @@ -1,298 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.timesheetentries; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.timesheetentries.requests.TimesheetEntriesListRequest; -import com.merge.api.resources.hris.timesheetentries.requests.TimesheetEntriesRetrieveRequest; -import com.merge.api.resources.hris.timesheetentries.requests.TimesheetEntryEndpointRequest; -import com.merge.api.resources.hris.types.MetaResponse; -import com.merge.api.resources.hris.types.PaginatedTimesheetEntryList; -import com.merge.api.resources.hris.types.TimesheetEntry; -import com.merge.api.resources.hris.types.TimesheetEntryResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TimesheetEntriesClient { - protected final ClientOptions clientOptions; - - public TimesheetEntriesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of TimesheetEntry objects. - */ - public PaginatedTimesheetEntryList list() { - return list(TimesheetEntriesListRequest.builder().build()); - } - - /** - * Returns a list of TimesheetEntry objects. - */ - public PaginatedTimesheetEntryList list(TimesheetEntriesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of TimesheetEntry objects. - */ - public PaginatedTimesheetEntryList list(TimesheetEntriesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/timesheet-entries"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmployeeId().isPresent()) { - httpUrl.addQueryParameter("employee_id", request.getEmployeeId().get()); - } - if (request.getEndedAfter().isPresent()) { - httpUrl.addQueryParameter( - "ended_after", request.getEndedAfter().get().toString()); - } - if (request.getEndedBefore().isPresent()) { - httpUrl.addQueryParameter( - "ended_before", request.getEndedBefore().get().toString()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getOrderBy().isPresent()) { - httpUrl.addQueryParameter("order_by", request.getOrderBy().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getStartedAfter().isPresent()) { - httpUrl.addQueryParameter( - "started_after", request.getStartedAfter().get().toString()); - } - if (request.getStartedBefore().isPresent()) { - httpUrl.addQueryParameter( - "started_before", request.getStartedBefore().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTimesheetEntryList.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); - } - } - - /** - * Creates a TimesheetEntry object with the given values. - */ - public TimesheetEntryResponse create(TimesheetEntryEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a TimesheetEntry object with the given values. - */ - public TimesheetEntryResponse create(TimesheetEntryEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/timesheet-entries"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TimesheetEntryResponse.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); - } - } - - /** - * Returns a TimesheetEntry object with the given id. - */ - public TimesheetEntry retrieve(String id) { - return retrieve(id, TimesheetEntriesRetrieveRequest.builder().build()); - } - - /** - * Returns a TimesheetEntry object with the given id. - */ - public TimesheetEntry retrieve(String id, TimesheetEntriesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a TimesheetEntry object with the given id. - */ - public TimesheetEntry retrieve(String id, TimesheetEntriesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/timesheet-entries") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TimesheetEntry.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); - } - } - - /** - * Returns metadata for TimesheetEntry POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for TimesheetEntry POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/timesheet-entries/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntriesRetrieveRequest.java b/src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntriesRetrieveRequest.java deleted file mode 100644 index 81deb020b..000000000 --- a/src/main/java/com/merge/api/resources/hris/timesheetentries/requests/TimesheetEntriesRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.timesheetentries.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TimesheetEntriesRetrieveRequest.Builder.class) -public final class TimesheetEntriesRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private TimesheetEntriesRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimesheetEntriesRetrieveRequest && equalTo((TimesheetEntriesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TimesheetEntriesRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TimesheetEntriesRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public TimesheetEntriesRetrieveRequest build() { - return new TimesheetEntriesRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AccountDetails.java b/src/main/java/com/merge/api/resources/hris/types/AccountDetails.java deleted file mode 100644 index 6f1537888..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AccountDetails.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetails.Builder.class) -public final class AccountDetails { - private final Optional id; - - private final Optional integration; - - private final Optional integrationSlug; - - private final Optional category; - - private final Optional endUserOriginId; - - private final Optional endUserOrganizationName; - - private final Optional endUserEmailAddress; - - private final Optional status; - - private final Optional webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional accountType; - - private final Optional completedAt; - - private final Map additionalProperties; - - private AccountDetails( - Optional id, - Optional integration, - Optional integrationSlug, - Optional category, - Optional endUserOriginId, - Optional endUserOrganizationName, - Optional endUserEmailAddress, - Optional status, - Optional webhookListenerUrl, - Optional isDuplicate, - Optional accountType, - Optional completedAt, - Map additionalProperties) { - this.id = id; - this.integration = integration; - this.integrationSlug = integrationSlug; - this.category = category; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.status = status; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("integration_slug") - public Optional getIntegrationSlug() { - return integrationSlug; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("webhook_listener_url") - public Optional getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The time at which account completes the linking flow. - */ - @JsonProperty("completed_at") - public Optional getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetails && equalTo((AccountDetails) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetails other) { - return id.equals(other.id) - && integration.equals(other.integration) - && integrationSlug.equals(other.integrationSlug) - && category.equals(other.category) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && status.equals(other.status) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.integration, - this.integrationSlug, - this.category, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.status, - this.webhookListenerUrl, - this.isDuplicate, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional integration = Optional.empty(); - - private Optional integrationSlug = Optional.empty(); - - private Optional category = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional webhookListenerUrl = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional completedAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountDetails other) { - id(other.getId()); - integration(other.getIntegration()); - integrationSlug(other.getIntegrationSlug()); - category(other.getCategory()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - status(other.getStatus()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public Builder integration(Optional integration) { - this.integration = integration; - return this; - } - - public Builder integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) - public Builder integrationSlug(Optional integrationSlug) { - this.integrationSlug = integrationSlug; - return this; - } - - public Builder integrationSlug(String integrationSlug) { - this.integrationSlug = Optional.ofNullable(integrationSlug); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) - public Builder webhookListenerUrl(Optional webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - public Builder webhookListenerUrl(String webhookListenerUrl) { - this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); - return this; - } - - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public Builder isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - public Builder isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(String accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) - public Builder completedAt(Optional completedAt) { - this.completedAt = completedAt; - return this; - } - - public Builder completedAt(OffsetDateTime completedAt) { - this.completedAt = Optional.ofNullable(completedAt); - return this; - } - - public AccountDetails build() { - return new AccountDetails( - id, - integration, - integrationSlug, - category, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - status, - webhookListenerUrl, - isDuplicate, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActions.java deleted file mode 100644 index 0725c36db..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActions.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) -public final class AccountDetailsAndActions { - private final String id; - - private final Optional category; - - private final AccountDetailsAndActionsStatusEnum status; - - private final Optional statusDetail; - - private final Optional endUserOriginId; - - private final String endUserOrganizationName; - - private final String endUserEmailAddress; - - private final Optional subdomain; - - private final String webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional integration; - - private final String accountType; - - private final OffsetDateTime completedAt; - - private final Map additionalProperties; - - private AccountDetailsAndActions( - String id, - Optional category, - AccountDetailsAndActionsStatusEnum status, - Optional statusDetail, - Optional endUserOriginId, - String endUserOrganizationName, - String endUserEmailAddress, - Optional subdomain, - String webhookListenerUrl, - Optional isDuplicate, - Optional integration, - String accountType, - OffsetDateTime completedAt, - Map additionalProperties) { - this.id = id; - this.category = category; - this.status = status; - this.statusDetail = statusDetail; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.subdomain = subdomain; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.integration = integration; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("status") - public AccountDetailsAndActionsStatusEnum getStatus() { - return status; - } - - @JsonProperty("status_detail") - public Optional getStatusDetail() { - return statusDetail; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return The tenant or domain the customer has provided access to. - */ - @JsonProperty("subdomain") - public Optional getSubdomain() { - return subdomain; - } - - @JsonProperty("webhook_listener_url") - public String getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("account_type") - public String getAccountType() { - return accountType; - } - - @JsonProperty("completed_at") - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActions other) { - return id.equals(other.id) - && category.equals(other.category) - && status.equals(other.status) - && statusDetail.equals(other.statusDetail) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && subdomain.equals(other.subdomain) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && integration.equals(other.integration) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.category, - this.status, - this.statusDetail, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.subdomain, - this.webhookListenerUrl, - this.isDuplicate, - this.integration, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - StatusStage id(@NotNull String id); - - Builder from(AccountDetailsAndActions other); - } - - public interface StatusStage { - EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); - } - - public interface EndUserOrganizationNameStage { - EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserEmailAddressStage { - WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); - } - - public interface WebhookListenerUrlStage { - AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); - } - - public interface AccountTypeStage { - CompletedAtStage accountType(@NotNull String accountType); - } - - public interface CompletedAtStage { - _FinalStage completedAt(@NotNull OffsetDateTime completedAt); - } - - public interface _FinalStage { - AccountDetailsAndActions build(); - - _FinalStage category(Optional category); - - _FinalStage category(CategoryEnum category); - - _FinalStage statusDetail(Optional statusDetail); - - _FinalStage statusDetail(String statusDetail); - - _FinalStage endUserOriginId(Optional endUserOriginId); - - _FinalStage endUserOriginId(String endUserOriginId); - - _FinalStage subdomain(Optional subdomain); - - _FinalStage subdomain(String subdomain); - - _FinalStage isDuplicate(Optional isDuplicate); - - _FinalStage isDuplicate(Boolean isDuplicate); - - _FinalStage integration(Optional integration); - - _FinalStage integration(AccountDetailsAndActionsIntegration integration); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements IdStage, - StatusStage, - EndUserOrganizationNameStage, - EndUserEmailAddressStage, - WebhookListenerUrlStage, - AccountTypeStage, - CompletedAtStage, - _FinalStage { - private String id; - - private AccountDetailsAndActionsStatusEnum status; - - private String endUserOrganizationName; - - private String endUserEmailAddress; - - private String webhookListenerUrl; - - private String accountType; - - private OffsetDateTime completedAt; - - private Optional integration = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional subdomain = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional statusDetail = Optional.empty(); - - private Optional category = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActions other) { - id(other.getId()); - category(other.getCategory()); - status(other.getStatus()); - statusDetail(other.getStatusDetail()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - subdomain(other.getSubdomain()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - integration(other.getIntegration()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public StatusStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_email_address") - public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - @java.lang.Override - @JsonSetter("webhook_listener_url") - public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - @java.lang.Override - @JsonSetter("account_type") - public CompletedAtStage accountType(@NotNull String accountType) { - this.accountType = accountType; - return this; - } - - @java.lang.Override - @JsonSetter("completed_at") - public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - @java.lang.Override - public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public _FinalStage isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - /** - *

The tenant or domain the customer has provided access to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage subdomain(String subdomain) { - this.subdomain = Optional.ofNullable(subdomain); - return this; - } - - @java.lang.Override - @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) - public _FinalStage subdomain(Optional subdomain) { - this.subdomain = subdomain; - return this; - } - - @java.lang.Override - public _FinalStage endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public _FinalStage endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - @java.lang.Override - public _FinalStage statusDetail(String statusDetail) { - this.statusDetail = Optional.ofNullable(statusDetail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) - public _FinalStage statusDetail(Optional statusDetail) { - this.statusDetail = statusDetail; - return this; - } - - @java.lang.Override - public _FinalStage category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public _FinalStage category(Optional category) { - this.category = category; - return this; - } - - @java.lang.Override - public AccountDetailsAndActions build() { - return new AccountDetailsAndActions( - id, - category, - status, - statusDetail, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - subdomain, - webhookListenerUrl, - isDuplicate, - integration, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActionsIntegration.java deleted file mode 100644 index 84e57e91e..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActionsIntegration.java +++ /dev/null @@ -1,328 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) -public final class AccountDetailsAndActionsIntegration { - private final String name; - - private final List categories; - - private final Optional image; - - private final Optional squareImage; - - private final String color; - - private final String slug; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AccountDetailsAndActionsIntegration( - String name, - List categories, - Optional image, - Optional squareImage, - String color, - String slug, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.name = name; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - @JsonProperty("image") - public Optional getImage() { - return image; - } - - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - @JsonProperty("color") - public String getColor() { - return color; - } - - @JsonProperty("slug") - public String getSlug() { - return slug; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActionsIntegration - && equalTo((AccountDetailsAndActionsIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActionsIntegration other) { - return name.equals(other.name) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.passthroughAvailable, - this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - ColorStage name(@NotNull String name); - - Builder from(AccountDetailsAndActionsIntegration other); - } - - public interface ColorStage { - SlugStage color(@NotNull String color); - } - - public interface SlugStage { - PassthroughAvailableStage slug(@NotNull String slug); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AccountDetailsAndActionsIntegration build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { - private String name; - - private String color; - - private String slug; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActionsIntegration other) { - name(other.getName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public ColorStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("color") - public SlugStage color(@NotNull String color) { - this.color = color; - return this; - } - - @java.lang.Override - @JsonSetter("slug") - public PassthroughAvailableStage slug(@NotNull String slug) { - this.slug = slug; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public AccountDetailsAndActionsIntegration build() { - return new AccountDetailsAndActionsIntegration( - name, - categories, - image, - squareImage, - color, - slug, - passthroughAvailable, - availableModelOperations, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActionsStatusEnum.java deleted file mode 100644 index 825822f80..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AccountDetailsAndActionsStatusEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AccountDetailsAndActionsStatusEnum { - COMPLETE("COMPLETE"), - - INCOMPLETE("INCOMPLETE"), - - RELINK_NEEDED("RELINK_NEEDED"), - - IDLE("IDLE"); - - private final String value; - - AccountDetailsAndActionsStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AccountIntegration.java b/src/main/java/com/merge/api/resources/hris/types/AccountIntegration.java deleted file mode 100644 index 54d691f72..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AccountIntegration.java +++ /dev/null @@ -1,463 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountIntegration.Builder.class) -public final class AccountIntegration { - private final String name; - - private final Optional abbreviatedName; - - private final Optional> categories; - - private final Optional image; - - private final Optional squareImage; - - private final Optional color; - - private final Optional slug; - - private final Optional> apiEndpointsToDocumentationUrls; - - private final Optional webhookSetupGuideUrl; - - private final Optional> categoryBetaStatus; - - private final Map additionalProperties; - - private AccountIntegration( - String name, - Optional abbreviatedName, - Optional> categories, - Optional image, - Optional squareImage, - Optional color, - Optional slug, - Optional> apiEndpointsToDocumentationUrls, - Optional webhookSetupGuideUrl, - Optional> categoryBetaStatus, - Map additionalProperties) { - this.name = name; - this.abbreviatedName = abbreviatedName; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - this.categoryBetaStatus = categoryBetaStatus; - this.additionalProperties = additionalProperties; - } - - /** - * @return Company name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> - */ - @JsonProperty("abbreviated_name") - public Optional getAbbreviatedName() { - return abbreviatedName; - } - - /** - * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. - */ - @JsonProperty("categories") - public Optional> getCategories() { - return categories; - } - - /** - * @return Company logo in rectangular shape. - */ - @JsonProperty("image") - public Optional getImage() { - return image; - } - - /** - * @return Company logo in square shape. - */ - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - /** - * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> - */ - @JsonProperty("color") - public Optional getColor() { - return color; - } - - @JsonProperty("slug") - public Optional getSlug() { - return slug; - } - - /** - * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} - */ - @JsonProperty("api_endpoints_to_documentation_urls") - public Optional> getApiEndpointsToDocumentationUrls() { - return apiEndpointsToDocumentationUrls; - } - - /** - * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. - */ - @JsonProperty("webhook_setup_guide_url") - public Optional getWebhookSetupGuideUrl() { - return webhookSetupGuideUrl; - } - - /** - * @return Category or categories this integration is in beta status for. - */ - @JsonProperty("category_beta_status") - public Optional> getCategoryBetaStatus() { - return categoryBetaStatus; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountIntegration && equalTo((AccountIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountIntegration other) { - return name.equals(other.name) - && abbreviatedName.equals(other.abbreviatedName) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) - && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) - && categoryBetaStatus.equals(other.categoryBetaStatus); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.abbreviatedName, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.apiEndpointsToDocumentationUrls, - this.webhookSetupGuideUrl, - this.categoryBetaStatus); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(AccountIntegration other); - } - - public interface _FinalStage { - AccountIntegration build(); - - _FinalStage abbreviatedName(Optional abbreviatedName); - - _FinalStage abbreviatedName(String abbreviatedName); - - _FinalStage categories(Optional> categories); - - _FinalStage categories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage color(Optional color); - - _FinalStage color(String color); - - _FinalStage slug(Optional slug); - - _FinalStage slug(String slug); - - _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); - - _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); - - _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); - - _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); - - _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); - - _FinalStage categoryBetaStatus(Map categoryBetaStatus); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - private Optional> categoryBetaStatus = Optional.empty(); - - private Optional webhookSetupGuideUrl = Optional.empty(); - - private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); - - private Optional slug = Optional.empty(); - - private Optional color = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private Optional> categories = Optional.empty(); - - private Optional abbreviatedName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountIntegration other) { - name(other.getName()); - abbreviatedName(other.getAbbreviatedName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); - webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); - categoryBetaStatus(other.getCategoryBetaStatus()); - return this; - } - - /** - *

Company name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

Category or categories this integration is in beta status for.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { - this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) - public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { - this.categoryBetaStatus = categoryBetaStatus; - return this; - } - - /** - *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) - public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - return this; - } - - /** - *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); - return this; - } - - @java.lang.Override - @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) - public _FinalStage apiEndpointsToDocumentationUrls( - Optional> apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - return this; - } - - @java.lang.Override - public _FinalStage slug(String slug) { - this.slug = Optional.ofNullable(slug); - return this; - } - - @java.lang.Override - @JsonSetter(value = "slug", nulls = Nulls.SKIP) - public _FinalStage slug(Optional slug) { - this.slug = slug; - return this; - } - - /** - *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage color(String color) { - this.color = Optional.ofNullable(color); - return this; - } - - @java.lang.Override - @JsonSetter(value = "color", nulls = Nulls.SKIP) - public _FinalStage color(Optional color) { - this.color = color; - return this; - } - - /** - *

Company logo in square shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - /** - *

Company logo in rectangular shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - /** - *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categories(List categories) { - this.categories = Optional.ofNullable(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(Optional> categories) { - this.categories = categories; - return this; - } - - /** - *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage abbreviatedName(String abbreviatedName) { - this.abbreviatedName = Optional.ofNullable(abbreviatedName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) - public _FinalStage abbreviatedName(Optional abbreviatedName) { - this.abbreviatedName = abbreviatedName; - return this; - } - - @java.lang.Override - public AccountIntegration build() { - return new AccountIntegration( - name, - abbreviatedName, - categories, - image, - squareImage, - color, - slug, - apiEndpointsToDocumentationUrls, - webhookSetupGuideUrl, - categoryBetaStatus, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AccountToken.java b/src/main/java/com/merge/api/resources/hris/types/AccountToken.java deleted file mode 100644 index cc5fe635f..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AccountToken.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountToken.Builder.class) -public final class AccountToken { - private final String accountToken; - - private final AccountIntegration integration; - - private final Map additionalProperties; - - private AccountToken( - String accountToken, AccountIntegration integration, Map additionalProperties) { - this.accountToken = accountToken; - this.integration = integration; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public String getAccountToken() { - return accountToken; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountToken && equalTo((AccountToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountToken other) { - return accountToken.equals(other.accountToken) && integration.equals(other.integration); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.accountToken, this.integration); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccountTokenStage builder() { - return new Builder(); - } - - public interface AccountTokenStage { - IntegrationStage accountToken(@NotNull String accountToken); - - Builder from(AccountToken other); - } - - public interface IntegrationStage { - _FinalStage integration(@NotNull AccountIntegration integration); - } - - public interface _FinalStage { - AccountToken build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountTokenStage, IntegrationStage, _FinalStage { - private String accountToken; - - private AccountIntegration integration; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountToken other) { - accountToken(other.getAccountToken()); - integration(other.getIntegration()); - return this; - } - - @java.lang.Override - @JsonSetter("account_token") - public IntegrationStage accountToken(@NotNull String accountToken) { - this.accountToken = accountToken; - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public _FinalStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - public AccountToken build() { - return new AccountToken(accountToken, integration, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AdvancedMetadata.java b/src/main/java/com/merge/api/resources/hris/types/AdvancedMetadata.java deleted file mode 100644 index ef17ab471..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AdvancedMetadata.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedMetadata.Builder.class) -public final class AdvancedMetadata { - private final String id; - - private final Optional displayName; - - private final Optional description; - - private final Optional isRequired; - - private final Optional isCustom; - - private final Optional> fieldChoices; - - private final Map additionalProperties; - - private AdvancedMetadata( - String id, - Optional displayName, - Optional description, - Optional isRequired, - Optional isCustom, - Optional> fieldChoices, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.description = description; - this.isRequired = isRequired; - this.isCustom = isCustom; - this.fieldChoices = fieldChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedMetadata other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && description.equals(other.description) - && isRequired.equals(other.isRequired) - && isCustom.equals(other.isCustom) - && fieldChoices.equals(other.fieldChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - _FinalStage id(@NotNull String id); - - Builder from(AdvancedMetadata other); - } - - public interface _FinalStage { - AdvancedMetadata build(); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage description(Optional description); - - _FinalStage description(String description); - - _FinalStage isRequired(Optional isRequired); - - _FinalStage isRequired(Boolean isRequired); - - _FinalStage isCustom(Optional isCustom); - - _FinalStage isCustom(Boolean isCustom); - - _FinalStage fieldChoices(Optional> fieldChoices); - - _FinalStage fieldChoices(List fieldChoices); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, _FinalStage { - private String id; - - private Optional> fieldChoices = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedMetadata other) { - id(other.getId()); - displayName(other.getDisplayName()); - description(other.getDescription()); - isRequired(other.getIsRequired()); - isCustom(other.getIsCustom()); - fieldChoices(other.getFieldChoices()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public _FinalStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - public _FinalStage fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public _FinalStage fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - @java.lang.Override - public _FinalStage isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public _FinalStage isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - @java.lang.Override - public _FinalStage isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public _FinalStage isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - @java.lang.Override - public _FinalStage description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @java.lang.Override - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public _FinalStage description(Optional description) { - this.description = description; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - @java.lang.Override - public AdvancedMetadata build() { - return new AdvancedMetadata( - id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/resources/hris/types/AsyncPassthroughReciept.java deleted file mode 100644 index cae9e2f50..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AsyncPassthroughReciept.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) -public final class AsyncPassthroughReciept { - private final String asyncPassthroughReceiptId; - - private final Map additionalProperties; - - private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("async_passthrough_receipt_id") - public String getAsyncPassthroughReceiptId() { - return asyncPassthroughReceiptId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AsyncPassthroughReciept other) { - return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncPassthroughReceiptId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AsyncPassthroughReceiptIdStage builder() { - return new Builder(); - } - - public interface AsyncPassthroughReceiptIdStage { - _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); - - Builder from(AsyncPassthroughReciept other); - } - - public interface _FinalStage { - AsyncPassthroughReciept build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { - private String asyncPassthroughReceiptId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AsyncPassthroughReciept other) { - asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); - return this; - } - - @java.lang.Override - @JsonSetter("async_passthrough_receipt_id") - public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - return this; - } - - @java.lang.Override - public AsyncPassthroughReciept build() { - return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AuditLogEvent.java b/src/main/java/com/merge/api/resources/hris/types/AuditLogEvent.java deleted file mode 100644 index 5ed7afabc..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AuditLogEvent.java +++ /dev/null @@ -1,447 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditLogEvent.Builder.class) -public final class AuditLogEvent { - private final Optional id; - - private final Optional userName; - - private final Optional userEmail; - - private final AuditLogEventRole role; - - private final String ipAddress; - - private final AuditLogEventEventType eventType; - - private final String eventDescription; - - private final Optional createdAt; - - private final Map additionalProperties; - - private AuditLogEvent( - Optional id, - Optional userName, - Optional userEmail, - AuditLogEventRole role, - String ipAddress, - AuditLogEventEventType eventType, - String eventDescription, - Optional createdAt, - Map additionalProperties) { - this.id = id; - this.userName = userName; - this.userEmail = userEmail; - this.role = role; - this.ipAddress = ipAddress; - this.eventType = eventType; - this.eventDescription = eventDescription; - this.createdAt = createdAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The User's full name at the time of this Event occurring. - */ - @JsonProperty("user_name") - public Optional getUserName() { - return userName; - } - - /** - * @return The User's email at the time of this Event occurring. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - /** - * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. - *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- */ - @JsonProperty("role") - public AuditLogEventRole getRole() { - return role; - } - - @JsonProperty("ip_address") - public String getIpAddress() { - return ipAddress; - } - - /** - * @return Designates the type of event that occurred. - *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- */ - @JsonProperty("event_type") - public AuditLogEventEventType getEventType() { - return eventType; - } - - @JsonProperty("event_description") - public String getEventDescription() { - return eventDescription; - } - - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditLogEvent other) { - return id.equals(other.id) - && userName.equals(other.userName) - && userEmail.equals(other.userEmail) - && role.equals(other.role) - && ipAddress.equals(other.ipAddress) - && eventType.equals(other.eventType) - && eventDescription.equals(other.eventDescription) - && createdAt.equals(other.createdAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.userName, - this.userEmail, - this.role, - this.ipAddress, - this.eventType, - this.eventDescription, - this.createdAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RoleStage builder() { - return new Builder(); - } - - public interface RoleStage { - IpAddressStage role(@NotNull AuditLogEventRole role); - - Builder from(AuditLogEvent other); - } - - public interface IpAddressStage { - EventTypeStage ipAddress(@NotNull String ipAddress); - } - - public interface EventTypeStage { - EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); - } - - public interface EventDescriptionStage { - _FinalStage eventDescription(@NotNull String eventDescription); - } - - public interface _FinalStage { - AuditLogEvent build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage userName(Optional userName); - - _FinalStage userName(String userName); - - _FinalStage userEmail(Optional userEmail); - - _FinalStage userEmail(String userEmail); - - _FinalStage createdAt(Optional createdAt); - - _FinalStage createdAt(OffsetDateTime createdAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { - private AuditLogEventRole role; - - private String ipAddress; - - private AuditLogEventEventType eventType; - - private String eventDescription; - - private Optional createdAt = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - private Optional userName = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AuditLogEvent other) { - id(other.getId()); - userName(other.getUserName()); - userEmail(other.getUserEmail()); - role(other.getRole()); - ipAddress(other.getIpAddress()); - eventType(other.getEventType()); - eventDescription(other.getEventDescription()); - createdAt(other.getCreatedAt()); - return this; - } - - /** - *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

- *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("role") - public IpAddressStage role(@NotNull AuditLogEventRole role) { - this.role = role; - return this; - } - - @java.lang.Override - @JsonSetter("ip_address") - public EventTypeStage ipAddress(@NotNull String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - *

Designates the type of event that occurred.

- *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("event_type") - public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { - this.eventType = eventType; - return this; - } - - @java.lang.Override - @JsonSetter("event_description") - public _FinalStage eventDescription(@NotNull String eventDescription) { - this.eventDescription = eventDescription; - return this; - } - - @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public _FinalStage createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The User's email at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public _FinalStage userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - *

The User's full name at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userName(String userName) { - this.userName = Optional.ofNullable(userName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_name", nulls = Nulls.SKIP) - public _FinalStage userName(Optional userName) { - this.userName = userName; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public AuditLogEvent build() { - return new AuditLogEvent( - id, - userName, - userEmail, - role, - ipAddress, - eventType, - eventDescription, - createdAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/resources/hris/types/AuditLogEventEventType.java deleted file mode 100644 index 1d8c6e12b..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AuditLogEventEventType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) -public final class AuditLogEventEventType { - private final Object value; - - private final int type; - - private AuditLogEventEventType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EventTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); - } - - private boolean equalTo(AuditLogEventEventType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventEventType of(EventTypeEnum value) { - return new AuditLogEventEventType(value, 0); - } - - public static AuditLogEventEventType of(String value) { - return new AuditLogEventEventType(value, 1); - } - - public interface Visitor { - T visit(EventTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventEventType.class); - } - - @java.lang.Override - public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AuditLogEventRole.java b/src/main/java/com/merge/api/resources/hris/types/AuditLogEventRole.java deleted file mode 100644 index 32152bd0d..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AuditLogEventRole.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) -public final class AuditLogEventRole { - private final Object value; - - private final int type; - - private AuditLogEventRole(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RoleEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); - } - - private boolean equalTo(AuditLogEventRole other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventRole of(RoleEnum value) { - return new AuditLogEventRole(value, 0); - } - - public static AuditLogEventRole of(String value) { - return new AuditLogEventRole(value, 1); - } - - public interface Visitor { - T visit(RoleEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventRole.class); - } - - @java.lang.Override - public AuditLogEventRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/AvailableActions.java b/src/main/java/com/merge/api/resources/hris/types/AvailableActions.java deleted file mode 100644 index 0606c272b..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/AvailableActions.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AvailableActions.Builder.class) -public final class AvailableActions { - private final AccountIntegration integration; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AvailableActions( - AccountIntegration integration, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.integration = integration; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AvailableActions && equalTo((AvailableActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AvailableActions other) { - return integration.equals(other.integration) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IntegrationStage builder() { - return new Builder(); - } - - public interface IntegrationStage { - PassthroughAvailableStage integration(@NotNull AccountIntegration integration); - - Builder from(AvailableActions other); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AvailableActions build(); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { - private AccountIntegration integration; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AvailableActions other) { - integration(other.getIntegration()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public AvailableActions build() { - return new AvailableActions( - integration, passthroughAvailable, availableModelOperations, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/BankInfoAccountType.java b/src/main/java/com/merge/api/resources/hris/types/BankInfoAccountType.java deleted file mode 100644 index 8fa7c78eb..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/BankInfoAccountType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = BankInfoAccountType.Deserializer.class) -public final class BankInfoAccountType { - private final Object value; - - private final int type; - - private BankInfoAccountType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AccountTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BankInfoAccountType && equalTo((BankInfoAccountType) other); - } - - private boolean equalTo(BankInfoAccountType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static BankInfoAccountType of(AccountTypeEnum value) { - return new BankInfoAccountType(value, 0); - } - - public static BankInfoAccountType of(String value) { - return new BankInfoAccountType(value, 1); - } - - public interface Visitor { - T visit(AccountTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(BankInfoAccountType.class); - } - - @java.lang.Override - public BankInfoAccountType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/CategoriesEnum.java b/src/main/java/com/merge/api/resources/hris/types/CategoriesEnum.java deleted file mode 100644 index f032f38d8..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/CategoriesEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoriesEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoriesEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/CategoryEnum.java b/src/main/java/com/merge/api/resources/hris/types/CategoryEnum.java deleted file mode 100644 index ecb50eb4e..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/CategoryEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoryEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/resources/hris/types/CommonModelScopeApi.java deleted file mode 100644 index f362701dd..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/CommonModelScopeApi.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) -public final class CommonModelScopeApi { - private final List commonModels; - - private final Map additionalProperties; - - private CommonModelScopeApi( - List commonModels, Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopeApi other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CommonModelScopeApi other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public CommonModelScopeApi build() { - return new CommonModelScopeApi(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/resources/hris/types/CommonModelScopesBodyRequest.java deleted file mode 100644 index 8d63a85f1..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/CommonModelScopesBodyRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) -public final class CommonModelScopesBodyRequest { - private final String modelId; - - private final List enabledActions; - - private final List disabledFields; - - private final Map additionalProperties; - - private CommonModelScopesBodyRequest( - String modelId, - List enabledActions, - List disabledFields, - Map additionalProperties) { - this.modelId = modelId; - this.enabledActions = enabledActions; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("enabled_actions") - public List getEnabledActions() { - return enabledActions; - } - - @JsonProperty("disabled_fields") - public List getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopesBodyRequest other) { - return modelId.equals(other.modelId) - && enabledActions.equals(other.enabledActions) - && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelIdStage builder() { - return new Builder(); - } - - public interface ModelIdStage { - _FinalStage modelId(@NotNull String modelId); - - Builder from(CommonModelScopesBodyRequest other); - } - - public interface _FinalStage { - CommonModelScopesBodyRequest build(); - - _FinalStage enabledActions(List enabledActions); - - _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); - - _FinalStage addAllEnabledActions(List enabledActions); - - _FinalStage disabledFields(List disabledFields); - - _FinalStage addDisabledFields(String disabledFields); - - _FinalStage addAllDisabledFields(List disabledFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelIdStage, _FinalStage { - private String modelId; - - private List disabledFields = new ArrayList<>(); - - private List enabledActions = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CommonModelScopesBodyRequest other) { - modelId(other.getModelId()); - enabledActions(other.getEnabledActions()); - disabledFields(other.getDisabledFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public _FinalStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - public _FinalStage addAllDisabledFields(List disabledFields) { - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addDisabledFields(String disabledFields) { - this.disabledFields.add(disabledFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public _FinalStage disabledFields(List disabledFields) { - this.disabledFields.clear(); - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllEnabledActions(List enabledActions) { - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { - this.enabledActions.add(enabledActions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) - public _FinalStage enabledActions(List enabledActions) { - this.enabledActions.clear(); - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public CommonModelScopesBodyRequest build() { - return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/CountryEnum.java b/src/main/java/com/merge/api/resources/hris/types/CountryEnum.java deleted file mode 100644 index 53af469fe..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/CountryEnum.java +++ /dev/null @@ -1,518 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CountryEnum { - AF("AF"), - - AX("AX"), - - AL("AL"), - - DZ("DZ"), - - AS("AS"), - - AD("AD"), - - AO("AO"), - - AI("AI"), - - AQ("AQ"), - - AG("AG"), - - AR("AR"), - - AM("AM"), - - AW("AW"), - - AU("AU"), - - AT("AT"), - - AZ("AZ"), - - BS("BS"), - - BH("BH"), - - BD("BD"), - - BB("BB"), - - BY("BY"), - - BE("BE"), - - BZ("BZ"), - - BJ("BJ"), - - BM("BM"), - - BT("BT"), - - BO("BO"), - - BQ("BQ"), - - BA("BA"), - - BW("BW"), - - BV("BV"), - - BR("BR"), - - IO("IO"), - - BN("BN"), - - BG("BG"), - - BF("BF"), - - BI("BI"), - - CV("CV"), - - KH("KH"), - - CM("CM"), - - CA("CA"), - - KY("KY"), - - CF("CF"), - - TD("TD"), - - CL("CL"), - - CN("CN"), - - CX("CX"), - - CC("CC"), - - CO("CO"), - - KM("KM"), - - CG("CG"), - - CD("CD"), - - CK("CK"), - - CR("CR"), - - CI("CI"), - - HR("HR"), - - CU("CU"), - - CW("CW"), - - CY("CY"), - - CZ("CZ"), - - DK("DK"), - - DJ("DJ"), - - DM("DM"), - - DO("DO"), - - EC("EC"), - - EG("EG"), - - SV("SV"), - - GQ("GQ"), - - ER("ER"), - - EE("EE"), - - SZ("SZ"), - - ET("ET"), - - FK("FK"), - - FO("FO"), - - FJ("FJ"), - - FI("FI"), - - FR("FR"), - - GF("GF"), - - PF("PF"), - - TF("TF"), - - GA("GA"), - - GM("GM"), - - GE("GE"), - - DE("DE"), - - GH("GH"), - - GI("GI"), - - GR("GR"), - - GL("GL"), - - GD("GD"), - - GP("GP"), - - GU("GU"), - - GT("GT"), - - GG("GG"), - - GN("GN"), - - GW("GW"), - - GY("GY"), - - HT("HT"), - - HM("HM"), - - VA("VA"), - - HN("HN"), - - HK("HK"), - - HU("HU"), - - IS("IS"), - - IN("IN"), - - ID("ID"), - - IR("IR"), - - IQ("IQ"), - - IE("IE"), - - IM("IM"), - - IL("IL"), - - IT("IT"), - - JM("JM"), - - JP("JP"), - - JE("JE"), - - JO("JO"), - - KZ("KZ"), - - KE("KE"), - - KI("KI"), - - KW("KW"), - - KG("KG"), - - LA("LA"), - - LV("LV"), - - LB("LB"), - - LS("LS"), - - LR("LR"), - - LY("LY"), - - LI("LI"), - - LT("LT"), - - LU("LU"), - - MO("MO"), - - MG("MG"), - - MW("MW"), - - MY("MY"), - - MV("MV"), - - ML("ML"), - - MT("MT"), - - MH("MH"), - - MQ("MQ"), - - MR("MR"), - - MU("MU"), - - YT("YT"), - - MX("MX"), - - FM("FM"), - - MD("MD"), - - MC("MC"), - - MN("MN"), - - ME("ME"), - - MS("MS"), - - MA("MA"), - - MZ("MZ"), - - MM("MM"), - - NA("NA"), - - NR("NR"), - - NP("NP"), - - NL("NL"), - - NC("NC"), - - NZ("NZ"), - - NI("NI"), - - NE("NE"), - - NG("NG"), - - NU("NU"), - - NF("NF"), - - KP("KP"), - - MK("MK"), - - MP("MP"), - - NO("NO"), - - OM("OM"), - - PK("PK"), - - PW("PW"), - - PS("PS"), - - PA("PA"), - - PG("PG"), - - PY("PY"), - - PE("PE"), - - PH("PH"), - - PN("PN"), - - PL("PL"), - - PT("PT"), - - PR("PR"), - - QA("QA"), - - RE("RE"), - - RO("RO"), - - RU("RU"), - - RW("RW"), - - BL("BL"), - - SH("SH"), - - KN("KN"), - - LC("LC"), - - MF("MF"), - - PM("PM"), - - VC("VC"), - - WS("WS"), - - SM("SM"), - - ST("ST"), - - SA("SA"), - - SN("SN"), - - RS("RS"), - - SC("SC"), - - SL("SL"), - - SG("SG"), - - SX("SX"), - - SK("SK"), - - SI("SI"), - - SB("SB"), - - SO("SO"), - - ZA("ZA"), - - GS("GS"), - - KR("KR"), - - SS("SS"), - - ES("ES"), - - LK("LK"), - - SD("SD"), - - SR("SR"), - - SJ("SJ"), - - SE("SE"), - - CH("CH"), - - SY("SY"), - - TW("TW"), - - TJ("TJ"), - - TZ("TZ"), - - TH("TH"), - - TL("TL"), - - TG("TG"), - - TK("TK"), - - TO("TO"), - - TT("TT"), - - TN("TN"), - - TR("TR"), - - TM("TM"), - - TC("TC"), - - TV("TV"), - - UG("UG"), - - UA("UA"), - - AE("AE"), - - GB("GB"), - - UM("UM"), - - US("US"), - - UY("UY"), - - UZ("UZ"), - - VU("VU"), - - VE("VE"), - - VN("VN"), - - VG("VG"), - - VI("VI"), - - WF("WF"), - - EH("EH"), - - YE("YE"), - - ZM("ZM"), - - ZW("ZW"); - - private final String value; - - CountryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/resources/hris/types/DataPassthroughRequest.java deleted file mode 100644 index 5a27a9d2c..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/DataPassthroughRequest.java +++ /dev/null @@ -1,371 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) -public final class DataPassthroughRequest { - private final MethodEnum method; - - private final String path; - - private final Optional baseUrlOverride; - - private final Optional data; - - private final Optional> multipartFormData; - - private final Optional> headers; - - private final Optional requestFormat; - - private final Optional normalizeResponse; - - private final Map additionalProperties; - - private DataPassthroughRequest( - MethodEnum method, - String path, - Optional baseUrlOverride, - Optional data, - Optional> multipartFormData, - Optional> headers, - Optional requestFormat, - Optional normalizeResponse, - Map additionalProperties) { - this.method = method; - this.path = path; - this.baseUrlOverride = baseUrlOverride; - this.data = data; - this.multipartFormData = multipartFormData; - this.headers = headers; - this.requestFormat = requestFormat; - this.normalizeResponse = normalizeResponse; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public MethodEnum getMethod() { - return method; - } - - /** - * @return The path of the request in the third party's platform. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - /** - * @return An optional override of the third party's base url for the request. - */ - @JsonProperty("base_url_override") - public Optional getBaseUrlOverride() { - return baseUrlOverride; - } - - /** - * @return The data with the request. You must include a request_format parameter matching the data's format - */ - @JsonProperty("data") - public Optional getData() { - return data; - } - - /** - * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. - */ - @JsonProperty("multipart_form_data") - public Optional> getMultipartFormData() { - return multipartFormData; - } - - /** - * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("request_format") - public Optional getRequestFormat() { - return requestFormat; - } - - /** - * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. - */ - @JsonProperty("normalize_response") - public Optional getNormalizeResponse() { - return normalizeResponse; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DataPassthroughRequest other) { - return method.equals(other.method) - && path.equals(other.path) - && baseUrlOverride.equals(other.baseUrlOverride) - && data.equals(other.data) - && multipartFormData.equals(other.multipartFormData) - && headers.equals(other.headers) - && requestFormat.equals(other.requestFormat) - && normalizeResponse.equals(other.normalizeResponse); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.baseUrlOverride, - this.data, - this.multipartFormData, - this.headers, - this.requestFormat, - this.normalizeResponse); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull MethodEnum method); - - Builder from(DataPassthroughRequest other); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - } - - public interface _FinalStage { - DataPassthroughRequest build(); - - _FinalStage baseUrlOverride(Optional baseUrlOverride); - - _FinalStage baseUrlOverride(String baseUrlOverride); - - _FinalStage data(Optional data); - - _FinalStage data(String data); - - _FinalStage multipartFormData(Optional> multipartFormData); - - _FinalStage multipartFormData(List multipartFormData); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - - _FinalStage requestFormat(Optional requestFormat); - - _FinalStage requestFormat(RequestFormatEnum requestFormat); - - _FinalStage normalizeResponse(Optional normalizeResponse); - - _FinalStage normalizeResponse(Boolean normalizeResponse); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, _FinalStage { - private MethodEnum method; - - private String path; - - private Optional normalizeResponse = Optional.empty(); - - private Optional requestFormat = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional> multipartFormData = Optional.empty(); - - private Optional data = Optional.empty(); - - private Optional baseUrlOverride = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DataPassthroughRequest other) { - method(other.getMethod()); - path(other.getPath()); - baseUrlOverride(other.getBaseUrlOverride()); - data(other.getData()); - multipartFormData(other.getMultipartFormData()); - headers(other.getHeaders()); - requestFormat(other.getRequestFormat()); - normalizeResponse(other.getNormalizeResponse()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull MethodEnum method) { - this.method = method; - return this; - } - - /** - *

The path of the request in the third party's platform.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - /** - *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage normalizeResponse(Boolean normalizeResponse) { - this.normalizeResponse = Optional.ofNullable(normalizeResponse); - return this; - } - - @java.lang.Override - @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) - public _FinalStage normalizeResponse(Optional normalizeResponse) { - this.normalizeResponse = normalizeResponse; - return this; - } - - @java.lang.Override - public _FinalStage requestFormat(RequestFormatEnum requestFormat) { - this.requestFormat = Optional.ofNullable(requestFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_format", nulls = Nulls.SKIP) - public _FinalStage requestFormat(Optional requestFormat) { - this.requestFormat = requestFormat; - return this; - } - - /** - *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - /** - *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage multipartFormData(List multipartFormData) { - this.multipartFormData = Optional.ofNullable(multipartFormData); - return this; - } - - @java.lang.Override - @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) - public _FinalStage multipartFormData(Optional> multipartFormData) { - this.multipartFormData = multipartFormData; - return this; - } - - /** - *

The data with the request. You must include a request_format parameter matching the data's format

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage data(String data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - /** - *

An optional override of the third party's base url for the request.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage baseUrlOverride(String baseUrlOverride) { - this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); - return this; - } - - @java.lang.Override - @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) - public _FinalStage baseUrlOverride(Optional baseUrlOverride) { - this.baseUrlOverride = baseUrlOverride; - return this; - } - - @java.lang.Override - public DataPassthroughRequest build() { - return new DataPassthroughRequest( - method, - path, - baseUrlOverride, - data, - multipartFormData, - headers, - requestFormat, - normalizeResponse, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/DebugModeLog.java b/src/main/java/com/merge/api/resources/hris/types/DebugModeLog.java deleted file mode 100644 index 51e90d9ed..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/DebugModeLog.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModeLog.Builder.class) -public final class DebugModeLog { - private final String logId; - - private final String dashboardView; - - private final DebugModelLogSummary logSummary; - - private final Map additionalProperties; - - private DebugModeLog( - String logId, - String dashboardView, - DebugModelLogSummary logSummary, - Map additionalProperties) { - this.logId = logId; - this.dashboardView = dashboardView; - this.logSummary = logSummary; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("log_id") - public String getLogId() { - return logId; - } - - @JsonProperty("dashboard_view") - public String getDashboardView() { - return dashboardView; - } - - @JsonProperty("log_summary") - public DebugModelLogSummary getLogSummary() { - return logSummary; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModeLog && equalTo((DebugModeLog) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModeLog other) { - return logId.equals(other.logId) - && dashboardView.equals(other.dashboardView) - && logSummary.equals(other.logSummary); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.logId, this.dashboardView, this.logSummary); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LogIdStage builder() { - return new Builder(); - } - - public interface LogIdStage { - DashboardViewStage logId(@NotNull String logId); - - Builder from(DebugModeLog other); - } - - public interface DashboardViewStage { - LogSummaryStage dashboardView(@NotNull String dashboardView); - } - - public interface LogSummaryStage { - _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); - } - - public interface _FinalStage { - DebugModeLog build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { - private String logId; - - private String dashboardView; - - private DebugModelLogSummary logSummary; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModeLog other) { - logId(other.getLogId()); - dashboardView(other.getDashboardView()); - logSummary(other.getLogSummary()); - return this; - } - - @java.lang.Override - @JsonSetter("log_id") - public DashboardViewStage logId(@NotNull String logId) { - this.logId = logId; - return this; - } - - @java.lang.Override - @JsonSetter("dashboard_view") - public LogSummaryStage dashboardView(@NotNull String dashboardView) { - this.dashboardView = dashboardView; - return this; - } - - @java.lang.Override - @JsonSetter("log_summary") - public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { - this.logSummary = logSummary; - return this; - } - - @java.lang.Override - public DebugModeLog build() { - return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/resources/hris/types/DebugModelLogSummary.java deleted file mode 100644 index a2081a603..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/DebugModelLogSummary.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) -public final class DebugModelLogSummary { - private final String url; - - private final String method; - - private final int statusCode; - - private final Map additionalProperties; - - private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { - this.url = url; - this.method = method; - this.statusCode = statusCode; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("url") - public String getUrl() { - return url; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("status_code") - public int getStatusCode() { - return statusCode; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModelLogSummary other) { - return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.url, this.method, this.statusCode); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static UrlStage builder() { - return new Builder(); - } - - public interface UrlStage { - MethodStage url(@NotNull String url); - - Builder from(DebugModelLogSummary other); - } - - public interface MethodStage { - StatusCodeStage method(@NotNull String method); - } - - public interface StatusCodeStage { - _FinalStage statusCode(int statusCode); - } - - public interface _FinalStage { - DebugModelLogSummary build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { - private String url; - - private String method; - - private int statusCode; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModelLogSummary other) { - url(other.getUrl()); - method(other.getMethod()); - statusCode(other.getStatusCode()); - return this; - } - - @java.lang.Override - @JsonSetter("url") - public MethodStage url(@NotNull String url) { - this.url = url; - return this; - } - - @java.lang.Override - @JsonSetter("method") - public StatusCodeStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("status_code") - public _FinalStage statusCode(int statusCode) { - this.statusCode = statusCode; - return this; - } - - @java.lang.Override - public DebugModelLogSummary build() { - return new DebugModelLogSummary(url, method, statusCode, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/DependentGender.java b/src/main/java/com/merge/api/resources/hris/types/DependentGender.java deleted file mode 100644 index c6d1daf52..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/DependentGender.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = DependentGender.Deserializer.class) -public final class DependentGender { - private final Object value; - - private final int type; - - private DependentGender(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((GenderEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DependentGender && equalTo((DependentGender) other); - } - - private boolean equalTo(DependentGender other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static DependentGender of(GenderEnum value) { - return new DependentGender(value, 0); - } - - public static DependentGender of(String value) { - return new DependentGender(value, 1); - } - - public interface Visitor { - T visit(GenderEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(DependentGender.class); - } - - @java.lang.Override - public DependentGender deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, GenderEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/DependentRelationship.java b/src/main/java/com/merge/api/resources/hris/types/DependentRelationship.java deleted file mode 100644 index b19b696ea..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/DependentRelationship.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = DependentRelationship.Deserializer.class) -public final class DependentRelationship { - private final Object value; - - private final int type; - - private DependentRelationship(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RelationshipEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DependentRelationship && equalTo((DependentRelationship) other); - } - - private boolean equalTo(DependentRelationship other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static DependentRelationship of(RelationshipEnum value) { - return new DependentRelationship(value, 0); - } - - public static DependentRelationship of(String value) { - return new DependentRelationship(value, 1); - } - - public interface Visitor { - T visit(RelationshipEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(DependentRelationship.class); - } - - @java.lang.Override - public DependentRelationship deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RelationshipEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EarningType.java b/src/main/java/com/merge/api/resources/hris/types/EarningType.java deleted file mode 100644 index 94d38ea34..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EarningType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EarningType.Deserializer.class) -public final class EarningType { - private final Object value; - - private final int type; - - private EarningType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EarningTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EarningType && equalTo((EarningType) other); - } - - private boolean equalTo(EarningType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EarningType of(EarningTypeEnum value) { - return new EarningType(value, 0); - } - - public static EarningType of(String value) { - return new EarningType(value, 1); - } - - public interface Visitor { - T visit(EarningTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EarningType.class); - } - - @java.lang.Override - public EarningType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EarningTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/Employee.java b/src/main/java/com/merge/api/resources/hris/types/Employee.java deleted file mode 100644 index 9b9c58e76..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/Employee.java +++ /dev/null @@ -1,1138 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Employee.Builder.class) -public final class Employee { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional employeeNumber; - - private final Optional company; - - private final Optional firstName; - - private final Optional lastName; - - private final Optional preferredName; - - private final Optional displayFullName; - - private final Optional username; - - private final Optional>> groups; - - private final Optional workEmail; - - private final Optional personalEmail; - - private final Optional mobilePhoneNumber; - - private final Optional>> employments; - - private final Optional homeLocation; - - private final Optional workLocation; - - private final Optional manager; - - private final Optional team; - - private final Optional payGroup; - - private final Optional ssn; - - private final Optional gender; - - private final Optional ethnicity; - - private final Optional maritalStatus; - - private final Optional dateOfBirth; - - private final Optional hireDate; - - private final Optional startDate; - - private final Optional remoteCreatedAt; - - private final Optional employmentStatus; - - private final Optional terminationDate; - - private final Optional avatar; - - private final Optional> customFields; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Employee( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional employeeNumber, - Optional company, - Optional firstName, - Optional lastName, - Optional preferredName, - Optional displayFullName, - Optional username, - Optional>> groups, - Optional workEmail, - Optional personalEmail, - Optional mobilePhoneNumber, - Optional>> employments, - Optional homeLocation, - Optional workLocation, - Optional manager, - Optional team, - Optional payGroup, - Optional ssn, - Optional gender, - Optional ethnicity, - Optional maritalStatus, - Optional dateOfBirth, - Optional hireDate, - Optional startDate, - Optional remoteCreatedAt, - Optional employmentStatus, - Optional terminationDate, - Optional avatar, - Optional> customFields, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.employeeNumber = employeeNumber; - this.company = company; - this.firstName = firstName; - this.lastName = lastName; - this.preferredName = preferredName; - this.displayFullName = displayFullName; - this.username = username; - this.groups = groups; - this.workEmail = workEmail; - this.personalEmail = personalEmail; - this.mobilePhoneNumber = mobilePhoneNumber; - this.employments = employments; - this.homeLocation = homeLocation; - this.workLocation = workLocation; - this.manager = manager; - this.team = team; - this.payGroup = payGroup; - this.ssn = ssn; - this.gender = gender; - this.ethnicity = ethnicity; - this.maritalStatus = maritalStatus; - this.dateOfBirth = dateOfBirth; - this.hireDate = hireDate; - this.startDate = startDate; - this.remoteCreatedAt = remoteCreatedAt; - this.employmentStatus = employmentStatus; - this.terminationDate = terminationDate; - this.avatar = avatar; - this.customFields = customFields; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The employee's number that appears in the third-party integration's UI. - */ - @JsonProperty("employee_number") - public Optional getEmployeeNumber() { - return employeeNumber; - } - - /** - * @return The ID of the employee's company. - */ - @JsonProperty("company") - public Optional getCompany() { - return company; - } - - /** - * @return The employee's first name. - */ - @JsonProperty("first_name") - public Optional getFirstName() { - return firstName; - } - - /** - * @return The employee's last name. - */ - @JsonProperty("last_name") - public Optional getLastName() { - return lastName; - } - - /** - * @return The employee's preferred first name. - */ - @JsonProperty("preferred_name") - public Optional getPreferredName() { - return preferredName; - } - - /** - * @return The employee's full name, to use for display purposes. If a preferred first name is available, the full name will include the preferred first name. - */ - @JsonProperty("display_full_name") - public Optional getDisplayFullName() { - return displayFullName; - } - - /** - * @return The employee's username that appears in the remote UI. - */ - @JsonProperty("username") - public Optional getUsername() { - return username; - } - - @JsonProperty("groups") - public Optional>> getGroups() { - return groups; - } - - /** - * @return The employee's work email. - */ - @JsonProperty("work_email") - public Optional getWorkEmail() { - return workEmail; - } - - /** - * @return The employee's personal email. - */ - @JsonProperty("personal_email") - public Optional getPersonalEmail() { - return personalEmail; - } - - /** - * @return The employee's mobile phone number. - */ - @JsonProperty("mobile_phone_number") - public Optional getMobilePhoneNumber() { - return mobilePhoneNumber; - } - - /** - * @return Array of Employment IDs for this Employee. - */ - @JsonProperty("employments") - public Optional>> getEmployments() { - return employments; - } - - /** - * @return The employee's home address. - */ - @JsonProperty("home_location") - public Optional getHomeLocation() { - return homeLocation; - } - - /** - * @return The employee's work address. - */ - @JsonProperty("work_location") - public Optional getWorkLocation() { - return workLocation; - } - - /** - * @return The employee ID of the employee's manager. - */ - @JsonProperty("manager") - public Optional getManager() { - return manager; - } - - /** - * @return The employee's team. - */ - @JsonProperty("team") - public Optional getTeam() { - return team; - } - - /** - * @return The employee's pay group - */ - @JsonProperty("pay_group") - public Optional getPayGroup() { - return payGroup; - } - - /** - * @return The employee's social security number. - */ - @JsonProperty("ssn") - public Optional getSsn() { - return ssn; - } - - /** - * @return The employee's gender. - *
    - *
  • MALE - MALE
  • - *
  • FEMALE - FEMALE
  • - *
  • NON-BINARY - NON-BINARY
  • - *
  • OTHER - OTHER
  • - *
  • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
  • - *
- */ - @JsonProperty("gender") - public Optional getGender() { - return gender; - } - - /** - * @return The employee's ethnicity. - *
    - *
  • AMERICAN_INDIAN_OR_ALASKA_NATIVE - AMERICAN_INDIAN_OR_ALASKA_NATIVE
  • - *
  • ASIAN_OR_INDIAN_SUBCONTINENT - ASIAN_OR_INDIAN_SUBCONTINENT
  • - *
  • BLACK_OR_AFRICAN_AMERICAN - BLACK_OR_AFRICAN_AMERICAN
  • - *
  • HISPANIC_OR_LATINO - HISPANIC_OR_LATINO
  • - *
  • NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER
  • - *
  • TWO_OR_MORE_RACES - TWO_OR_MORE_RACES
  • - *
  • WHITE - WHITE
  • - *
  • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
  • - *
- */ - @JsonProperty("ethnicity") - public Optional getEthnicity() { - return ethnicity; - } - - /** - * @return The employee's filing status as related to marital status. - *
    - *
  • SINGLE - SINGLE
  • - *
  • MARRIED_FILING_JOINTLY - MARRIED_FILING_JOINTLY
  • - *
  • MARRIED_FILING_SEPARATELY - MARRIED_FILING_SEPARATELY
  • - *
  • HEAD_OF_HOUSEHOLD - HEAD_OF_HOUSEHOLD
  • - *
  • QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD
  • - *
- */ - @JsonProperty("marital_status") - public Optional getMaritalStatus() { - return maritalStatus; - } - - /** - * @return The employee's date of birth. - */ - @JsonProperty("date_of_birth") - public Optional getDateOfBirth() { - return dateOfBirth; - } - - /** - * @return The date that the employee was hired, usually the day that an offer letter is signed. If an employee has multiple hire dates from previous employments, this represents the most recent hire date. Note: If you're looking for the employee's start date, refer to the start_date field. - */ - @JsonProperty("hire_date") - public Optional getHireDate() { - return hireDate; - } - - /** - * @return The date that the employee started working. If an employee was rehired, the most recent start date will be returned. - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return When the third party's employee was created. - */ - @JsonProperty("remote_created_at") - public Optional getRemoteCreatedAt() { - return remoteCreatedAt; - } - - /** - * @return The employment status of the employee. - *
    - *
  • ACTIVE - ACTIVE
  • - *
  • PENDING - PENDING
  • - *
  • INACTIVE - INACTIVE
  • - *
- */ - @JsonProperty("employment_status") - public Optional getEmploymentStatus() { - return employmentStatus; - } - - /** - * @return The employee's termination date. - */ - @JsonProperty("termination_date") - public Optional getTerminationDate() { - return terminationDate; - } - - /** - * @return The URL of the employee's avatar image. - */ - @JsonProperty("avatar") - public Optional getAvatar() { - return avatar; - } - - /** - * @return Custom fields configured for a given model. - */ - @JsonProperty("custom_fields") - public Optional> getCustomFields() { - return customFields; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Employee && equalTo((Employee) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Employee other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && employeeNumber.equals(other.employeeNumber) - && company.equals(other.company) - && firstName.equals(other.firstName) - && lastName.equals(other.lastName) - && preferredName.equals(other.preferredName) - && displayFullName.equals(other.displayFullName) - && username.equals(other.username) - && groups.equals(other.groups) - && workEmail.equals(other.workEmail) - && personalEmail.equals(other.personalEmail) - && mobilePhoneNumber.equals(other.mobilePhoneNumber) - && employments.equals(other.employments) - && homeLocation.equals(other.homeLocation) - && workLocation.equals(other.workLocation) - && manager.equals(other.manager) - && team.equals(other.team) - && payGroup.equals(other.payGroup) - && ssn.equals(other.ssn) - && gender.equals(other.gender) - && ethnicity.equals(other.ethnicity) - && maritalStatus.equals(other.maritalStatus) - && dateOfBirth.equals(other.dateOfBirth) - && hireDate.equals(other.hireDate) - && startDate.equals(other.startDate) - && remoteCreatedAt.equals(other.remoteCreatedAt) - && employmentStatus.equals(other.employmentStatus) - && terminationDate.equals(other.terminationDate) - && avatar.equals(other.avatar) - && customFields.equals(other.customFields) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.employeeNumber, - this.company, - this.firstName, - this.lastName, - this.preferredName, - this.displayFullName, - this.username, - this.groups, - this.workEmail, - this.personalEmail, - this.mobilePhoneNumber, - this.employments, - this.homeLocation, - this.workLocation, - this.manager, - this.team, - this.payGroup, - this.ssn, - this.gender, - this.ethnicity, - this.maritalStatus, - this.dateOfBirth, - this.hireDate, - this.startDate, - this.remoteCreatedAt, - this.employmentStatus, - this.terminationDate, - this.avatar, - this.customFields, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional employeeNumber = Optional.empty(); - - private Optional company = Optional.empty(); - - private Optional firstName = Optional.empty(); - - private Optional lastName = Optional.empty(); - - private Optional preferredName = Optional.empty(); - - private Optional displayFullName = Optional.empty(); - - private Optional username = Optional.empty(); - - private Optional>> groups = Optional.empty(); - - private Optional workEmail = Optional.empty(); - - private Optional personalEmail = Optional.empty(); - - private Optional mobilePhoneNumber = Optional.empty(); - - private Optional>> employments = Optional.empty(); - - private Optional homeLocation = Optional.empty(); - - private Optional workLocation = Optional.empty(); - - private Optional manager = Optional.empty(); - - private Optional team = Optional.empty(); - - private Optional payGroup = Optional.empty(); - - private Optional ssn = Optional.empty(); - - private Optional gender = Optional.empty(); - - private Optional ethnicity = Optional.empty(); - - private Optional maritalStatus = Optional.empty(); - - private Optional dateOfBirth = Optional.empty(); - - private Optional hireDate = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional remoteCreatedAt = Optional.empty(); - - private Optional employmentStatus = Optional.empty(); - - private Optional terminationDate = Optional.empty(); - - private Optional avatar = Optional.empty(); - - private Optional> customFields = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Employee other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - employeeNumber(other.getEmployeeNumber()); - company(other.getCompany()); - firstName(other.getFirstName()); - lastName(other.getLastName()); - preferredName(other.getPreferredName()); - displayFullName(other.getDisplayFullName()); - username(other.getUsername()); - groups(other.getGroups()); - workEmail(other.getWorkEmail()); - personalEmail(other.getPersonalEmail()); - mobilePhoneNumber(other.getMobilePhoneNumber()); - employments(other.getEmployments()); - homeLocation(other.getHomeLocation()); - workLocation(other.getWorkLocation()); - manager(other.getManager()); - team(other.getTeam()); - payGroup(other.getPayGroup()); - ssn(other.getSsn()); - gender(other.getGender()); - ethnicity(other.getEthnicity()); - maritalStatus(other.getMaritalStatus()); - dateOfBirth(other.getDateOfBirth()); - hireDate(other.getHireDate()); - startDate(other.getStartDate()); - remoteCreatedAt(other.getRemoteCreatedAt()); - employmentStatus(other.getEmploymentStatus()); - terminationDate(other.getTerminationDate()); - avatar(other.getAvatar()); - customFields(other.getCustomFields()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "employee_number", nulls = Nulls.SKIP) - public Builder employeeNumber(Optional employeeNumber) { - this.employeeNumber = employeeNumber; - return this; - } - - public Builder employeeNumber(String employeeNumber) { - this.employeeNumber = Optional.ofNullable(employeeNumber); - return this; - } - - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { - this.company = company; - return this; - } - - public Builder company(EmployeeCompany company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "first_name", nulls = Nulls.SKIP) - public Builder firstName(Optional firstName) { - this.firstName = firstName; - return this; - } - - public Builder firstName(String firstName) { - this.firstName = Optional.ofNullable(firstName); - return this; - } - - @JsonSetter(value = "last_name", nulls = Nulls.SKIP) - public Builder lastName(Optional lastName) { - this.lastName = lastName; - return this; - } - - public Builder lastName(String lastName) { - this.lastName = Optional.ofNullable(lastName); - return this; - } - - @JsonSetter(value = "preferred_name", nulls = Nulls.SKIP) - public Builder preferredName(Optional preferredName) { - this.preferredName = preferredName; - return this; - } - - public Builder preferredName(String preferredName) { - this.preferredName = Optional.ofNullable(preferredName); - return this; - } - - @JsonSetter(value = "display_full_name", nulls = Nulls.SKIP) - public Builder displayFullName(Optional displayFullName) { - this.displayFullName = displayFullName; - return this; - } - - public Builder displayFullName(String displayFullName) { - this.displayFullName = Optional.ofNullable(displayFullName); - return this; - } - - @JsonSetter(value = "username", nulls = Nulls.SKIP) - public Builder username(Optional username) { - this.username = username; - return this; - } - - public Builder username(String username) { - this.username = Optional.ofNullable(username); - return this; - } - - @JsonSetter(value = "groups", nulls = Nulls.SKIP) - public Builder groups(Optional>> groups) { - this.groups = groups; - return this; - } - - public Builder groups(List> groups) { - this.groups = Optional.ofNullable(groups); - return this; - } - - @JsonSetter(value = "work_email", nulls = Nulls.SKIP) - public Builder workEmail(Optional workEmail) { - this.workEmail = workEmail; - return this; - } - - public Builder workEmail(String workEmail) { - this.workEmail = Optional.ofNullable(workEmail); - return this; - } - - @JsonSetter(value = "personal_email", nulls = Nulls.SKIP) - public Builder personalEmail(Optional personalEmail) { - this.personalEmail = personalEmail; - return this; - } - - public Builder personalEmail(String personalEmail) { - this.personalEmail = Optional.ofNullable(personalEmail); - return this; - } - - @JsonSetter(value = "mobile_phone_number", nulls = Nulls.SKIP) - public Builder mobilePhoneNumber(Optional mobilePhoneNumber) { - this.mobilePhoneNumber = mobilePhoneNumber; - return this; - } - - public Builder mobilePhoneNumber(String mobilePhoneNumber) { - this.mobilePhoneNumber = Optional.ofNullable(mobilePhoneNumber); - return this; - } - - @JsonSetter(value = "employments", nulls = Nulls.SKIP) - public Builder employments(Optional>> employments) { - this.employments = employments; - return this; - } - - public Builder employments(List> employments) { - this.employments = Optional.ofNullable(employments); - return this; - } - - @JsonSetter(value = "home_location", nulls = Nulls.SKIP) - public Builder homeLocation(Optional homeLocation) { - this.homeLocation = homeLocation; - return this; - } - - public Builder homeLocation(EmployeeHomeLocation homeLocation) { - this.homeLocation = Optional.ofNullable(homeLocation); - return this; - } - - @JsonSetter(value = "work_location", nulls = Nulls.SKIP) - public Builder workLocation(Optional workLocation) { - this.workLocation = workLocation; - return this; - } - - public Builder workLocation(EmployeeWorkLocation workLocation) { - this.workLocation = Optional.ofNullable(workLocation); - return this; - } - - @JsonSetter(value = "manager", nulls = Nulls.SKIP) - public Builder manager(Optional manager) { - this.manager = manager; - return this; - } - - public Builder manager(EmployeeManager manager) { - this.manager = Optional.ofNullable(manager); - return this; - } - - @JsonSetter(value = "team", nulls = Nulls.SKIP) - public Builder team(Optional team) { - this.team = team; - return this; - } - - public Builder team(EmployeeTeam team) { - this.team = Optional.ofNullable(team); - return this; - } - - @JsonSetter(value = "pay_group", nulls = Nulls.SKIP) - public Builder payGroup(Optional payGroup) { - this.payGroup = payGroup; - return this; - } - - public Builder payGroup(EmployeePayGroup payGroup) { - this.payGroup = Optional.ofNullable(payGroup); - return this; - } - - @JsonSetter(value = "ssn", nulls = Nulls.SKIP) - public Builder ssn(Optional ssn) { - this.ssn = ssn; - return this; - } - - public Builder ssn(String ssn) { - this.ssn = Optional.ofNullable(ssn); - return this; - } - - @JsonSetter(value = "gender", nulls = Nulls.SKIP) - public Builder gender(Optional gender) { - this.gender = gender; - return this; - } - - public Builder gender(EmployeeGender gender) { - this.gender = Optional.ofNullable(gender); - return this; - } - - @JsonSetter(value = "ethnicity", nulls = Nulls.SKIP) - public Builder ethnicity(Optional ethnicity) { - this.ethnicity = ethnicity; - return this; - } - - public Builder ethnicity(EmployeeEthnicity ethnicity) { - this.ethnicity = Optional.ofNullable(ethnicity); - return this; - } - - @JsonSetter(value = "marital_status", nulls = Nulls.SKIP) - public Builder maritalStatus(Optional maritalStatus) { - this.maritalStatus = maritalStatus; - return this; - } - - public Builder maritalStatus(EmployeeMaritalStatus maritalStatus) { - this.maritalStatus = Optional.ofNullable(maritalStatus); - return this; - } - - @JsonSetter(value = "date_of_birth", nulls = Nulls.SKIP) - public Builder dateOfBirth(Optional dateOfBirth) { - this.dateOfBirth = dateOfBirth; - return this; - } - - public Builder dateOfBirth(OffsetDateTime dateOfBirth) { - this.dateOfBirth = Optional.ofNullable(dateOfBirth); - return this; - } - - @JsonSetter(value = "hire_date", nulls = Nulls.SKIP) - public Builder hireDate(Optional hireDate) { - this.hireDate = hireDate; - return this; - } - - public Builder hireDate(OffsetDateTime hireDate) { - this.hireDate = Optional.ofNullable(hireDate); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(OffsetDateTime startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) - public Builder remoteCreatedAt(Optional remoteCreatedAt) { - this.remoteCreatedAt = remoteCreatedAt; - return this; - } - - public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { - this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); - return this; - } - - @JsonSetter(value = "employment_status", nulls = Nulls.SKIP) - public Builder employmentStatus(Optional employmentStatus) { - this.employmentStatus = employmentStatus; - return this; - } - - public Builder employmentStatus(EmployeeEmploymentStatus employmentStatus) { - this.employmentStatus = Optional.ofNullable(employmentStatus); - return this; - } - - @JsonSetter(value = "termination_date", nulls = Nulls.SKIP) - public Builder terminationDate(Optional terminationDate) { - this.terminationDate = terminationDate; - return this; - } - - public Builder terminationDate(OffsetDateTime terminationDate) { - this.terminationDate = Optional.ofNullable(terminationDate); - return this; - } - - @JsonSetter(value = "avatar", nulls = Nulls.SKIP) - public Builder avatar(Optional avatar) { - this.avatar = avatar; - return this; - } - - public Builder avatar(String avatar) { - this.avatar = Optional.ofNullable(avatar); - return this; - } - - @JsonSetter(value = "custom_fields", nulls = Nulls.SKIP) - public Builder customFields(Optional> customFields) { - this.customFields = customFields; - return this; - } - - public Builder customFields(Map customFields) { - this.customFields = Optional.ofNullable(customFields); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Employee build() { - return new Employee( - id, - remoteId, - createdAt, - modifiedAt, - employeeNumber, - company, - firstName, - lastName, - preferredName, - displayFullName, - username, - groups, - workEmail, - personalEmail, - mobilePhoneNumber, - employments, - homeLocation, - workLocation, - manager, - team, - payGroup, - ssn, - gender, - ethnicity, - maritalStatus, - dateOfBirth, - hireDate, - startDate, - remoteCreatedAt, - employmentStatus, - terminationDate, - avatar, - customFields, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeCompany.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeCompany.java deleted file mode 100644 index 995bd4ce5..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeCompany.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeCompany.Deserializer.class) -public final class EmployeeCompany { - private final Object value; - - private final int type; - - private EmployeeCompany(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((Company) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeCompany && equalTo((EmployeeCompany) other); - } - - private boolean equalTo(EmployeeCompany other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeCompany of(String value) { - return new EmployeeCompany(value, 0); - } - - public static EmployeeCompany of(Company value) { - return new EmployeeCompany(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(Company value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeCompany.class); - } - - @java.lang.Override - public EmployeeCompany deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Company.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeEmploymentStatus.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeEmploymentStatus.java deleted file mode 100644 index 328dab65a..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeEmploymentStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeEmploymentStatus.Deserializer.class) -public final class EmployeeEmploymentStatus { - private final Object value; - - private final int type; - - private EmployeeEmploymentStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EmploymentStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeEmploymentStatus && equalTo((EmployeeEmploymentStatus) other); - } - - private boolean equalTo(EmployeeEmploymentStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeEmploymentStatus of(EmploymentStatusEnum value) { - return new EmployeeEmploymentStatus(value, 0); - } - - public static EmployeeEmploymentStatus of(String value) { - return new EmployeeEmploymentStatus(value, 1); - } - - public interface Visitor { - T visit(EmploymentStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeEmploymentStatus.class); - } - - @java.lang.Override - public EmployeeEmploymentStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmploymentStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeEthnicity.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeEthnicity.java deleted file mode 100644 index e5e8baa3a..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeEthnicity.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeEthnicity.Deserializer.class) -public final class EmployeeEthnicity { - private final Object value; - - private final int type; - - private EmployeeEthnicity(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EthnicityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeEthnicity && equalTo((EmployeeEthnicity) other); - } - - private boolean equalTo(EmployeeEthnicity other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeEthnicity of(EthnicityEnum value) { - return new EmployeeEthnicity(value, 0); - } - - public static EmployeeEthnicity of(String value) { - return new EmployeeEthnicity(value, 1); - } - - public interface Visitor { - T visit(EthnicityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeEthnicity.class); - } - - @java.lang.Override - public EmployeeEthnicity deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EthnicityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeGender.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeGender.java deleted file mode 100644 index b43f275c5..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeGender.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeGender.Deserializer.class) -public final class EmployeeGender { - private final Object value; - - private final int type; - - private EmployeeGender(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((GenderEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeGender && equalTo((EmployeeGender) other); - } - - private boolean equalTo(EmployeeGender other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeGender of(GenderEnum value) { - return new EmployeeGender(value, 0); - } - - public static EmployeeGender of(String value) { - return new EmployeeGender(value, 1); - } - - public interface Visitor { - T visit(GenderEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeGender.class); - } - - @java.lang.Override - public EmployeeGender deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, GenderEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeMaritalStatus.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeMaritalStatus.java deleted file mode 100644 index 924230058..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeMaritalStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeMaritalStatus.Deserializer.class) -public final class EmployeeMaritalStatus { - private final Object value; - - private final int type; - - private EmployeeMaritalStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((MaritalStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeMaritalStatus && equalTo((EmployeeMaritalStatus) other); - } - - private boolean equalTo(EmployeeMaritalStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeMaritalStatus of(MaritalStatusEnum value) { - return new EmployeeMaritalStatus(value, 0); - } - - public static EmployeeMaritalStatus of(String value) { - return new EmployeeMaritalStatus(value, 1); - } - - public interface Visitor { - T visit(MaritalStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeMaritalStatus.class); - } - - @java.lang.Override - public EmployeeMaritalStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, MaritalStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEmploymentStatus.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEmploymentStatus.java deleted file mode 100644 index 9a518e650..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEmploymentStatus.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeRequestEmploymentStatus.Deserializer.class) -public final class EmployeeRequestEmploymentStatus { - private final Object value; - - private final int type; - - private EmployeeRequestEmploymentStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EmploymentStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeRequestEmploymentStatus && equalTo((EmployeeRequestEmploymentStatus) other); - } - - private boolean equalTo(EmployeeRequestEmploymentStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeRequestEmploymentStatus of(EmploymentStatusEnum value) { - return new EmployeeRequestEmploymentStatus(value, 0); - } - - public static EmployeeRequestEmploymentStatus of(String value) { - return new EmployeeRequestEmploymentStatus(value, 1); - } - - public interface Visitor { - T visit(EmploymentStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeRequestEmploymentStatus.class); - } - - @java.lang.Override - public EmployeeRequestEmploymentStatus deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmploymentStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEthnicity.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEthnicity.java deleted file mode 100644 index dec0b28fa..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestEthnicity.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeRequestEthnicity.Deserializer.class) -public final class EmployeeRequestEthnicity { - private final Object value; - - private final int type; - - private EmployeeRequestEthnicity(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EthnicityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeRequestEthnicity && equalTo((EmployeeRequestEthnicity) other); - } - - private boolean equalTo(EmployeeRequestEthnicity other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeRequestEthnicity of(EthnicityEnum value) { - return new EmployeeRequestEthnicity(value, 0); - } - - public static EmployeeRequestEthnicity of(String value) { - return new EmployeeRequestEthnicity(value, 1); - } - - public interface Visitor { - T visit(EthnicityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeRequestEthnicity.class); - } - - @java.lang.Override - public EmployeeRequestEthnicity deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EthnicityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestGender.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestGender.java deleted file mode 100644 index ae17fcda9..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestGender.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeRequestGender.Deserializer.class) -public final class EmployeeRequestGender { - private final Object value; - - private final int type; - - private EmployeeRequestGender(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((GenderEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeRequestGender && equalTo((EmployeeRequestGender) other); - } - - private boolean equalTo(EmployeeRequestGender other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeRequestGender of(GenderEnum value) { - return new EmployeeRequestGender(value, 0); - } - - public static EmployeeRequestGender of(String value) { - return new EmployeeRequestGender(value, 1); - } - - public interface Visitor { - T visit(GenderEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeRequestGender.class); - } - - @java.lang.Override - public EmployeeRequestGender deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, GenderEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestMaritalStatus.java b/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestMaritalStatus.java deleted file mode 100644 index 269e17802..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployeeRequestMaritalStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployeeRequestMaritalStatus.Deserializer.class) -public final class EmployeeRequestMaritalStatus { - private final Object value; - - private final int type; - - private EmployeeRequestMaritalStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((MaritalStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployeeRequestMaritalStatus && equalTo((EmployeeRequestMaritalStatus) other); - } - - private boolean equalTo(EmployeeRequestMaritalStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployeeRequestMaritalStatus of(MaritalStatusEnum value) { - return new EmployeeRequestMaritalStatus(value, 0); - } - - public static EmployeeRequestMaritalStatus of(String value) { - return new EmployeeRequestMaritalStatus(value, 1); - } - - public interface Visitor { - T visit(MaritalStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployeeRequestMaritalStatus.class); - } - - @java.lang.Override - public EmployeeRequestMaritalStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, MaritalStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmployerBenefitBenefitPlanType.java b/src/main/java/com/merge/api/resources/hris/types/EmployerBenefitBenefitPlanType.java deleted file mode 100644 index d93d7b152..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmployerBenefitBenefitPlanType.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmployerBenefitBenefitPlanType.Deserializer.class) -public final class EmployerBenefitBenefitPlanType { - private final Object value; - - private final int type; - - private EmployerBenefitBenefitPlanType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((BenefitPlanTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmployerBenefitBenefitPlanType && equalTo((EmployerBenefitBenefitPlanType) other); - } - - private boolean equalTo(EmployerBenefitBenefitPlanType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmployerBenefitBenefitPlanType of(BenefitPlanTypeEnum value) { - return new EmployerBenefitBenefitPlanType(value, 0); - } - - public static EmployerBenefitBenefitPlanType of(String value) { - return new EmployerBenefitBenefitPlanType(value, 1); - } - - public interface Visitor { - T visit(BenefitPlanTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmployerBenefitBenefitPlanType.class); - } - - @java.lang.Override - public EmployerBenefitBenefitPlanType deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, BenefitPlanTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentEmploymentType.java b/src/main/java/com/merge/api/resources/hris/types/EmploymentEmploymentType.java deleted file mode 100644 index 84deec3da..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentEmploymentType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmploymentEmploymentType.Deserializer.class) -public final class EmploymentEmploymentType { - private final Object value; - - private final int type; - - private EmploymentEmploymentType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EmploymentTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmploymentEmploymentType && equalTo((EmploymentEmploymentType) other); - } - - private boolean equalTo(EmploymentEmploymentType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmploymentEmploymentType of(EmploymentTypeEnum value) { - return new EmploymentEmploymentType(value, 0); - } - - public static EmploymentEmploymentType of(String value) { - return new EmploymentEmploymentType(value, 1); - } - - public interface Visitor { - T visit(EmploymentTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmploymentEmploymentType.class); - } - - @java.lang.Override - public EmploymentEmploymentType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EmploymentTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentFlsaStatus.java b/src/main/java/com/merge/api/resources/hris/types/EmploymentFlsaStatus.java deleted file mode 100644 index 2761ca9ad..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentFlsaStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmploymentFlsaStatus.Deserializer.class) -public final class EmploymentFlsaStatus { - private final Object value; - - private final int type; - - private EmploymentFlsaStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((FlsaStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmploymentFlsaStatus && equalTo((EmploymentFlsaStatus) other); - } - - private boolean equalTo(EmploymentFlsaStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmploymentFlsaStatus of(FlsaStatusEnum value) { - return new EmploymentFlsaStatus(value, 0); - } - - public static EmploymentFlsaStatus of(String value) { - return new EmploymentFlsaStatus(value, 1); - } - - public interface Visitor { - T visit(FlsaStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmploymentFlsaStatus.class); - } - - @java.lang.Override - public EmploymentFlsaStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FlsaStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayCurrency.java b/src/main/java/com/merge/api/resources/hris/types/EmploymentPayCurrency.java deleted file mode 100644 index 426c63998..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayCurrency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmploymentPayCurrency.Deserializer.class) -public final class EmploymentPayCurrency { - private final Object value; - - private final int type; - - private EmploymentPayCurrency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PayCurrencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmploymentPayCurrency && equalTo((EmploymentPayCurrency) other); - } - - private boolean equalTo(EmploymentPayCurrency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmploymentPayCurrency of(PayCurrencyEnum value) { - return new EmploymentPayCurrency(value, 0); - } - - public static EmploymentPayCurrency of(String value) { - return new EmploymentPayCurrency(value, 1); - } - - public interface Visitor { - T visit(PayCurrencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmploymentPayCurrency.class); - } - - @java.lang.Override - public EmploymentPayCurrency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PayCurrencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayFrequency.java b/src/main/java/com/merge/api/resources/hris/types/EmploymentPayFrequency.java deleted file mode 100644 index d177c8f0d..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayFrequency.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmploymentPayFrequency.Deserializer.class) -public final class EmploymentPayFrequency { - private final Object value; - - private final int type; - - private EmploymentPayFrequency(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PayFrequencyEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmploymentPayFrequency && equalTo((EmploymentPayFrequency) other); - } - - private boolean equalTo(EmploymentPayFrequency other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmploymentPayFrequency of(PayFrequencyEnum value) { - return new EmploymentPayFrequency(value, 0); - } - - public static EmploymentPayFrequency of(String value) { - return new EmploymentPayFrequency(value, 1); - } - - public interface Visitor { - T visit(PayFrequencyEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmploymentPayFrequency.class); - } - - @java.lang.Override - public EmploymentPayFrequency deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PayFrequencyEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayPeriod.java b/src/main/java/com/merge/api/resources/hris/types/EmploymentPayPeriod.java deleted file mode 100644 index b332d461e..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EmploymentPayPeriod.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = EmploymentPayPeriod.Deserializer.class) -public final class EmploymentPayPeriod { - private final Object value; - - private final int type; - - private EmploymentPayPeriod(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PayPeriodEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmploymentPayPeriod && equalTo((EmploymentPayPeriod) other); - } - - private boolean equalTo(EmploymentPayPeriod other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static EmploymentPayPeriod of(PayPeriodEnum value) { - return new EmploymentPayPeriod(value, 0); - } - - public static EmploymentPayPeriod of(String value) { - return new EmploymentPayPeriod(value, 1); - } - - public interface Visitor { - T visit(PayPeriodEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(EmploymentPayPeriod.class); - } - - @java.lang.Override - public EmploymentPayPeriod deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PayPeriodEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/resources/hris/types/EnabledActionsEnum.java deleted file mode 100644 index 5cd233fca..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EnabledActionsEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EnabledActionsEnum { - READ("READ"), - - WRITE("WRITE"); - - private final String value; - - EnabledActionsEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EncodingEnum.java b/src/main/java/com/merge/api/resources/hris/types/EncodingEnum.java deleted file mode 100644 index d7ab8668c..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EncodingEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EncodingEnum { - RAW("RAW"), - - BASE_64("BASE64"), - - GZIP_BASE_64("GZIP_BASE64"); - - private final String value; - - EncodingEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/resources/hris/types/ErrorValidationProblem.java deleted file mode 100644 index 67897544d..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ErrorValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) -public final class ErrorValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private ErrorValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ErrorValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(ErrorValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - ErrorValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ErrorValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public ErrorValidationProblem build() { - return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/EventTypeEnum.java b/src/main/java/com/merge/api/resources/hris/types/EventTypeEnum.java deleted file mode 100644 index 46d5e89eb..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/EventTypeEnum.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EventTypeEnum { - CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), - - DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), - - CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), - - DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), - - REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), - - INVITED_USER("INVITED_USER"), - - TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), - - TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), - - DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), - - CREATED_DESTINATION("CREATED_DESTINATION"), - - DELETED_DESTINATION("DELETED_DESTINATION"), - - CHANGED_DESTINATION("CHANGED_DESTINATION"), - - CHANGED_SCOPES("CHANGED_SCOPES"), - - CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), - - CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), - - ENABLED_INTEGRATION("ENABLED_INTEGRATION"), - - DISABLED_INTEGRATION("DISABLED_INTEGRATION"), - - ENABLED_CATEGORY("ENABLED_CATEGORY"), - - DISABLED_CATEGORY("DISABLED_CATEGORY"), - - CHANGED_PASSWORD("CHANGED_PASSWORD"), - - RESET_PASSWORD("RESET_PASSWORD"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), - - MUTED_ISSUE("MUTED_ISSUE"), - - GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), - - ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), - - DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), - - MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), - - END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); - - private final String value; - - EventTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/resources/hris/types/ExternalTargetFieldApi.java deleted file mode 100644 index c096df59c..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ExternalTargetFieldApi.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) -public final class ExternalTargetFieldApi { - private final Optional name; - - private final Optional description; - - private final Optional isMapped; - - private final Map additionalProperties; - - private ExternalTargetFieldApi( - Optional name, - Optional description, - Optional isMapped, - Map additionalProperties) { - this.name = name; - this.description = description; - this.isMapped = isMapped; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_mapped") - public Optional getIsMapped() { - return isMapped; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApi other) { - return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isMapped); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isMapped = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApi other) { - name(other.getName()); - description(other.getDescription()); - isMapped(other.getIsMapped()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) - public Builder isMapped(Optional isMapped) { - this.isMapped = isMapped; - return this; - } - - public Builder isMapped(String isMapped) { - this.isMapped = Optional.ofNullable(isMapped); - return this; - } - - public ExternalTargetFieldApi build() { - return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/resources/hris/types/ExternalTargetFieldApiResponse.java deleted file mode 100644 index adc8b63dd..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ExternalTargetFieldApiResponse.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) -public final class ExternalTargetFieldApiResponse { - private final Optional> benefit; - - private final Optional> employerBenefit; - - private final Optional> company; - - private final Optional> employeePayrollRun; - - private final Optional> employee; - - private final Optional> employment; - - private final Optional> location; - - private final Optional> payrollRun; - - private final Optional> team; - - private final Optional> timeOff; - - private final Optional> timeOffBalance; - - private final Optional> bankInfo; - - private final Optional> payGroup; - - private final Optional> group; - - private final Optional> dependent; - - private final Optional> timesheetEntry; - - private final Map additionalProperties; - - private ExternalTargetFieldApiResponse( - Optional> benefit, - Optional> employerBenefit, - Optional> company, - Optional> employeePayrollRun, - Optional> employee, - Optional> employment, - Optional> location, - Optional> payrollRun, - Optional> team, - Optional> timeOff, - Optional> timeOffBalance, - Optional> bankInfo, - Optional> payGroup, - Optional> group, - Optional> dependent, - Optional> timesheetEntry, - Map additionalProperties) { - this.benefit = benefit; - this.employerBenefit = employerBenefit; - this.company = company; - this.employeePayrollRun = employeePayrollRun; - this.employee = employee; - this.employment = employment; - this.location = location; - this.payrollRun = payrollRun; - this.team = team; - this.timeOff = timeOff; - this.timeOffBalance = timeOffBalance; - this.bankInfo = bankInfo; - this.payGroup = payGroup; - this.group = group; - this.dependent = dependent; - this.timesheetEntry = timesheetEntry; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Benefit") - public Optional> getBenefit() { - return benefit; - } - - @JsonProperty("EmployerBenefit") - public Optional> getEmployerBenefit() { - return employerBenefit; - } - - @JsonProperty("Company") - public Optional> getCompany() { - return company; - } - - @JsonProperty("EmployeePayrollRun") - public Optional> getEmployeePayrollRun() { - return employeePayrollRun; - } - - @JsonProperty("Employee") - public Optional> getEmployee() { - return employee; - } - - @JsonProperty("Employment") - public Optional> getEmployment() { - return employment; - } - - @JsonProperty("Location") - public Optional> getLocation() { - return location; - } - - @JsonProperty("PayrollRun") - public Optional> getPayrollRun() { - return payrollRun; - } - - @JsonProperty("Team") - public Optional> getTeam() { - return team; - } - - @JsonProperty("TimeOff") - public Optional> getTimeOff() { - return timeOff; - } - - @JsonProperty("TimeOffBalance") - public Optional> getTimeOffBalance() { - return timeOffBalance; - } - - @JsonProperty("BankInfo") - public Optional> getBankInfo() { - return bankInfo; - } - - @JsonProperty("PayGroup") - public Optional> getPayGroup() { - return payGroup; - } - - @JsonProperty("Group") - public Optional> getGroup() { - return group; - } - - @JsonProperty("Dependent") - public Optional> getDependent() { - return dependent; - } - - @JsonProperty("TimesheetEntry") - public Optional> getTimesheetEntry() { - return timesheetEntry; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApiResponse other) { - return benefit.equals(other.benefit) - && employerBenefit.equals(other.employerBenefit) - && company.equals(other.company) - && employeePayrollRun.equals(other.employeePayrollRun) - && employee.equals(other.employee) - && employment.equals(other.employment) - && location.equals(other.location) - && payrollRun.equals(other.payrollRun) - && team.equals(other.team) - && timeOff.equals(other.timeOff) - && timeOffBalance.equals(other.timeOffBalance) - && bankInfo.equals(other.bankInfo) - && payGroup.equals(other.payGroup) - && group.equals(other.group) - && dependent.equals(other.dependent) - && timesheetEntry.equals(other.timesheetEntry); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.benefit, - this.employerBenefit, - this.company, - this.employeePayrollRun, - this.employee, - this.employment, - this.location, - this.payrollRun, - this.team, - this.timeOff, - this.timeOffBalance, - this.bankInfo, - this.payGroup, - this.group, - this.dependent, - this.timesheetEntry); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> benefit = Optional.empty(); - - private Optional> employerBenefit = Optional.empty(); - - private Optional> company = Optional.empty(); - - private Optional> employeePayrollRun = Optional.empty(); - - private Optional> employee = Optional.empty(); - - private Optional> employment = Optional.empty(); - - private Optional> location = Optional.empty(); - - private Optional> payrollRun = Optional.empty(); - - private Optional> team = Optional.empty(); - - private Optional> timeOff = Optional.empty(); - - private Optional> timeOffBalance = Optional.empty(); - - private Optional> bankInfo = Optional.empty(); - - private Optional> payGroup = Optional.empty(); - - private Optional> group = Optional.empty(); - - private Optional> dependent = Optional.empty(); - - private Optional> timesheetEntry = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApiResponse other) { - benefit(other.getBenefit()); - employerBenefit(other.getEmployerBenefit()); - company(other.getCompany()); - employeePayrollRun(other.getEmployeePayrollRun()); - employee(other.getEmployee()); - employment(other.getEmployment()); - location(other.getLocation()); - payrollRun(other.getPayrollRun()); - team(other.getTeam()); - timeOff(other.getTimeOff()); - timeOffBalance(other.getTimeOffBalance()); - bankInfo(other.getBankInfo()); - payGroup(other.getPayGroup()); - group(other.getGroup()); - dependent(other.getDependent()); - timesheetEntry(other.getTimesheetEntry()); - return this; - } - - @JsonSetter(value = "Benefit", nulls = Nulls.SKIP) - public Builder benefit(Optional> benefit) { - this.benefit = benefit; - return this; - } - - public Builder benefit(List benefit) { - this.benefit = Optional.ofNullable(benefit); - return this; - } - - @JsonSetter(value = "EmployerBenefit", nulls = Nulls.SKIP) - public Builder employerBenefit(Optional> employerBenefit) { - this.employerBenefit = employerBenefit; - return this; - } - - public Builder employerBenefit(List employerBenefit) { - this.employerBenefit = Optional.ofNullable(employerBenefit); - return this; - } - - @JsonSetter(value = "Company", nulls = Nulls.SKIP) - public Builder company(Optional> company) { - this.company = company; - return this; - } - - public Builder company(List company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "EmployeePayrollRun", nulls = Nulls.SKIP) - public Builder employeePayrollRun(Optional> employeePayrollRun) { - this.employeePayrollRun = employeePayrollRun; - return this; - } - - public Builder employeePayrollRun(List employeePayrollRun) { - this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); - return this; - } - - @JsonSetter(value = "Employee", nulls = Nulls.SKIP) - public Builder employee(Optional> employee) { - this.employee = employee; - return this; - } - - public Builder employee(List employee) { - this.employee = Optional.ofNullable(employee); - return this; - } - - @JsonSetter(value = "Employment", nulls = Nulls.SKIP) - public Builder employment(Optional> employment) { - this.employment = employment; - return this; - } - - public Builder employment(List employment) { - this.employment = Optional.ofNullable(employment); - return this; - } - - @JsonSetter(value = "Location", nulls = Nulls.SKIP) - public Builder location(Optional> location) { - this.location = location; - return this; - } - - public Builder location(List location) { - this.location = Optional.ofNullable(location); - return this; - } - - @JsonSetter(value = "PayrollRun", nulls = Nulls.SKIP) - public Builder payrollRun(Optional> payrollRun) { - this.payrollRun = payrollRun; - return this; - } - - public Builder payrollRun(List payrollRun) { - this.payrollRun = Optional.ofNullable(payrollRun); - return this; - } - - @JsonSetter(value = "Team", nulls = Nulls.SKIP) - public Builder team(Optional> team) { - this.team = team; - return this; - } - - public Builder team(List team) { - this.team = Optional.ofNullable(team); - return this; - } - - @JsonSetter(value = "TimeOff", nulls = Nulls.SKIP) - public Builder timeOff(Optional> timeOff) { - this.timeOff = timeOff; - return this; - } - - public Builder timeOff(List timeOff) { - this.timeOff = Optional.ofNullable(timeOff); - return this; - } - - @JsonSetter(value = "TimeOffBalance", nulls = Nulls.SKIP) - public Builder timeOffBalance(Optional> timeOffBalance) { - this.timeOffBalance = timeOffBalance; - return this; - } - - public Builder timeOffBalance(List timeOffBalance) { - this.timeOffBalance = Optional.ofNullable(timeOffBalance); - return this; - } - - @JsonSetter(value = "BankInfo", nulls = Nulls.SKIP) - public Builder bankInfo(Optional> bankInfo) { - this.bankInfo = bankInfo; - return this; - } - - public Builder bankInfo(List bankInfo) { - this.bankInfo = Optional.ofNullable(bankInfo); - return this; - } - - @JsonSetter(value = "PayGroup", nulls = Nulls.SKIP) - public Builder payGroup(Optional> payGroup) { - this.payGroup = payGroup; - return this; - } - - public Builder payGroup(List payGroup) { - this.payGroup = Optional.ofNullable(payGroup); - return this; - } - - @JsonSetter(value = "Group", nulls = Nulls.SKIP) - public Builder group(Optional> group) { - this.group = group; - return this; - } - - public Builder group(List group) { - this.group = Optional.ofNullable(group); - return this; - } - - @JsonSetter(value = "Dependent", nulls = Nulls.SKIP) - public Builder dependent(Optional> dependent) { - this.dependent = dependent; - return this; - } - - public Builder dependent(List dependent) { - this.dependent = Optional.ofNullable(dependent); - return this; - } - - @JsonSetter(value = "TimesheetEntry", nulls = Nulls.SKIP) - public Builder timesheetEntry(Optional> timesheetEntry) { - this.timesheetEntry = timesheetEntry; - return this; - } - - public Builder timesheetEntry(List timesheetEntry) { - this.timesheetEntry = Optional.ofNullable(timesheetEntry); - return this; - } - - public ExternalTargetFieldApiResponse build() { - return new ExternalTargetFieldApiResponse( - benefit, - employerBenefit, - company, - employeePayrollRun, - employee, - employment, - location, - payrollRun, - team, - timeOff, - timeOffBalance, - bankInfo, - payGroup, - group, - dependent, - timesheetEntry, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstance.java deleted file mode 100644 index f6f83cbe8..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstance.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) -public final class FieldMappingApiInstance { - private final Optional id; - - private final Optional isIntegrationWide; - - private final Optional targetField; - - private final Optional remoteField; - - private final Map additionalProperties; - - private FieldMappingApiInstance( - Optional id, - Optional isIntegrationWide, - Optional targetField, - Optional remoteField, - Map additionalProperties) { - this.id = id; - this.isIntegrationWide = isIntegrationWide; - this.targetField = targetField; - this.remoteField = remoteField; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("is_integration_wide") - public Optional getIsIntegrationWide() { - return isIntegrationWide; - } - - @JsonProperty("target_field") - public Optional getTargetField() { - return targetField; - } - - @JsonProperty("remote_field") - public Optional getRemoteField() { - return remoteField; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstance other) { - return id.equals(other.id) - && isIntegrationWide.equals(other.isIntegrationWide) - && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional isIntegrationWide = Optional.empty(); - - private Optional targetField = Optional.empty(); - - private Optional remoteField = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstance other) { - id(other.getId()); - isIntegrationWide(other.getIsIntegrationWide()); - targetField(other.getTargetField()); - remoteField(other.getRemoteField()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) - public Builder isIntegrationWide(Optional isIntegrationWide) { - this.isIntegrationWide = isIntegrationWide; - return this; - } - - public Builder isIntegrationWide(Boolean isIntegrationWide) { - this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); - return this; - } - - @JsonSetter(value = "target_field", nulls = Nulls.SKIP) - public Builder targetField(Optional targetField) { - this.targetField = targetField; - return this; - } - - public Builder targetField(FieldMappingApiInstanceTargetField targetField) { - this.targetField = Optional.ofNullable(targetField); - return this; - } - - @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) - public Builder remoteField(Optional remoteField) { - this.remoteField = remoteField; - return this; - } - - public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { - this.remoteField = Optional.ofNullable(remoteField); - return this; - } - - public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceRemoteField.java deleted file mode 100644 index bf2306c83..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceRemoteField.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) -public final class FieldMappingApiInstanceRemoteField { - private final Optional remoteKeyName; - - private final Optional> schema; - - private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteField( - Optional remoteKeyName, - Optional> schema, - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, - Map additionalProperties) { - this.remoteKeyName = remoteKeyName; - this.schema = schema; - this.remoteEndpointInfo = remoteEndpointInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("schema") - public Optional> getSchema() { - return schema; - } - - @JsonProperty("remote_endpoint_info") - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteField - && equalTo((FieldMappingApiInstanceRemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteField other) { - return remoteKeyName.equals(other.remoteKeyName) - && schema.equals(other.schema) - && remoteEndpointInfo.equals(other.remoteEndpointInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteEndpointInfoStage builder() { - return new Builder(); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); - - Builder from(FieldMappingApiInstanceRemoteField other); - } - - public interface _FinalStage { - FieldMappingApiInstanceRemoteField build(); - - _FinalStage remoteKeyName(Optional remoteKeyName); - - _FinalStage remoteKeyName(String remoteKeyName); - - _FinalStage schema(Optional> schema); - - _FinalStage schema(Map schema); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private Optional> schema = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceRemoteField other) { - remoteKeyName(other.getRemoteKeyName()); - schema(other.getSchema()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage schema(Map schema) { - this.schema = Optional.ofNullable(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Optional> schema) { - this.schema = schema; - return this; - } - - @java.lang.Override - public _FinalStage remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public _FinalStage remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceRemoteField build() { - return new FieldMappingApiInstanceRemoteField( - remoteKeyName, schema, remoteEndpointInfo, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java deleted file mode 100644 index d4ba1711b..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) -public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { - private final Optional method; - - private final Optional urlPath; - - private final Optional> fieldTraversalPath; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - Optional method, - Optional urlPath, - Optional> fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public Optional getMethod() { - return method; - } - - @JsonProperty("url_path") - public Optional getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public Optional> getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional method = Optional.empty(); - - private Optional urlPath = Optional.empty(); - - private Optional> fieldTraversalPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @JsonSetter(value = "method", nulls = Nulls.SKIP) - public Builder method(Optional method) { - this.method = method; - return this; - } - - public Builder method(String method) { - this.method = Optional.ofNullable(method); - return this; - } - - @JsonSetter(value = "url_path", nulls = Nulls.SKIP) - public Builder urlPath(Optional urlPath) { - this.urlPath = urlPath; - return this; - } - - public Builder urlPath(String urlPath) { - this.urlPath = Optional.ofNullable(urlPath); - return this; - } - - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public Builder fieldTraversalPath(Optional> fieldTraversalPath) { - this.fieldTraversalPath = fieldTraversalPath; - return this; - } - - public Builder fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); - return this; - } - - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { - return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceResponse.java deleted file mode 100644 index a9b6cbb04..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceResponse.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) -public final class FieldMappingApiInstanceResponse { - private final Optional> benefit; - - private final Optional> employerBenefit; - - private final Optional> company; - - private final Optional> employeePayrollRun; - - private final Optional> employee; - - private final Optional> employment; - - private final Optional> location; - - private final Optional> payrollRun; - - private final Optional> team; - - private final Optional> timeOff; - - private final Optional> timeOffBalance; - - private final Optional> bankInfo; - - private final Optional> payGroup; - - private final Optional> group; - - private final Optional> dependent; - - private final Optional> timesheetEntry; - - private final Map additionalProperties; - - private FieldMappingApiInstanceResponse( - Optional> benefit, - Optional> employerBenefit, - Optional> company, - Optional> employeePayrollRun, - Optional> employee, - Optional> employment, - Optional> location, - Optional> payrollRun, - Optional> team, - Optional> timeOff, - Optional> timeOffBalance, - Optional> bankInfo, - Optional> payGroup, - Optional> group, - Optional> dependent, - Optional> timesheetEntry, - Map additionalProperties) { - this.benefit = benefit; - this.employerBenefit = employerBenefit; - this.company = company; - this.employeePayrollRun = employeePayrollRun; - this.employee = employee; - this.employment = employment; - this.location = location; - this.payrollRun = payrollRun; - this.team = team; - this.timeOff = timeOff; - this.timeOffBalance = timeOffBalance; - this.bankInfo = bankInfo; - this.payGroup = payGroup; - this.group = group; - this.dependent = dependent; - this.timesheetEntry = timesheetEntry; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Benefit") - public Optional> getBenefit() { - return benefit; - } - - @JsonProperty("EmployerBenefit") - public Optional> getEmployerBenefit() { - return employerBenefit; - } - - @JsonProperty("Company") - public Optional> getCompany() { - return company; - } - - @JsonProperty("EmployeePayrollRun") - public Optional> getEmployeePayrollRun() { - return employeePayrollRun; - } - - @JsonProperty("Employee") - public Optional> getEmployee() { - return employee; - } - - @JsonProperty("Employment") - public Optional> getEmployment() { - return employment; - } - - @JsonProperty("Location") - public Optional> getLocation() { - return location; - } - - @JsonProperty("PayrollRun") - public Optional> getPayrollRun() { - return payrollRun; - } - - @JsonProperty("Team") - public Optional> getTeam() { - return team; - } - - @JsonProperty("TimeOff") - public Optional> getTimeOff() { - return timeOff; - } - - @JsonProperty("TimeOffBalance") - public Optional> getTimeOffBalance() { - return timeOffBalance; - } - - @JsonProperty("BankInfo") - public Optional> getBankInfo() { - return bankInfo; - } - - @JsonProperty("PayGroup") - public Optional> getPayGroup() { - return payGroup; - } - - @JsonProperty("Group") - public Optional> getGroup() { - return group; - } - - @JsonProperty("Dependent") - public Optional> getDependent() { - return dependent; - } - - @JsonProperty("TimesheetEntry") - public Optional> getTimesheetEntry() { - return timesheetEntry; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceResponse other) { - return benefit.equals(other.benefit) - && employerBenefit.equals(other.employerBenefit) - && company.equals(other.company) - && employeePayrollRun.equals(other.employeePayrollRun) - && employee.equals(other.employee) - && employment.equals(other.employment) - && location.equals(other.location) - && payrollRun.equals(other.payrollRun) - && team.equals(other.team) - && timeOff.equals(other.timeOff) - && timeOffBalance.equals(other.timeOffBalance) - && bankInfo.equals(other.bankInfo) - && payGroup.equals(other.payGroup) - && group.equals(other.group) - && dependent.equals(other.dependent) - && timesheetEntry.equals(other.timesheetEntry); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.benefit, - this.employerBenefit, - this.company, - this.employeePayrollRun, - this.employee, - this.employment, - this.location, - this.payrollRun, - this.team, - this.timeOff, - this.timeOffBalance, - this.bankInfo, - this.payGroup, - this.group, - this.dependent, - this.timesheetEntry); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> benefit = Optional.empty(); - - private Optional> employerBenefit = Optional.empty(); - - private Optional> company = Optional.empty(); - - private Optional> employeePayrollRun = Optional.empty(); - - private Optional> employee = Optional.empty(); - - private Optional> employment = Optional.empty(); - - private Optional> location = Optional.empty(); - - private Optional> payrollRun = Optional.empty(); - - private Optional> team = Optional.empty(); - - private Optional> timeOff = Optional.empty(); - - private Optional> timeOffBalance = Optional.empty(); - - private Optional> bankInfo = Optional.empty(); - - private Optional> payGroup = Optional.empty(); - - private Optional> group = Optional.empty(); - - private Optional> dependent = Optional.empty(); - - private Optional> timesheetEntry = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceResponse other) { - benefit(other.getBenefit()); - employerBenefit(other.getEmployerBenefit()); - company(other.getCompany()); - employeePayrollRun(other.getEmployeePayrollRun()); - employee(other.getEmployee()); - employment(other.getEmployment()); - location(other.getLocation()); - payrollRun(other.getPayrollRun()); - team(other.getTeam()); - timeOff(other.getTimeOff()); - timeOffBalance(other.getTimeOffBalance()); - bankInfo(other.getBankInfo()); - payGroup(other.getPayGroup()); - group(other.getGroup()); - dependent(other.getDependent()); - timesheetEntry(other.getTimesheetEntry()); - return this; - } - - @JsonSetter(value = "Benefit", nulls = Nulls.SKIP) - public Builder benefit(Optional> benefit) { - this.benefit = benefit; - return this; - } - - public Builder benefit(List benefit) { - this.benefit = Optional.ofNullable(benefit); - return this; - } - - @JsonSetter(value = "EmployerBenefit", nulls = Nulls.SKIP) - public Builder employerBenefit(Optional> employerBenefit) { - this.employerBenefit = employerBenefit; - return this; - } - - public Builder employerBenefit(List employerBenefit) { - this.employerBenefit = Optional.ofNullable(employerBenefit); - return this; - } - - @JsonSetter(value = "Company", nulls = Nulls.SKIP) - public Builder company(Optional> company) { - this.company = company; - return this; - } - - public Builder company(List company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "EmployeePayrollRun", nulls = Nulls.SKIP) - public Builder employeePayrollRun(Optional> employeePayrollRun) { - this.employeePayrollRun = employeePayrollRun; - return this; - } - - public Builder employeePayrollRun(List employeePayrollRun) { - this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); - return this; - } - - @JsonSetter(value = "Employee", nulls = Nulls.SKIP) - public Builder employee(Optional> employee) { - this.employee = employee; - return this; - } - - public Builder employee(List employee) { - this.employee = Optional.ofNullable(employee); - return this; - } - - @JsonSetter(value = "Employment", nulls = Nulls.SKIP) - public Builder employment(Optional> employment) { - this.employment = employment; - return this; - } - - public Builder employment(List employment) { - this.employment = Optional.ofNullable(employment); - return this; - } - - @JsonSetter(value = "Location", nulls = Nulls.SKIP) - public Builder location(Optional> location) { - this.location = location; - return this; - } - - public Builder location(List location) { - this.location = Optional.ofNullable(location); - return this; - } - - @JsonSetter(value = "PayrollRun", nulls = Nulls.SKIP) - public Builder payrollRun(Optional> payrollRun) { - this.payrollRun = payrollRun; - return this; - } - - public Builder payrollRun(List payrollRun) { - this.payrollRun = Optional.ofNullable(payrollRun); - return this; - } - - @JsonSetter(value = "Team", nulls = Nulls.SKIP) - public Builder team(Optional> team) { - this.team = team; - return this; - } - - public Builder team(List team) { - this.team = Optional.ofNullable(team); - return this; - } - - @JsonSetter(value = "TimeOff", nulls = Nulls.SKIP) - public Builder timeOff(Optional> timeOff) { - this.timeOff = timeOff; - return this; - } - - public Builder timeOff(List timeOff) { - this.timeOff = Optional.ofNullable(timeOff); - return this; - } - - @JsonSetter(value = "TimeOffBalance", nulls = Nulls.SKIP) - public Builder timeOffBalance(Optional> timeOffBalance) { - this.timeOffBalance = timeOffBalance; - return this; - } - - public Builder timeOffBalance(List timeOffBalance) { - this.timeOffBalance = Optional.ofNullable(timeOffBalance); - return this; - } - - @JsonSetter(value = "BankInfo", nulls = Nulls.SKIP) - public Builder bankInfo(Optional> bankInfo) { - this.bankInfo = bankInfo; - return this; - } - - public Builder bankInfo(List bankInfo) { - this.bankInfo = Optional.ofNullable(bankInfo); - return this; - } - - @JsonSetter(value = "PayGroup", nulls = Nulls.SKIP) - public Builder payGroup(Optional> payGroup) { - this.payGroup = payGroup; - return this; - } - - public Builder payGroup(List payGroup) { - this.payGroup = Optional.ofNullable(payGroup); - return this; - } - - @JsonSetter(value = "Group", nulls = Nulls.SKIP) - public Builder group(Optional> group) { - this.group = group; - return this; - } - - public Builder group(List group) { - this.group = Optional.ofNullable(group); - return this; - } - - @JsonSetter(value = "Dependent", nulls = Nulls.SKIP) - public Builder dependent(Optional> dependent) { - this.dependent = dependent; - return this; - } - - public Builder dependent(List dependent) { - this.dependent = Optional.ofNullable(dependent); - return this; - } - - @JsonSetter(value = "TimesheetEntry", nulls = Nulls.SKIP) - public Builder timesheetEntry(Optional> timesheetEntry) { - this.timesheetEntry = timesheetEntry; - return this; - } - - public Builder timesheetEntry(List timesheetEntry) { - this.timesheetEntry = Optional.ofNullable(timesheetEntry); - return this; - } - - public FieldMappingApiInstanceResponse build() { - return new FieldMappingApiInstanceResponse( - benefit, - employerBenefit, - company, - employeePayrollRun, - employee, - employment, - location, - payrollRun, - team, - timeOff, - timeOffBalance, - bankInfo, - payGroup, - group, - dependent, - timesheetEntry, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceTargetField.java deleted file mode 100644 index 957d644b9..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldMappingApiInstanceTargetField.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) -public final class FieldMappingApiInstanceTargetField { - private final String name; - - private final String description; - - private final boolean isOrganizationWide; - - private final Map additionalProperties; - - private FieldMappingApiInstanceTargetField( - String name, String description, boolean isOrganizationWide, Map additionalProperties) { - this.name = name; - this.description = description; - this.isOrganizationWide = isOrganizationWide; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("is_organization_wide") - public boolean getIsOrganizationWide() { - return isOrganizationWide; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceTargetField - && equalTo((FieldMappingApiInstanceTargetField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceTargetField other) { - return name.equals(other.name) - && description.equals(other.description) - && isOrganizationWide == other.isOrganizationWide; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isOrganizationWide); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DescriptionStage name(@NotNull String name); - - Builder from(FieldMappingApiInstanceTargetField other); - } - - public interface DescriptionStage { - IsOrganizationWideStage description(@NotNull String description); - } - - public interface IsOrganizationWideStage { - _FinalStage isOrganizationWide(boolean isOrganizationWide); - } - - public interface _FinalStage { - FieldMappingApiInstanceTargetField build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { - private String name; - - private String description; - - private boolean isOrganizationWide; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceTargetField other) { - name(other.getName()); - description(other.getDescription()); - isOrganizationWide(other.getIsOrganizationWide()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public DescriptionStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("description") - public IsOrganizationWideStage description(@NotNull String description) { - this.description = description; - return this; - } - - @java.lang.Override - @JsonSetter("is_organization_wide") - public _FinalStage isOrganizationWide(boolean isOrganizationWide) { - this.isOrganizationWide = isOrganizationWide; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceTargetField build() { - return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/resources/hris/types/FieldMappingInstanceResponse.java deleted file mode 100644 index 3af8da9fd..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldMappingInstanceResponse.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) -public final class FieldMappingInstanceResponse { - private final FieldMappingApiInstance model; - - private final List warnings; - - private final List errors; - - private final Optional> logs; - - private final Map additionalProperties; - - private FieldMappingInstanceResponse( - FieldMappingApiInstance model, - List warnings, - List errors, - Optional> logs, - Map additionalProperties) { - this.model = model; - this.warnings = warnings; - this.errors = errors; - this.logs = logs; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model") - public FieldMappingApiInstance getModel() { - return model; - } - - @JsonProperty("warnings") - public List getWarnings() { - return warnings; - } - - @JsonProperty("errors") - public List getErrors() { - return errors; - } - - @JsonProperty("logs") - public Optional> getLogs() { - return logs; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingInstanceResponse other) { - return model.equals(other.model) - && warnings.equals(other.warnings) - && errors.equals(other.errors) - && logs.equals(other.logs); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.warnings, this.errors, this.logs); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelStage builder() { - return new Builder(); - } - - public interface ModelStage { - _FinalStage model(@NotNull FieldMappingApiInstance model); - - Builder from(FieldMappingInstanceResponse other); - } - - public interface _FinalStage { - FieldMappingInstanceResponse build(); - - _FinalStage warnings(List warnings); - - _FinalStage addWarnings(WarningValidationProblem warnings); - - _FinalStage addAllWarnings(List warnings); - - _FinalStage errors(List errors); - - _FinalStage addErrors(ErrorValidationProblem errors); - - _FinalStage addAllErrors(List errors); - - _FinalStage logs(Optional> logs); - - _FinalStage logs(List logs); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelStage, _FinalStage { - private FieldMappingApiInstance model; - - private Optional> logs = Optional.empty(); - - private List errors = new ArrayList<>(); - - private List warnings = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingInstanceResponse other) { - model(other.getModel()); - warnings(other.getWarnings()); - errors(other.getErrors()); - logs(other.getLogs()); - return this; - } - - @java.lang.Override - @JsonSetter("model") - public _FinalStage model(@NotNull FieldMappingApiInstance model) { - this.model = model; - return this; - } - - @java.lang.Override - public _FinalStage logs(List logs) { - this.logs = Optional.ofNullable(logs); - return this; - } - - @java.lang.Override - @JsonSetter(value = "logs", nulls = Nulls.SKIP) - public _FinalStage logs(Optional> logs) { - this.logs = logs; - return this; - } - - @java.lang.Override - public _FinalStage addAllErrors(List errors) { - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addErrors(ErrorValidationProblem errors) { - this.errors.add(errors); - return this; - } - - @java.lang.Override - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public _FinalStage errors(List errors) { - this.errors.clear(); - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addAllWarnings(List warnings) { - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public _FinalStage addWarnings(WarningValidationProblem warnings) { - this.warnings.add(warnings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public _FinalStage warnings(List warnings) { - this.warnings.clear(); - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public FieldMappingInstanceResponse build() { - return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/resources/hris/types/FieldPermissionDeserializer.java deleted file mode 100644 index 91337d4e2..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldPermissionDeserializer.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) -public final class FieldPermissionDeserializer { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializer( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializer other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializer other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializer build() { - return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/hris/types/FieldPermissionDeserializerRequest.java deleted file mode 100644 index 1db5e5969..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/FieldPermissionDeserializerRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) -public final class FieldPermissionDeserializerRequest { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializerRequest( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializerRequest - && equalTo((FieldPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializerRequest other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializerRequest other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializerRequest build() { - return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/GenderEnum.java b/src/main/java/com/merge/api/resources/hris/types/GenderEnum.java deleted file mode 100644 index 806e2441d..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/GenderEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum GenderEnum { - MALE("MALE"), - - FEMALE("FEMALE"), - - NON_BINARY("NON-BINARY"), - - OTHER("OTHER"), - - PREFER_NOT_TO_DISCLOSE("PREFER_NOT_TO_DISCLOSE"); - - private final String value; - - GenderEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/Group.java b/src/main/java/com/merge/api/resources/hris/types/Group.java deleted file mode 100644 index 451b13783..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/Group.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Group.Builder.class) -public final class Group { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional parentGroup; - - private final Optional name; - - private final Optional type; - - private final Optional remoteWasDeleted; - - private final Optional isCommonlyUsedAsTeam; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Group( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional parentGroup, - Optional name, - Optional type, - Optional remoteWasDeleted, - Optional isCommonlyUsedAsTeam, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.parentGroup = parentGroup; - this.name = name; - this.type = type; - this.remoteWasDeleted = remoteWasDeleted; - this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The parent group for this group. - */ - @JsonProperty("parent_group") - public Optional getParentGroup() { - return parentGroup; - } - - /** - * @return The group name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The Group type returned directly from the third-party. - *
    - *
  • TEAM - TEAM
  • - *
  • DEPARTMENT - DEPARTMENT
  • - *
  • COST_CENTER - COST_CENTER
  • - *
  • BUSINESS_UNIT - BUSINESS_UNIT
  • - *
  • GROUP - GROUP
  • - *
- */ - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - /** - * @return Indicates whether the Group refers to a team in the third party platform. Note that this is an opinionated view based on how Merge observes most organizations representing teams in each third party platform. If your customer uses a platform different from most, there is a chance this will not be correct. - */ - @JsonProperty("is_commonly_used_as_team") - public Optional getIsCommonlyUsedAsTeam() { - return isCommonlyUsedAsTeam; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Group && equalTo((Group) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Group other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && parentGroup.equals(other.parentGroup) - && name.equals(other.name) - && type.equals(other.type) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && isCommonlyUsedAsTeam.equals(other.isCommonlyUsedAsTeam) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.parentGroup, - this.name, - this.type, - this.remoteWasDeleted, - this.isCommonlyUsedAsTeam, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional parentGroup = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional type = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional isCommonlyUsedAsTeam = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Group other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - parentGroup(other.getParentGroup()); - name(other.getName()); - type(other.getType()); - remoteWasDeleted(other.getRemoteWasDeleted()); - isCommonlyUsedAsTeam(other.getIsCommonlyUsedAsTeam()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "parent_group", nulls = Nulls.SKIP) - public Builder parentGroup(Optional parentGroup) { - this.parentGroup = parentGroup; - return this; - } - - public Builder parentGroup(String parentGroup) { - this.parentGroup = Optional.ofNullable(parentGroup); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(GroupType type) { - this.type = Optional.ofNullable(type); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "is_commonly_used_as_team", nulls = Nulls.SKIP) - public Builder isCommonlyUsedAsTeam(Optional isCommonlyUsedAsTeam) { - this.isCommonlyUsedAsTeam = isCommonlyUsedAsTeam; - return this; - } - - public Builder isCommonlyUsedAsTeam(Boolean isCommonlyUsedAsTeam) { - this.isCommonlyUsedAsTeam = Optional.ofNullable(isCommonlyUsedAsTeam); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Group build() { - return new Group( - id, - remoteId, - createdAt, - modifiedAt, - parentGroup, - name, - type, - remoteWasDeleted, - isCommonlyUsedAsTeam, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/GroupType.java b/src/main/java/com/merge/api/resources/hris/types/GroupType.java deleted file mode 100644 index e67c7da72..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/GroupType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = GroupType.Deserializer.class) -public final class GroupType { - private final Object value; - - private final int type; - - private GroupType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((GroupTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GroupType && equalTo((GroupType) other); - } - - private boolean equalTo(GroupType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static GroupType of(GroupTypeEnum value) { - return new GroupType(value, 0); - } - - public static GroupType of(String value) { - return new GroupType(value, 1); - } - - public interface Visitor { - T visit(GroupTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(GroupType.class); - } - - @java.lang.Override - public GroupType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, GroupTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/resources/hris/types/IndividualCommonModelScopeDeserializer.java deleted file mode 100644 index ed61b4227..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/IndividualCommonModelScopeDeserializer.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) -public final class IndividualCommonModelScopeDeserializer { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializer( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializer - && equalTo((IndividualCommonModelScopeDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializer other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializer other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializer build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializer other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions(Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializer build() { - return new IndividualCommonModelScopeDeserializer( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/hris/types/IndividualCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 6ee9699ba..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/IndividualCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) -public final class IndividualCommonModelScopeDeserializerRequest { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializerRequest( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializerRequest - && equalTo((IndividualCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializerRequest other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializerRequest build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializerRequest other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions( - Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializerRequest build() { - return new IndividualCommonModelScopeDeserializerRequest( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/Issue.java b/src/main/java/com/merge/api/resources/hris/types/Issue.java deleted file mode 100644 index e6d294ea0..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/Issue.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Issue.Builder.class) -public final class Issue { - private final Optional id; - - private final Optional status; - - private final String errorDescription; - - private final Optional> endUser; - - private final Optional firstIncidentTime; - - private final Optional lastIncidentTime; - - private final Optional isMuted; - - private final Optional> errorDetails; - - private final Map additionalProperties; - - private Issue( - Optional id, - Optional status, - String errorDescription, - Optional> endUser, - Optional firstIncidentTime, - Optional lastIncidentTime, - Optional isMuted, - Optional> errorDetails, - Map additionalProperties) { - this.id = id; - this.status = status; - this.errorDescription = errorDescription; - this.endUser = endUser; - this.firstIncidentTime = firstIncidentTime; - this.lastIncidentTime = lastIncidentTime; - this.isMuted = isMuted; - this.errorDetails = errorDetails; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("error_description") - public String getErrorDescription() { - return errorDescription; - } - - @JsonProperty("end_user") - public Optional> getEndUser() { - return endUser; - } - - @JsonProperty("first_incident_time") - public Optional getFirstIncidentTime() { - return firstIncidentTime; - } - - @JsonProperty("last_incident_time") - public Optional getLastIncidentTime() { - return lastIncidentTime; - } - - @JsonProperty("is_muted") - public Optional getIsMuted() { - return isMuted; - } - - @JsonProperty("error_details") - public Optional> getErrorDetails() { - return errorDetails; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Issue && equalTo((Issue) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Issue other) { - return id.equals(other.id) - && status.equals(other.status) - && errorDescription.equals(other.errorDescription) - && endUser.equals(other.endUser) - && firstIncidentTime.equals(other.firstIncidentTime) - && lastIncidentTime.equals(other.lastIncidentTime) - && isMuted.equals(other.isMuted) - && errorDetails.equals(other.errorDetails); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.status, - this.errorDescription, - this.endUser, - this.firstIncidentTime, - this.lastIncidentTime, - this.isMuted, - this.errorDetails); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ErrorDescriptionStage builder() { - return new Builder(); - } - - public interface ErrorDescriptionStage { - _FinalStage errorDescription(@NotNull String errorDescription); - - Builder from(Issue other); - } - - public interface _FinalStage { - Issue build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage status(Optional status); - - _FinalStage status(IssueStatus status); - - _FinalStage endUser(Optional> endUser); - - _FinalStage endUser(Map endUser); - - _FinalStage firstIncidentTime(Optional firstIncidentTime); - - _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); - - _FinalStage lastIncidentTime(Optional lastIncidentTime); - - _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); - - _FinalStage isMuted(Optional isMuted); - - _FinalStage isMuted(Boolean isMuted); - - _FinalStage errorDetails(Optional> errorDetails); - - _FinalStage errorDetails(List errorDetails); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ErrorDescriptionStage, _FinalStage { - private String errorDescription; - - private Optional> errorDetails = Optional.empty(); - - private Optional isMuted = Optional.empty(); - - private Optional lastIncidentTime = Optional.empty(); - - private Optional firstIncidentTime = Optional.empty(); - - private Optional> endUser = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Issue other) { - id(other.getId()); - status(other.getStatus()); - errorDescription(other.getErrorDescription()); - endUser(other.getEndUser()); - firstIncidentTime(other.getFirstIncidentTime()); - lastIncidentTime(other.getLastIncidentTime()); - isMuted(other.getIsMuted()); - errorDetails(other.getErrorDetails()); - return this; - } - - @java.lang.Override - @JsonSetter("error_description") - public _FinalStage errorDescription(@NotNull String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - @java.lang.Override - public _FinalStage errorDetails(List errorDetails) { - this.errorDetails = Optional.ofNullable(errorDetails); - return this; - } - - @java.lang.Override - @JsonSetter(value = "error_details", nulls = Nulls.SKIP) - public _FinalStage errorDetails(Optional> errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - @java.lang.Override - public _FinalStage isMuted(Boolean isMuted) { - this.isMuted = Optional.ofNullable(isMuted); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) - public _FinalStage isMuted(Optional isMuted) { - this.isMuted = isMuted; - return this; - } - - @java.lang.Override - public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { - this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) - public _FinalStage lastIncidentTime(Optional lastIncidentTime) { - this.lastIncidentTime = lastIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { - this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) - public _FinalStage firstIncidentTime(Optional firstIncidentTime) { - this.firstIncidentTime = firstIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage endUser(Map endUser) { - this.endUser = Optional.ofNullable(endUser); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user", nulls = Nulls.SKIP) - public _FinalStage endUser(Optional> endUser) { - this.endUser = endUser; - return this; - } - - /** - *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

- *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage status(IssueStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public Issue build() { - return new Issue( - id, - status, - errorDescription, - endUser, - firstIncidentTime, - lastIncidentTime, - isMuted, - errorDetails, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/IssueStatus.java b/src/main/java/com/merge/api/resources/hris/types/IssueStatus.java deleted file mode 100644 index c93308502..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/IssueStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IssueStatus.Deserializer.class) -public final class IssueStatus { - private final Object value; - - private final int type; - - private IssueStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((IssueStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssueStatus && equalTo((IssueStatus) other); - } - - private boolean equalTo(IssueStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IssueStatus of(IssueStatusEnum value) { - return new IssueStatus(value, 0); - } - - public static IssueStatus of(String value) { - return new IssueStatus(value, 1); - } - - public interface Visitor { - T visit(IssueStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IssueStatus.class); - } - - @java.lang.Override - public IssueStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/IssueStatusEnum.java b/src/main/java/com/merge/api/resources/hris/types/IssueStatusEnum.java deleted file mode 100644 index 3c82a0452..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/IssueStatusEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssueStatusEnum { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssueStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/LanguageEnum.java b/src/main/java/com/merge/api/resources/hris/types/LanguageEnum.java deleted file mode 100644 index cfd123e2a..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/LanguageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LanguageEnum { - EN("en"), - - DE("de"); - - private final String value; - - LanguageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/LinkToken.java b/src/main/java/com/merge/api/resources/hris/types/LinkToken.java deleted file mode 100644 index 1ead2f9e6..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/LinkToken.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkToken.Builder.class) -public final class LinkToken { - private final String linkToken; - - private final Optional integrationName; - - private final Optional magicLinkUrl; - - private final Map additionalProperties; - - private LinkToken( - String linkToken, - Optional integrationName, - Optional magicLinkUrl, - Map additionalProperties) { - this.linkToken = linkToken; - this.integrationName = integrationName; - this.magicLinkUrl = magicLinkUrl; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("link_token") - public String getLinkToken() { - return linkToken; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - @JsonProperty("magic_link_url") - public Optional getMagicLinkUrl() { - return magicLinkUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkToken && equalTo((LinkToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkToken other) { - return linkToken.equals(other.linkToken) - && integrationName.equals(other.integrationName) - && magicLinkUrl.equals(other.magicLinkUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkTokenStage builder() { - return new Builder(); - } - - public interface LinkTokenStage { - _FinalStage linkToken(@NotNull String linkToken); - - Builder from(LinkToken other); - } - - public interface _FinalStage { - LinkToken build(); - - _FinalStage integrationName(Optional integrationName); - - _FinalStage integrationName(String integrationName); - - _FinalStage magicLinkUrl(Optional magicLinkUrl); - - _FinalStage magicLinkUrl(String magicLinkUrl); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkTokenStage, _FinalStage { - private String linkToken; - - private Optional magicLinkUrl = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkToken other) { - linkToken(other.getLinkToken()); - integrationName(other.getIntegrationName()); - magicLinkUrl(other.getMagicLinkUrl()); - return this; - } - - @java.lang.Override - @JsonSetter("link_token") - public _FinalStage linkToken(@NotNull String linkToken) { - this.linkToken = linkToken; - return this; - } - - @java.lang.Override - public _FinalStage magicLinkUrl(String magicLinkUrl) { - this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) - public _FinalStage magicLinkUrl(Optional magicLinkUrl) { - this.magicLinkUrl = magicLinkUrl; - return this; - } - - @java.lang.Override - public _FinalStage integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public _FinalStage integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - @java.lang.Override - public LinkToken build() { - return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/resources/hris/types/LinkedAccountStatus.java deleted file mode 100644 index 11228e275..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/LinkedAccountStatus.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) -public final class LinkedAccountStatus { - private final String linkedAccountStatus; - - private final boolean canMakeRequest; - - private final Map additionalProperties; - - private LinkedAccountStatus( - String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { - this.linkedAccountStatus = linkedAccountStatus; - this.canMakeRequest = canMakeRequest; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("linked_account_status") - public String getLinkedAccountStatus() { - return linkedAccountStatus; - } - - @JsonProperty("can_make_request") - public boolean getCanMakeRequest() { - return canMakeRequest; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountStatus other) { - return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkedAccountStatusStage builder() { - return new Builder(); - } - - public interface LinkedAccountStatusStage { - CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); - - Builder from(LinkedAccountStatus other); - } - - public interface CanMakeRequestStage { - _FinalStage canMakeRequest(boolean canMakeRequest); - } - - public interface _FinalStage { - LinkedAccountStatus build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { - private String linkedAccountStatus; - - private boolean canMakeRequest; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkedAccountStatus other) { - linkedAccountStatus(other.getLinkedAccountStatus()); - canMakeRequest(other.getCanMakeRequest()); - return this; - } - - @java.lang.Override - @JsonSetter("linked_account_status") - public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { - this.linkedAccountStatus = linkedAccountStatus; - return this; - } - - @java.lang.Override - @JsonSetter("can_make_request") - public _FinalStage canMakeRequest(boolean canMakeRequest) { - this.canMakeRequest = canMakeRequest; - return this; - } - - @java.lang.Override - public LinkedAccountStatus build() { - return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/LocationCountry.java b/src/main/java/com/merge/api/resources/hris/types/LocationCountry.java deleted file mode 100644 index f405cfb9a..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/LocationCountry.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = LocationCountry.Deserializer.class) -public final class LocationCountry { - private final Object value; - - private final int type; - - private LocationCountry(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CountryEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LocationCountry && equalTo((LocationCountry) other); - } - - private boolean equalTo(LocationCountry other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static LocationCountry of(CountryEnum value) { - return new LocationCountry(value, 0); - } - - public static LocationCountry of(String value) { - return new LocationCountry(value, 1); - } - - public interface Visitor { - T visit(CountryEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(LocationCountry.class); - } - - @java.lang.Override - public LocationCountry deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CountryEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/LocationLocationType.java b/src/main/java/com/merge/api/resources/hris/types/LocationLocationType.java deleted file mode 100644 index 91677ae17..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/LocationLocationType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = LocationLocationType.Deserializer.class) -public final class LocationLocationType { - private final Object value; - - private final int type; - - private LocationLocationType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((LocationTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LocationLocationType && equalTo((LocationLocationType) other); - } - - private boolean equalTo(LocationLocationType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static LocationLocationType of(LocationTypeEnum value) { - return new LocationLocationType(value, 0); - } - - public static LocationLocationType of(String value) { - return new LocationLocationType(value, 1); - } - - public interface Visitor { - T visit(LocationTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(LocationLocationType.class); - } - - @java.lang.Override - public LocationLocationType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, LocationTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/MetaResponse.java b/src/main/java/com/merge/api/resources/hris/types/MetaResponse.java deleted file mode 100644 index c6528d5b6..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/MetaResponse.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MetaResponse.Builder.class) -public final class MetaResponse { - private final Map requestSchema; - - private final Optional> remoteFieldClasses; - - private final Optional status; - - private final boolean hasConditionalParams; - - private final boolean hasRequiredLinkedAccountParams; - - private final Map additionalProperties; - - private MetaResponse( - Map requestSchema, - Optional> remoteFieldClasses, - Optional status, - boolean hasConditionalParams, - boolean hasRequiredLinkedAccountParams, - Map additionalProperties) { - this.requestSchema = requestSchema; - this.remoteFieldClasses = remoteFieldClasses; - this.status = status; - this.hasConditionalParams = hasConditionalParams; - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("request_schema") - public Map getRequestSchema() { - return requestSchema; - } - - @JsonProperty("remote_field_classes") - public Optional> getRemoteFieldClasses() { - return remoteFieldClasses; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("has_conditional_params") - public boolean getHasConditionalParams() { - return hasConditionalParams; - } - - @JsonProperty("has_required_linked_account_params") - public boolean getHasRequiredLinkedAccountParams() { - return hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MetaResponse && equalTo((MetaResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MetaResponse other) { - return requestSchema.equals(other.requestSchema) - && remoteFieldClasses.equals(other.remoteFieldClasses) - && status.equals(other.status) - && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.requestSchema, - this.remoteFieldClasses, - this.status, - this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static HasConditionalParamsStage builder() { - return new Builder(); - } - - public interface HasConditionalParamsStage { - HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); - - Builder from(MetaResponse other); - } - - public interface HasRequiredLinkedAccountParamsStage { - _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); - } - - public interface _FinalStage { - MetaResponse build(); - - _FinalStage requestSchema(Map requestSchema); - - _FinalStage putAllRequestSchema(Map requestSchema); - - _FinalStage requestSchema(String key, JsonNode value); - - _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); - - _FinalStage remoteFieldClasses(Map remoteFieldClasses); - - _FinalStage status(Optional status); - - _FinalStage status(LinkedAccountStatus status); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { - private boolean hasConditionalParams; - - private boolean hasRequiredLinkedAccountParams; - - private Optional status = Optional.empty(); - - private Optional> remoteFieldClasses = Optional.empty(); - - private Map requestSchema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MetaResponse other) { - requestSchema(other.getRequestSchema()); - remoteFieldClasses(other.getRemoteFieldClasses()); - status(other.getStatus()); - hasConditionalParams(other.getHasConditionalParams()); - hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); - return this; - } - - @java.lang.Override - @JsonSetter("has_conditional_params") - public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { - this.hasConditionalParams = hasConditionalParams; - return this; - } - - @java.lang.Override - @JsonSetter("has_required_linked_account_params") - public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - return this; - } - - @java.lang.Override - public _FinalStage status(LinkedAccountStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { - this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) - public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { - this.remoteFieldClasses = remoteFieldClasses; - return this; - } - - @java.lang.Override - public _FinalStage requestSchema(String key, JsonNode value) { - this.requestSchema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllRequestSchema(Map requestSchema) { - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) - public _FinalStage requestSchema(Map requestSchema) { - this.requestSchema.clear(); - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - public MetaResponse build() { - return new MetaResponse( - requestSchema, - remoteFieldClasses, - status, - hasConditionalParams, - hasRequiredLinkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/MethodEnum.java b/src/main/java/com/merge/api/resources/hris/types/MethodEnum.java deleted file mode 100644 index 3879d44c8..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/MethodEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum MethodEnum { - GET("GET"), - - OPTIONS("OPTIONS"), - - HEAD("HEAD"), - - POST("POST"), - - PUT("PUT"), - - PATCH("PATCH"), - - DELETE("DELETE"); - - private final String value; - - MethodEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ModelOperation.java b/src/main/java/com/merge/api/resources/hris/types/ModelOperation.java deleted file mode 100644 index 04933658f..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ModelOperation.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelOperation.Builder.class) -public final class ModelOperation { - private final String modelName; - - private final List availableOperations; - - private final List requiredPostParameters; - - private final List supportedFields; - - private final Map additionalProperties; - - private ModelOperation( - String modelName, - List availableOperations, - List requiredPostParameters, - List supportedFields, - Map additionalProperties) { - this.modelName = modelName; - this.availableOperations = availableOperations; - this.requiredPostParameters = requiredPostParameters; - this.supportedFields = supportedFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("available_operations") - public List getAvailableOperations() { - return availableOperations; - } - - @JsonProperty("required_post_parameters") - public List getRequiredPostParameters() { - return requiredPostParameters; - } - - @JsonProperty("supported_fields") - public List getSupportedFields() { - return supportedFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelOperation && equalTo((ModelOperation) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelOperation other) { - return modelName.equals(other.modelName) - && availableOperations.equals(other.availableOperations) - && requiredPostParameters.equals(other.requiredPostParameters) - && supportedFields.equals(other.supportedFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(ModelOperation other); - } - - public interface _FinalStage { - ModelOperation build(); - - _FinalStage availableOperations(List availableOperations); - - _FinalStage addAvailableOperations(String availableOperations); - - _FinalStage addAllAvailableOperations(List availableOperations); - - _FinalStage requiredPostParameters(List requiredPostParameters); - - _FinalStage addRequiredPostParameters(String requiredPostParameters); - - _FinalStage addAllRequiredPostParameters(List requiredPostParameters); - - _FinalStage supportedFields(List supportedFields); - - _FinalStage addSupportedFields(String supportedFields); - - _FinalStage addAllSupportedFields(List supportedFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private List supportedFields = new ArrayList<>(); - - private List requiredPostParameters = new ArrayList<>(); - - private List availableOperations = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ModelOperation other) { - modelName(other.getModelName()); - availableOperations(other.getAvailableOperations()); - requiredPostParameters(other.getRequiredPostParameters()); - supportedFields(other.getSupportedFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage addAllSupportedFields(List supportedFields) { - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addSupportedFields(String supportedFields) { - this.supportedFields.add(supportedFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) - public _FinalStage supportedFields(List supportedFields) { - this.supportedFields.clear(); - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addRequiredPostParameters(String requiredPostParameters) { - this.requiredPostParameters.add(requiredPostParameters); - return this; - } - - @java.lang.Override - @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) - public _FinalStage requiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.clear(); - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addAllAvailableOperations(List availableOperations) { - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public _FinalStage addAvailableOperations(String availableOperations) { - this.availableOperations.add(availableOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) - public _FinalStage availableOperations(List availableOperations) { - this.availableOperations.clear(); - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public ModelOperation build() { - return new ModelOperation( - modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/resources/hris/types/ModelPermissionDeserializer.java deleted file mode 100644 index 0a6c50dee..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ModelPermissionDeserializer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) -public final class ModelPermissionDeserializer { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializer other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializer other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializer build() { - return new ModelPermissionDeserializer(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/hris/types/ModelPermissionDeserializerRequest.java deleted file mode 100644 index a24745330..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ModelPermissionDeserializerRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) -public final class ModelPermissionDeserializerRequest { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializerRequest - && equalTo((ModelPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializerRequest other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializerRequest other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializerRequest build() { - return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/resources/hris/types/MultipartFormFieldRequest.java deleted file mode 100644 index 1dc2e0859..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/MultipartFormFieldRequest.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) -public final class MultipartFormFieldRequest { - private final String name; - - private final String data; - - private final Optional encoding; - - private final Optional fileName; - - private final Optional contentType; - - private final Map additionalProperties; - - private MultipartFormFieldRequest( - String name, - String data, - Optional encoding, - Optional fileName, - Optional contentType, - Map additionalProperties) { - this.name = name; - this.data = data; - this.encoding = encoding; - this.fileName = fileName; - this.contentType = contentType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the form field - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The data for the form field. - */ - @JsonProperty("data") - public String getData() { - return data; - } - - /** - * @return The encoding of the value of data. Defaults to RAW if not defined. - *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- */ - @JsonProperty("encoding") - public Optional getEncoding() { - return encoding; - } - - /** - * @return The file name of the form field, if the field is for a file. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The MIME type of the file, if the field is for a file. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MultipartFormFieldRequest other) { - return name.equals(other.name) - && data.equals(other.data) - && encoding.equals(other.encoding) - && fileName.equals(other.fileName) - && contentType.equals(other.contentType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DataStage name(@NotNull String name); - - Builder from(MultipartFormFieldRequest other); - } - - public interface DataStage { - _FinalStage data(@NotNull String data); - } - - public interface _FinalStage { - MultipartFormFieldRequest build(); - - _FinalStage encoding(Optional encoding); - - _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); - - _FinalStage fileName(Optional fileName); - - _FinalStage fileName(String fileName); - - _FinalStage contentType(Optional contentType); - - _FinalStage contentType(String contentType); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DataStage, _FinalStage { - private String name; - - private String data; - - private Optional contentType = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional encoding = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MultipartFormFieldRequest other) { - name(other.getName()); - data(other.getData()); - encoding(other.getEncoding()); - fileName(other.getFileName()); - contentType(other.getContentType()); - return this; - } - - /** - *

The name of the form field

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public DataStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

The data for the form field.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull String data) { - this.data = data; - return this; - } - - /** - *

The MIME type of the file, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public _FinalStage contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - /** - *

The file name of the form field, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public _FinalStage fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - /** - *

The encoding of the value of data. Defaults to RAW if not defined.

- *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { - this.encoding = Optional.ofNullable(encoding); - return this; - } - - @java.lang.Override - @JsonSetter(value = "encoding", nulls = Nulls.SKIP) - public _FinalStage encoding(Optional encoding) { - this.encoding = encoding; - return this; - } - - @java.lang.Override - public MultipartFormFieldRequest build() { - return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/resources/hris/types/MultipartFormFieldRequestEncoding.java deleted file mode 100644 index 0346026a6..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/MultipartFormFieldRequestEncoding.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) -public final class MultipartFormFieldRequestEncoding { - private final Object value; - - private final int type; - - private MultipartFormFieldRequestEncoding(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EncodingEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); - } - - private boolean equalTo(MultipartFormFieldRequestEncoding other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { - return new MultipartFormFieldRequestEncoding(value, 0); - } - - public static MultipartFormFieldRequestEncoding of(String value) { - return new MultipartFormFieldRequestEncoding(value, 1); - } - - public interface Visitor { - T visit(EncodingEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MultipartFormFieldRequestEncoding.class); - } - - @java.lang.Override - public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/resources/hris/types/PaginatedAccountDetailsAndActionsList.java deleted file mode 100644 index dc271fa56..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedAccountDetailsAndActionsList.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) -public final class PaginatedAccountDetailsAndActionsList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountDetailsAndActionsList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountDetailsAndActionsList - && equalTo((PaginatedAccountDetailsAndActionsList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountDetailsAndActionsList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountDetailsAndActionsList build() { - return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/resources/hris/types/PaginatedAuditLogEventList.java deleted file mode 100644 index bdd19d5b0..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedAuditLogEventList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) -public final class PaginatedAuditLogEventList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAuditLogEventList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAuditLogEventList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAuditLogEventList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAuditLogEventList build() { - return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmployeeList.java b/src/main/java/com/merge/api/resources/hris/types/PaginatedEmployeeList.java deleted file mode 100644 index 2e70aa331..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedEmployeeList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedEmployeeList.Builder.class) -public final class PaginatedEmployeeList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedEmployeeList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedEmployeeList && equalTo((PaginatedEmployeeList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedEmployeeList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedEmployeeList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedEmployeeList build() { - return new PaginatedEmployeeList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedGroupList.java b/src/main/java/com/merge/api/resources/hris/types/PaginatedGroupList.java deleted file mode 100644 index 4f381136d..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedGroupList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedGroupList.Builder.class) -public final class PaginatedGroupList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedGroupList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedGroupList && equalTo((PaginatedGroupList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedGroupList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedGroupList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedGroupList build() { - return new PaginatedGroupList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedIssueList.java b/src/main/java/com/merge/api/resources/hris/types/PaginatedIssueList.java deleted file mode 100644 index 4b73d4c4e..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedIssueList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedIssueList.Builder.class) -public final class PaginatedIssueList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedIssueList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedIssueList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedIssueList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedIssueList build() { - return new PaginatedIssueList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/resources/hris/types/PaginatedSyncStatusList.java deleted file mode 100644 index 6097dd931..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedSyncStatusList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) -public final class PaginatedSyncStatusList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedSyncStatusList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedSyncStatusList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedSyncStatusList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedSyncStatusList build() { - return new PaginatedSyncStatusList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PaginatedTeamList.java b/src/main/java/com/merge/api/resources/hris/types/PaginatedTeamList.java deleted file mode 100644 index fadee4dfa..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PaginatedTeamList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedTeamList.Builder.class) -public final class PaginatedTeamList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedTeamList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedTeamList && equalTo((PaginatedTeamList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedTeamList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedTeamList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedTeamList build() { - return new PaginatedTeamList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PayrollRunRunState.java b/src/main/java/com/merge/api/resources/hris/types/PayrollRunRunState.java deleted file mode 100644 index f658b684d..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PayrollRunRunState.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PayrollRunRunState.Deserializer.class) -public final class PayrollRunRunState { - private final Object value; - - private final int type; - - private PayrollRunRunState(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RunStateEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PayrollRunRunState && equalTo((PayrollRunRunState) other); - } - - private boolean equalTo(PayrollRunRunState other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PayrollRunRunState of(RunStateEnum value) { - return new PayrollRunRunState(value, 0); - } - - public static PayrollRunRunState of(String value) { - return new PayrollRunRunState(value, 1); - } - - public interface Visitor { - T visit(RunStateEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PayrollRunRunState.class); - } - - @java.lang.Override - public PayrollRunRunState deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RunStateEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/PayrollRunRunType.java b/src/main/java/com/merge/api/resources/hris/types/PayrollRunRunType.java deleted file mode 100644 index eddffba51..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/PayrollRunRunType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PayrollRunRunType.Deserializer.class) -public final class PayrollRunRunType { - private final Object value; - - private final int type; - - private PayrollRunRunType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RunTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PayrollRunRunType && equalTo((PayrollRunRunType) other); - } - - private boolean equalTo(PayrollRunRunType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PayrollRunRunType of(RunTypeEnum value) { - return new PayrollRunRunType(value, 0); - } - - public static PayrollRunRunType of(String value) { - return new PayrollRunRunType(value, 1); - } - - public interface Visitor { - T visit(RunTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PayrollRunRunType.class); - } - - @java.lang.Override - public PayrollRunRunType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RunTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ReasonEnum.java b/src/main/java/com/merge/api/resources/hris/types/ReasonEnum.java deleted file mode 100644 index 4d39f9cfa..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ReasonEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ReasonEnum { - GENERAL_CUSTOMER_REQUEST("GENERAL_CUSTOMER_REQUEST"), - - GDPR("GDPR"), - - OTHER("OTHER"); - - private final String value; - - ReasonEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteData.java b/src/main/java/com/merge/api/resources/hris/types/RemoteData.java deleted file mode 100644 index 24e1f3b7a..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteData.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteData.Builder.class) -public final class RemoteData { - private final String path; - - private final Optional data; - - private final Map additionalProperties; - - private RemoteData(String path, Optional data, Map additionalProperties) { - this.path = path; - this.data = data; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API path that is being called. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("data") - public Optional getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteData && equalTo((RemoteData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteData other) { - return path.equals(other.path) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.path, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PathStage builder() { - return new Builder(); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - - Builder from(RemoteData other); - } - - public interface _FinalStage { - RemoteData build(); - - _FinalStage data(Optional data); - - _FinalStage data(JsonNode data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PathStage, _FinalStage { - private String path; - - private Optional data = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteData other) { - path(other.getPath()); - data(other.getData()); - return this; - } - - /** - *

The third-party API path that is being called.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - public _FinalStage data(JsonNode data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - @java.lang.Override - public RemoteData build() { - return new RemoteData(path, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/hris/types/RemoteEndpointInfo.java deleted file mode 100644 index 3c4551bae..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteEndpointInfo.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) -public final class RemoteEndpointInfo { - private final String method; - - private final String urlPath; - - private final List fieldTraversalPath; - - private final Map additionalProperties; - - private RemoteEndpointInfo( - String method, - String urlPath, - List fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("url_path") - public String getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public List getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - UrlPathStage method(@NotNull String method); - - Builder from(RemoteEndpointInfo other); - } - - public interface UrlPathStage { - _FinalStage urlPath(@NotNull String urlPath); - } - - public interface _FinalStage { - RemoteEndpointInfo build(); - - _FinalStage fieldTraversalPath(List fieldTraversalPath); - - _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); - - _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { - private String method; - - private String urlPath; - - private List fieldTraversalPath = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public UrlPathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("url_path") - public _FinalStage urlPath(@NotNull String urlPath) { - this.urlPath = urlPath; - return this; - } - - @java.lang.Override - public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { - this.fieldTraversalPath.add(fieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.clear(); - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public RemoteEndpointInfo build() { - return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApi.java b/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApi.java deleted file mode 100644 index 9b986cc20..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApi.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApi.Builder.class) -public final class RemoteFieldApi { - private final Map schema; - - private final String remoteKeyName; - - private final RemoteEndpointInfo remoteEndpointInfo; - - private final Optional> exampleValues; - - private final Optional advancedMetadata; - - private final Optional coverage; - - private final Map additionalProperties; - - private RemoteFieldApi( - Map schema, - String remoteKeyName, - RemoteEndpointInfo remoteEndpointInfo, - Optional> exampleValues, - Optional advancedMetadata, - Optional coverage, - Map additionalProperties) { - this.schema = schema; - this.remoteKeyName = remoteKeyName; - this.remoteEndpointInfo = remoteEndpointInfo; - this.exampleValues = exampleValues; - this.advancedMetadata = advancedMetadata; - this.coverage = coverage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("schema") - public Map getSchema() { - return schema; - } - - @JsonProperty("remote_key_name") - public String getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("remote_endpoint_info") - public RemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @JsonProperty("example_values") - public Optional> getExampleValues() { - return exampleValues; - } - - @JsonProperty("advanced_metadata") - public Optional getAdvancedMetadata() { - return advancedMetadata; - } - - @JsonProperty("coverage") - public Optional getCoverage() { - return coverage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApi other) { - return schema.equals(other.schema) - && remoteKeyName.equals(other.remoteKeyName) - && remoteEndpointInfo.equals(other.remoteEndpointInfo) - && exampleValues.equals(other.exampleValues) - && advancedMetadata.equals(other.advancedMetadata) - && coverage.equals(other.coverage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.schema, - this.remoteKeyName, - this.remoteEndpointInfo, - this.exampleValues, - this.advancedMetadata, - this.coverage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteKeyNameStage builder() { - return new Builder(); - } - - public interface RemoteKeyNameStage { - RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); - - Builder from(RemoteFieldApi other); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); - } - - public interface _FinalStage { - RemoteFieldApi build(); - - _FinalStage schema(Map schema); - - _FinalStage putAllSchema(Map schema); - - _FinalStage schema(String key, JsonNode value); - - _FinalStage exampleValues(Optional> exampleValues); - - _FinalStage exampleValues(List exampleValues); - - _FinalStage advancedMetadata(Optional advancedMetadata); - - _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); - - _FinalStage coverage(Optional coverage); - - _FinalStage coverage(RemoteFieldApiCoverage coverage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { - private String remoteKeyName; - - private RemoteEndpointInfo remoteEndpointInfo; - - private Optional coverage = Optional.empty(); - - private Optional advancedMetadata = Optional.empty(); - - private Optional> exampleValues = Optional.empty(); - - private Map schema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldApi other) { - schema(other.getSchema()); - remoteKeyName(other.getRemoteKeyName()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - exampleValues(other.getExampleValues()); - advancedMetadata(other.getAdvancedMetadata()); - coverage(other.getCoverage()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_key_name") - public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage coverage(RemoteFieldApiCoverage coverage) { - this.coverage = Optional.ofNullable(coverage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "coverage", nulls = Nulls.SKIP) - public _FinalStage coverage(Optional coverage) { - this.coverage = coverage; - return this; - } - - @java.lang.Override - public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { - this.advancedMetadata = Optional.ofNullable(advancedMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) - public _FinalStage advancedMetadata(Optional advancedMetadata) { - this.advancedMetadata = advancedMetadata; - return this; - } - - @java.lang.Override - public _FinalStage exampleValues(List exampleValues) { - this.exampleValues = Optional.ofNullable(exampleValues); - return this; - } - - @java.lang.Override - @JsonSetter(value = "example_values", nulls = Nulls.SKIP) - public _FinalStage exampleValues(Optional> exampleValues) { - this.exampleValues = exampleValues; - return this; - } - - @java.lang.Override - public _FinalStage schema(String key, JsonNode value) { - this.schema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllSchema(Map schema) { - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Map schema) { - this.schema.clear(); - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - public RemoteFieldApi build() { - return new RemoteFieldApi( - schema, - remoteKeyName, - remoteEndpointInfo, - exampleValues, - advancedMetadata, - coverage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApiCoverage.java deleted file mode 100644 index 936ccbcfd..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApiCoverage.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) -public final class RemoteFieldApiCoverage { - private final Object value; - - private final int type; - - private RemoteFieldApiCoverage(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((int) this.value); - } else if (this.type == 1) { - return visitor.visit((double) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); - } - - private boolean equalTo(RemoteFieldApiCoverage other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldApiCoverage of(int value) { - return new RemoteFieldApiCoverage(value, 0); - } - - public static RemoteFieldApiCoverage of(double value) { - return new RemoteFieldApiCoverage(value, 1); - } - - public interface Visitor { - T visit(int value); - - T visit(double value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldApiCoverage.class); - } - - @java.lang.Override - public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - if (value instanceof Integer) { - return of((Integer) value); - } - if (value instanceof Double) { - return of((Double) value); - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApiResponse.java deleted file mode 100644 index 06201c78b..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteFieldApiResponse.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) -public final class RemoteFieldApiResponse { - private final Optional> benefit; - - private final Optional> employerBenefit; - - private final Optional> company; - - private final Optional> employeePayrollRun; - - private final Optional> employee; - - private final Optional> employment; - - private final Optional> location; - - private final Optional> payrollRun; - - private final Optional> team; - - private final Optional> timeOff; - - private final Optional> timeOffBalance; - - private final Optional> bankInfo; - - private final Optional> payGroup; - - private final Optional> group; - - private final Optional> dependent; - - private final Optional> timesheetEntry; - - private final Map additionalProperties; - - private RemoteFieldApiResponse( - Optional> benefit, - Optional> employerBenefit, - Optional> company, - Optional> employeePayrollRun, - Optional> employee, - Optional> employment, - Optional> location, - Optional> payrollRun, - Optional> team, - Optional> timeOff, - Optional> timeOffBalance, - Optional> bankInfo, - Optional> payGroup, - Optional> group, - Optional> dependent, - Optional> timesheetEntry, - Map additionalProperties) { - this.benefit = benefit; - this.employerBenefit = employerBenefit; - this.company = company; - this.employeePayrollRun = employeePayrollRun; - this.employee = employee; - this.employment = employment; - this.location = location; - this.payrollRun = payrollRun; - this.team = team; - this.timeOff = timeOff; - this.timeOffBalance = timeOffBalance; - this.bankInfo = bankInfo; - this.payGroup = payGroup; - this.group = group; - this.dependent = dependent; - this.timesheetEntry = timesheetEntry; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Benefit") - public Optional> getBenefit() { - return benefit; - } - - @JsonProperty("EmployerBenefit") - public Optional> getEmployerBenefit() { - return employerBenefit; - } - - @JsonProperty("Company") - public Optional> getCompany() { - return company; - } - - @JsonProperty("EmployeePayrollRun") - public Optional> getEmployeePayrollRun() { - return employeePayrollRun; - } - - @JsonProperty("Employee") - public Optional> getEmployee() { - return employee; - } - - @JsonProperty("Employment") - public Optional> getEmployment() { - return employment; - } - - @JsonProperty("Location") - public Optional> getLocation() { - return location; - } - - @JsonProperty("PayrollRun") - public Optional> getPayrollRun() { - return payrollRun; - } - - @JsonProperty("Team") - public Optional> getTeam() { - return team; - } - - @JsonProperty("TimeOff") - public Optional> getTimeOff() { - return timeOff; - } - - @JsonProperty("TimeOffBalance") - public Optional> getTimeOffBalance() { - return timeOffBalance; - } - - @JsonProperty("BankInfo") - public Optional> getBankInfo() { - return bankInfo; - } - - @JsonProperty("PayGroup") - public Optional> getPayGroup() { - return payGroup; - } - - @JsonProperty("Group") - public Optional> getGroup() { - return group; - } - - @JsonProperty("Dependent") - public Optional> getDependent() { - return dependent; - } - - @JsonProperty("TimesheetEntry") - public Optional> getTimesheetEntry() { - return timesheetEntry; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApiResponse other) { - return benefit.equals(other.benefit) - && employerBenefit.equals(other.employerBenefit) - && company.equals(other.company) - && employeePayrollRun.equals(other.employeePayrollRun) - && employee.equals(other.employee) - && employment.equals(other.employment) - && location.equals(other.location) - && payrollRun.equals(other.payrollRun) - && team.equals(other.team) - && timeOff.equals(other.timeOff) - && timeOffBalance.equals(other.timeOffBalance) - && bankInfo.equals(other.bankInfo) - && payGroup.equals(other.payGroup) - && group.equals(other.group) - && dependent.equals(other.dependent) - && timesheetEntry.equals(other.timesheetEntry); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.benefit, - this.employerBenefit, - this.company, - this.employeePayrollRun, - this.employee, - this.employment, - this.location, - this.payrollRun, - this.team, - this.timeOff, - this.timeOffBalance, - this.bankInfo, - this.payGroup, - this.group, - this.dependent, - this.timesheetEntry); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> benefit = Optional.empty(); - - private Optional> employerBenefit = Optional.empty(); - - private Optional> company = Optional.empty(); - - private Optional> employeePayrollRun = Optional.empty(); - - private Optional> employee = Optional.empty(); - - private Optional> employment = Optional.empty(); - - private Optional> location = Optional.empty(); - - private Optional> payrollRun = Optional.empty(); - - private Optional> team = Optional.empty(); - - private Optional> timeOff = Optional.empty(); - - private Optional> timeOffBalance = Optional.empty(); - - private Optional> bankInfo = Optional.empty(); - - private Optional> payGroup = Optional.empty(); - - private Optional> group = Optional.empty(); - - private Optional> dependent = Optional.empty(); - - private Optional> timesheetEntry = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldApiResponse other) { - benefit(other.getBenefit()); - employerBenefit(other.getEmployerBenefit()); - company(other.getCompany()); - employeePayrollRun(other.getEmployeePayrollRun()); - employee(other.getEmployee()); - employment(other.getEmployment()); - location(other.getLocation()); - payrollRun(other.getPayrollRun()); - team(other.getTeam()); - timeOff(other.getTimeOff()); - timeOffBalance(other.getTimeOffBalance()); - bankInfo(other.getBankInfo()); - payGroup(other.getPayGroup()); - group(other.getGroup()); - dependent(other.getDependent()); - timesheetEntry(other.getTimesheetEntry()); - return this; - } - - @JsonSetter(value = "Benefit", nulls = Nulls.SKIP) - public Builder benefit(Optional> benefit) { - this.benefit = benefit; - return this; - } - - public Builder benefit(List benefit) { - this.benefit = Optional.ofNullable(benefit); - return this; - } - - @JsonSetter(value = "EmployerBenefit", nulls = Nulls.SKIP) - public Builder employerBenefit(Optional> employerBenefit) { - this.employerBenefit = employerBenefit; - return this; - } - - public Builder employerBenefit(List employerBenefit) { - this.employerBenefit = Optional.ofNullable(employerBenefit); - return this; - } - - @JsonSetter(value = "Company", nulls = Nulls.SKIP) - public Builder company(Optional> company) { - this.company = company; - return this; - } - - public Builder company(List company) { - this.company = Optional.ofNullable(company); - return this; - } - - @JsonSetter(value = "EmployeePayrollRun", nulls = Nulls.SKIP) - public Builder employeePayrollRun(Optional> employeePayrollRun) { - this.employeePayrollRun = employeePayrollRun; - return this; - } - - public Builder employeePayrollRun(List employeePayrollRun) { - this.employeePayrollRun = Optional.ofNullable(employeePayrollRun); - return this; - } - - @JsonSetter(value = "Employee", nulls = Nulls.SKIP) - public Builder employee(Optional> employee) { - this.employee = employee; - return this; - } - - public Builder employee(List employee) { - this.employee = Optional.ofNullable(employee); - return this; - } - - @JsonSetter(value = "Employment", nulls = Nulls.SKIP) - public Builder employment(Optional> employment) { - this.employment = employment; - return this; - } - - public Builder employment(List employment) { - this.employment = Optional.ofNullable(employment); - return this; - } - - @JsonSetter(value = "Location", nulls = Nulls.SKIP) - public Builder location(Optional> location) { - this.location = location; - return this; - } - - public Builder location(List location) { - this.location = Optional.ofNullable(location); - return this; - } - - @JsonSetter(value = "PayrollRun", nulls = Nulls.SKIP) - public Builder payrollRun(Optional> payrollRun) { - this.payrollRun = payrollRun; - return this; - } - - public Builder payrollRun(List payrollRun) { - this.payrollRun = Optional.ofNullable(payrollRun); - return this; - } - - @JsonSetter(value = "Team", nulls = Nulls.SKIP) - public Builder team(Optional> team) { - this.team = team; - return this; - } - - public Builder team(List team) { - this.team = Optional.ofNullable(team); - return this; - } - - @JsonSetter(value = "TimeOff", nulls = Nulls.SKIP) - public Builder timeOff(Optional> timeOff) { - this.timeOff = timeOff; - return this; - } - - public Builder timeOff(List timeOff) { - this.timeOff = Optional.ofNullable(timeOff); - return this; - } - - @JsonSetter(value = "TimeOffBalance", nulls = Nulls.SKIP) - public Builder timeOffBalance(Optional> timeOffBalance) { - this.timeOffBalance = timeOffBalance; - return this; - } - - public Builder timeOffBalance(List timeOffBalance) { - this.timeOffBalance = Optional.ofNullable(timeOffBalance); - return this; - } - - @JsonSetter(value = "BankInfo", nulls = Nulls.SKIP) - public Builder bankInfo(Optional> bankInfo) { - this.bankInfo = bankInfo; - return this; - } - - public Builder bankInfo(List bankInfo) { - this.bankInfo = Optional.ofNullable(bankInfo); - return this; - } - - @JsonSetter(value = "PayGroup", nulls = Nulls.SKIP) - public Builder payGroup(Optional> payGroup) { - this.payGroup = payGroup; - return this; - } - - public Builder payGroup(List payGroup) { - this.payGroup = Optional.ofNullable(payGroup); - return this; - } - - @JsonSetter(value = "Group", nulls = Nulls.SKIP) - public Builder group(Optional> group) { - this.group = group; - return this; - } - - public Builder group(List group) { - this.group = Optional.ofNullable(group); - return this; - } - - @JsonSetter(value = "Dependent", nulls = Nulls.SKIP) - public Builder dependent(Optional> dependent) { - this.dependent = dependent; - return this; - } - - public Builder dependent(List dependent) { - this.dependent = Optional.ofNullable(dependent); - return this; - } - - @JsonSetter(value = "TimesheetEntry", nulls = Nulls.SKIP) - public Builder timesheetEntry(Optional> timesheetEntry) { - this.timesheetEntry = timesheetEntry; - return this; - } - - public Builder timesheetEntry(List timesheetEntry) { - this.timesheetEntry = Optional.ofNullable(timesheetEntry); - return this; - } - - public RemoteFieldApiResponse build() { - return new RemoteFieldApiResponse( - benefit, - employerBenefit, - company, - employeePayrollRun, - employee, - employment, - location, - payrollRun, - team, - timeOff, - timeOffBalance, - bankInfo, - payGroup, - group, - dependent, - timesheetEntry, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteKey.java b/src/main/java/com/merge/api/resources/hris/types/RemoteKey.java deleted file mode 100644 index 12d979574..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteKey.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKey.Builder.class) -public final class RemoteKey { - private final String name; - - private final String key; - - private final Map additionalProperties; - - private RemoteKey(String name, String key, Map additionalProperties) { - this.name = name; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("key") - public String getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKey && equalTo((RemoteKey) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKey other) { - return name.equals(other.name) && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - KeyStage name(@NotNull String name); - - Builder from(RemoteKey other); - } - - public interface KeyStage { - _FinalStage key(@NotNull String key); - } - - public interface _FinalStage { - RemoteKey build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, KeyStage, _FinalStage { - private String name; - - private String key; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKey other) { - name(other.getName()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public KeyStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("key") - public _FinalStage key(@NotNull String key) { - this.key = key; - return this; - } - - @java.lang.Override - public RemoteKey build() { - return new RemoteKey(name, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteResponse.java b/src/main/java/com/merge/api/resources/hris/types/RemoteResponse.java deleted file mode 100644 index eb491f762..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteResponse.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteResponse.Builder.class) -public final class RemoteResponse { - private final String method; - - private final String path; - - private final int status; - - private final JsonNode response; - - private final Optional> responseHeaders; - - private final Optional responseType; - - private final Optional> headers; - - private final Map additionalProperties; - - private RemoteResponse( - String method, - String path, - int status, - JsonNode response, - Optional> responseHeaders, - Optional responseType, - Optional> headers, - Map additionalProperties) { - this.method = method; - this.path = path; - this.status = status; - this.response = response; - this.responseHeaders = responseHeaders; - this.responseType = responseType; - this.headers = headers; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("status") - public int getStatus() { - return status; - } - - @JsonProperty("response") - public JsonNode getResponse() { - return response; - } - - @JsonProperty("response_headers") - public Optional> getResponseHeaders() { - return responseHeaders; - } - - @JsonProperty("response_type") - public Optional getResponseType() { - return responseType; - } - - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponse && equalTo((RemoteResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteResponse other) { - return method.equals(other.method) - && path.equals(other.path) - && status == other.status - && response.equals(other.response) - && responseHeaders.equals(other.responseHeaders) - && responseType.equals(other.responseType) - && headers.equals(other.headers); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.status, - this.response, - this.responseHeaders, - this.responseType, - this.headers); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull String method); - - Builder from(RemoteResponse other); - } - - public interface PathStage { - StatusStage path(@NotNull String path); - } - - public interface StatusStage { - ResponseStage status(int status); - } - - public interface ResponseStage { - _FinalStage response(@NotNull JsonNode response); - } - - public interface _FinalStage { - RemoteResponse build(); - - _FinalStage responseHeaders(Optional> responseHeaders); - - _FinalStage responseHeaders(Map responseHeaders); - - _FinalStage responseType(Optional responseType); - - _FinalStage responseType(RemoteResponseResponseType responseType); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { - private String method; - - private String path; - - private int status; - - private JsonNode response; - - private Optional> headers = Optional.empty(); - - private Optional responseType = Optional.empty(); - - private Optional> responseHeaders = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteResponse other) { - method(other.getMethod()); - path(other.getPath()); - status(other.getStatus()); - response(other.getResponse()); - responseHeaders(other.getResponseHeaders()); - responseType(other.getResponseType()); - headers(other.getHeaders()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("path") - public StatusStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public ResponseStage status(int status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("response") - public _FinalStage response(@NotNull JsonNode response) { - this.response = response; - return this; - } - - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - @java.lang.Override - public _FinalStage responseType(RemoteResponseResponseType responseType) { - this.responseType = Optional.ofNullable(responseType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_type", nulls = Nulls.SKIP) - public _FinalStage responseType(Optional responseType) { - this.responseType = responseType; - return this; - } - - @java.lang.Override - public _FinalStage responseHeaders(Map responseHeaders) { - this.responseHeaders = Optional.ofNullable(responseHeaders); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) - public _FinalStage responseHeaders(Optional> responseHeaders) { - this.responseHeaders = responseHeaders; - return this; - } - - @java.lang.Override - public RemoteResponse build() { - return new RemoteResponse( - method, path, status, response, responseHeaders, responseType, headers, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RemoteResponseResponseType.java b/src/main/java/com/merge/api/resources/hris/types/RemoteResponseResponseType.java deleted file mode 100644 index e872b9f05..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RemoteResponseResponseType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteResponseResponseType.Deserializer.class) -public final class RemoteResponseResponseType { - private final Object value; - - private final int type; - - private RemoteResponseResponseType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((ResponseTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponseResponseType && equalTo((RemoteResponseResponseType) other); - } - - private boolean equalTo(RemoteResponseResponseType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteResponseResponseType of(ResponseTypeEnum value) { - return new RemoteResponseResponseType(value, 0); - } - - public static RemoteResponseResponseType of(String value) { - return new RemoteResponseResponseType(value, 1); - } - - public interface Visitor { - T visit(ResponseTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteResponseResponseType.class); - } - - @java.lang.Override - public RemoteResponseResponseType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, ResponseTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RequestFormatEnum.java b/src/main/java/com/merge/api/resources/hris/types/RequestFormatEnum.java deleted file mode 100644 index b16b39ca9..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RequestFormatEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RequestFormatEnum { - JSON("JSON"), - - XML("XML"), - - MULTIPART("MULTIPART"); - - private final String value; - - RequestFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/resources/hris/types/ResponseTypeEnum.java deleted file mode 100644 index 86366e6e1..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ResponseTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ResponseTypeEnum { - JSON("JSON"), - - BASE_64_GZIP("BASE64_GZIP"); - - private final String value; - - ResponseTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/RoleEnum.java b/src/main/java/com/merge/api/resources/hris/types/RoleEnum.java deleted file mode 100644 index 73d4d56a2..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/RoleEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RoleEnum { - ADMIN("ADMIN"), - - DEVELOPER("DEVELOPER"), - - MEMBER("MEMBER"), - - API("API"), - - SYSTEM("SYSTEM"), - - MERGE_TEAM("MERGE_TEAM"); - - private final String value; - - RoleEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/resources/hris/types/SelectiveSyncConfigurationsUsageEnum.java deleted file mode 100644 index f4de18b8c..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/SelectiveSyncConfigurationsUsageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SelectiveSyncConfigurationsUsageEnum { - IN_NEXT_SYNC("IN_NEXT_SYNC"), - - IN_LAST_SYNC("IN_LAST_SYNC"); - - private final String value; - - SelectiveSyncConfigurationsUsageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/SyncStatus.java b/src/main/java/com/merge/api/resources/hris/types/SyncStatus.java deleted file mode 100644 index c94ff32c8..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/SyncStatus.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatus.Builder.class) -public final class SyncStatus { - private final String modelName; - - private final String modelId; - - private final Optional lastSyncStart; - - private final Optional nextSyncStart; - - private final SyncStatusStatusEnum status; - - private final boolean isInitialSync; - - private final Optional selectiveSyncConfigurationsUsage; - - private final Map additionalProperties; - - private SyncStatus( - String modelName, - String modelId, - Optional lastSyncStart, - Optional nextSyncStart, - SyncStatusStatusEnum status, - boolean isInitialSync, - Optional selectiveSyncConfigurationsUsage, - Map additionalProperties) { - this.modelName = modelName; - this.modelId = modelId; - this.lastSyncStart = lastSyncStart; - this.nextSyncStart = nextSyncStart; - this.status = status; - this.isInitialSync = isInitialSync; - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("last_sync_start") - public Optional getLastSyncStart() { - return lastSyncStart; - } - - @JsonProperty("next_sync_start") - public Optional getNextSyncStart() { - return nextSyncStart; - } - - @JsonProperty("status") - public SyncStatusStatusEnum getStatus() { - return status; - } - - @JsonProperty("is_initial_sync") - public boolean getIsInitialSync() { - return isInitialSync; - } - - @JsonProperty("selective_sync_configurations_usage") - public Optional getSelectiveSyncConfigurationsUsage() { - return selectiveSyncConfigurationsUsage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatus && equalTo((SyncStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatus other) { - return modelName.equals(other.modelName) - && modelId.equals(other.modelId) - && lastSyncStart.equals(other.lastSyncStart) - && nextSyncStart.equals(other.nextSyncStart) - && status.equals(other.status) - && isInitialSync == other.isInitialSync - && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, - this.modelId, - this.lastSyncStart, - this.nextSyncStart, - this.status, - this.isInitialSync, - this.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - ModelIdStage modelName(@NotNull String modelName); - - Builder from(SyncStatus other); - } - - public interface ModelIdStage { - StatusStage modelId(@NotNull String modelId); - } - - public interface StatusStage { - IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status); - } - - public interface IsInitialSyncStage { - _FinalStage isInitialSync(boolean isInitialSync); - } - - public interface _FinalStage { - SyncStatus build(); - - _FinalStage lastSyncStart(Optional lastSyncStart); - - _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); - - _FinalStage nextSyncStart(Optional nextSyncStart); - - _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); - - _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage); - - _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { - private String modelName; - - private String modelId; - - private SyncStatusStatusEnum status; - - private boolean isInitialSync; - - private Optional selectiveSyncConfigurationsUsage = Optional.empty(); - - private Optional nextSyncStart = Optional.empty(); - - private Optional lastSyncStart = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(SyncStatus other) { - modelName(other.getModelName()); - modelId(other.getModelId()); - lastSyncStart(other.getLastSyncStart()); - nextSyncStart(other.getNextSyncStart()); - status(other.getStatus()); - isInitialSync(other.getIsInitialSync()); - selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public ModelIdStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public StatusStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("is_initial_sync") - public _FinalStage isInitialSync(boolean isInitialSync) { - this.isInitialSync = isInitialSync; - return this; - } - - @java.lang.Override - public _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) - public _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - return this; - } - - @java.lang.Override - public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { - this.nextSyncStart = Optional.ofNullable(nextSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) - public _FinalStage nextSyncStart(Optional nextSyncStart) { - this.nextSyncStart = nextSyncStart; - return this; - } - - @java.lang.Override - public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { - this.lastSyncStart = Optional.ofNullable(lastSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) - public _FinalStage lastSyncStart(Optional lastSyncStart) { - this.lastSyncStart = lastSyncStart; - return this; - } - - @java.lang.Override - public SyncStatus build() { - return new SyncStatus( - modelName, - modelId, - lastSyncStart, - nextSyncStart, - status, - isInitialSync, - selectiveSyncConfigurationsUsage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/api/resources/hris/types/SyncStatusStatusEnum.java deleted file mode 100644 index e38b9a935..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/SyncStatusStatusEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SyncStatusStatusEnum { - SYNCING("SYNCING"), - - DONE("DONE"), - - FAILED("FAILED"), - - DISABLED("DISABLED"), - - PAUSED("PAUSED"), - - PARTIALLY_SYNCED("PARTIALLY_SYNCED"); - - private final String value; - - SyncStatusStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/Team.java b/src/main/java/com/merge/api/resources/hris/types/Team.java deleted file mode 100644 index 075a7b361..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/Team.java +++ /dev/null @@ -1,329 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Team.Builder.class) -public final class Team { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional parentTeam; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Team( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional parentTeam, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.parentTeam = parentTeam; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The team's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The team's parent team. - */ - @JsonProperty("parent_team") - public Optional getParentTeam() { - return parentTeam; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Team && equalTo((Team) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Team other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && parentTeam.equals(other.parentTeam) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.parentTeam, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional parentTeam = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Team other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - parentTeam(other.getParentTeam()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "parent_team", nulls = Nulls.SKIP) - public Builder parentTeam(Optional parentTeam) { - this.parentTeam = parentTeam; - return this; - } - - public Builder parentTeam(TeamParentTeam parentTeam) { - this.parentTeam = Optional.ofNullable(parentTeam); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Team build() { - return new Team( - id, - remoteId, - createdAt, - modifiedAt, - name, - parentTeam, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffBalancePolicyType.java b/src/main/java/com/merge/api/resources/hris/types/TimeOffBalancePolicyType.java deleted file mode 100644 index ca9efd7d6..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffBalancePolicyType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TimeOffBalancePolicyType.Deserializer.class) -public final class TimeOffBalancePolicyType { - private final Object value; - - private final int type; - - private TimeOffBalancePolicyType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PolicyTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffBalancePolicyType && equalTo((TimeOffBalancePolicyType) other); - } - - private boolean equalTo(TimeOffBalancePolicyType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TimeOffBalancePolicyType of(PolicyTypeEnum value) { - return new TimeOffBalancePolicyType(value, 0); - } - - public static TimeOffBalancePolicyType of(String value) { - return new TimeOffBalancePolicyType(value, 1); - } - - public interface Visitor { - T visit(PolicyTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TimeOffBalancePolicyType.class); - } - - @java.lang.Override - public TimeOffBalancePolicyType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PolicyTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestRequestType.java b/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestRequestType.java deleted file mode 100644 index 350839ecc..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestRequestType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TimeOffRequestRequestType.Deserializer.class) -public final class TimeOffRequestRequestType { - private final Object value; - - private final int type; - - private TimeOffRequestRequestType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RequestTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffRequestRequestType && equalTo((TimeOffRequestRequestType) other); - } - - private boolean equalTo(TimeOffRequestRequestType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TimeOffRequestRequestType of(RequestTypeEnum value) { - return new TimeOffRequestRequestType(value, 0); - } - - public static TimeOffRequestRequestType of(String value) { - return new TimeOffRequestRequestType(value, 1); - } - - public interface Visitor { - T visit(RequestTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TimeOffRequestRequestType.class); - } - - @java.lang.Override - public TimeOffRequestRequestType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RequestTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestStatus.java b/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestStatus.java deleted file mode 100644 index c2a26027c..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TimeOffRequestStatus.Deserializer.class) -public final class TimeOffRequestStatus { - private final Object value; - - private final int type; - - private TimeOffRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TimeOffStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffRequestStatus && equalTo((TimeOffRequestStatus) other); - } - - private boolean equalTo(TimeOffRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TimeOffRequestStatus of(TimeOffStatusEnum value) { - return new TimeOffRequestStatus(value, 0); - } - - public static TimeOffRequestStatus of(String value) { - return new TimeOffRequestStatus(value, 1); - } - - public interface Visitor { - T visit(TimeOffStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TimeOffRequestStatus.class); - } - - @java.lang.Override - public TimeOffRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TimeOffStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestType.java b/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestType.java deleted file mode 100644 index ee613f78c..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TimeOffRequestType.Deserializer.class) -public final class TimeOffRequestType { - private final Object value; - - private final int type; - - private TimeOffRequestType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RequestTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffRequestType && equalTo((TimeOffRequestType) other); - } - - private boolean equalTo(TimeOffRequestType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TimeOffRequestType of(RequestTypeEnum value) { - return new TimeOffRequestType(value, 0); - } - - public static TimeOffRequestType of(String value) { - return new TimeOffRequestType(value, 1); - } - - public interface Visitor { - T visit(RequestTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TimeOffRequestType.class); - } - - @java.lang.Override - public TimeOffRequestType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RequestTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestUnits.java b/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestUnits.java deleted file mode 100644 index 9f8ee4fc1..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffRequestUnits.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TimeOffRequestUnits.Deserializer.class) -public final class TimeOffRequestUnits { - private final Object value; - - private final int type; - - private TimeOffRequestUnits(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((UnitsEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffRequestUnits && equalTo((TimeOffRequestUnits) other); - } - - private boolean equalTo(TimeOffRequestUnits other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TimeOffRequestUnits of(UnitsEnum value) { - return new TimeOffRequestUnits(value, 0); - } - - public static TimeOffRequestUnits of(String value) { - return new TimeOffRequestUnits(value, 1); - } - - public interface Visitor { - T visit(UnitsEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TimeOffRequestUnits.class); - } - - @java.lang.Override - public TimeOffRequestUnits deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, UnitsEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffStatus.java b/src/main/java/com/merge/api/resources/hris/types/TimeOffStatus.java deleted file mode 100644 index f7fd5e889..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TimeOffStatus.Deserializer.class) -public final class TimeOffStatus { - private final Object value; - - private final int type; - - private TimeOffStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TimeOffStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffStatus && equalTo((TimeOffStatus) other); - } - - private boolean equalTo(TimeOffStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TimeOffStatus of(TimeOffStatusEnum value) { - return new TimeOffStatus(value, 0); - } - - public static TimeOffStatus of(String value) { - return new TimeOffStatus(value, 1); - } - - public interface Visitor { - T visit(TimeOffStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TimeOffStatus.class); - } - - @java.lang.Override - public TimeOffStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TimeOffStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/TimeOffUnits.java b/src/main/java/com/merge/api/resources/hris/types/TimeOffUnits.java deleted file mode 100644 index 08762d319..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/TimeOffUnits.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TimeOffUnits.Deserializer.class) -public final class TimeOffUnits { - private final Object value; - - private final int type; - - private TimeOffUnits(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((UnitsEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TimeOffUnits && equalTo((TimeOffUnits) other); - } - - private boolean equalTo(TimeOffUnits other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TimeOffUnits of(UnitsEnum value) { - return new TimeOffUnits(value, 0); - } - - public static TimeOffUnits of(String value) { - return new TimeOffUnits(value, 1); - } - - public interface Visitor { - T visit(UnitsEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TimeOffUnits.class); - } - - @java.lang.Override - public TimeOffUnits deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, UnitsEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/ValidationProblemSource.java b/src/main/java/com/merge/api/resources/hris/types/ValidationProblemSource.java deleted file mode 100644 index 7c25c7a10..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/ValidationProblemSource.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ValidationProblemSource.Builder.class) -public final class ValidationProblemSource { - private final String pointer; - - private final Map additionalProperties; - - private ValidationProblemSource(String pointer, Map additionalProperties) { - this.pointer = pointer; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("pointer") - public String getPointer() { - return pointer; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidationProblemSource other) { - return pointer.equals(other.pointer); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.pointer); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PointerStage builder() { - return new Builder(); - } - - public interface PointerStage { - _FinalStage pointer(@NotNull String pointer); - - Builder from(ValidationProblemSource other); - } - - public interface _FinalStage { - ValidationProblemSource build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PointerStage, _FinalStage { - private String pointer; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ValidationProblemSource other) { - pointer(other.getPointer()); - return this; - } - - @java.lang.Override - @JsonSetter("pointer") - public _FinalStage pointer(@NotNull String pointer) { - this.pointer = pointer; - return this; - } - - @java.lang.Override - public ValidationProblemSource build() { - return new ValidationProblemSource(pointer, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/WarningValidationProblem.java b/src/main/java/com/merge/api/resources/hris/types/WarningValidationProblem.java deleted file mode 100644 index 4cc33687c..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/WarningValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WarningValidationProblem.Builder.class) -public final class WarningValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private WarningValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WarningValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(WarningValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - WarningValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WarningValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public WarningValidationProblem build() { - return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/types/WebhookReceiver.java b/src/main/java/com/merge/api/resources/hris/types/WebhookReceiver.java deleted file mode 100644 index 1dcc315f3..000000000 --- a/src/main/java/com/merge/api/resources/hris/types/WebhookReceiver.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiver.Builder.class) -public final class WebhookReceiver { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiver( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiver other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiver other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiver build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiver other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiver build() { - return new WebhookReceiver(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/api/resources/hris/webhookreceivers/WebhookReceiversClient.java deleted file mode 100644 index 004fabb86..000000000 --- a/src/main/java/com/merge/api/resources/hris/webhookreceivers/WebhookReceiversClient.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.webhookreceivers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.hris.types.WebhookReceiver; -import com.merge.api.resources.hris.webhookreceivers.requests.WebhookReceiverRequest; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class WebhookReceiversClient { - protected final ClientOptions clientOptions; - - public WebhookReceiversClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list() { - return list(null); - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/webhook-receivers") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request) { - return create(request, null); - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("hris/v1/webhook-receivers") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), WebhookReceiver.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/hris/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/api/resources/hris/webhookreceivers/requests/WebhookReceiverRequest.java deleted file mode 100644 index 0d7a84ead..000000000 --- a/src/main/java/com/merge/api/resources/hris/webhookreceivers/requests/WebhookReceiverRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.hris.webhookreceivers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) -public final class WebhookReceiverRequest { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiverRequest( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiverRequest other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiverRequest other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiverRequest build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiverRequest other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiverRequest build() { - return new WebhookReceiverRequest(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/accountdetails/AccountDetailsClient.java b/src/main/java/com/merge/api/resources/ticketing/accountdetails/AccountDetailsClient.java deleted file mode 100644 index da38a1772..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/accountdetails/AccountDetailsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.accountdetails; - -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.ticketing.types.AccountDetails; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountDetailsClient { - protected final ClientOptions clientOptions; - - public AccountDetailsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve() { - return retrieve(null); - } - - /** - * Get details for a linked account. - */ - public AccountDetails retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/account-details") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountDetails.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/accounts/AccountsClient.java b/src/main/java/com/merge/api/resources/ticketing/accounts/AccountsClient.java deleted file mode 100644 index 64385b9bc..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/accounts/AccountsClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.accounts; - -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.ticketing.accounts.requests.AccountsListRequest; -import com.merge.api.resources.ticketing.accounts.requests.AccountsRetrieveRequest; -import com.merge.api.resources.ticketing.types.Account; -import com.merge.api.resources.ticketing.types.PaginatedAccountList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountsClient { - protected final ClientOptions clientOptions; - - public AccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list() { - return list(AccountsListRequest.builder().build()); - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list(AccountsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Account objects. - */ - public PaginatedAccountList list(AccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/accounts"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountList.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); - } - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id) { - return retrieve(id, AccountsRetrieveRequest.builder().build()); - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id, AccountsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Account object with the given id. - */ - public Account retrieve(String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/accounts") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Account.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/accounts/requests/AccountsListRequest.java b/src/main/java/com/merge/api/resources/ticketing/accounts/requests/AccountsListRequest.java deleted file mode 100644 index 5d71bb1db..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/accounts/requests/AccountsListRequest.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.accounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsListRequest.Builder.class) -public final class AccountsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private AccountsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public AccountsListRequest build() { - return new AccountsListRequest( - createdAfter, - createdBefore, - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/accounts/requests/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/accounts/requests/AccountsRetrieveRequest.java deleted file mode 100644 index 279a7d031..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/accounts/requests/AccountsRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.accounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) -public final class AccountsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private AccountsRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public AccountsRetrieveRequest build() { - return new AccountsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/accounttoken/AccountTokenClient.java b/src/main/java/com/merge/api/resources/ticketing/accounttoken/AccountTokenClient.java deleted file mode 100644 index 50d365fc5..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/accounttoken/AccountTokenClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.accounttoken; - -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.ticketing.types.AccountToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AccountTokenClient { - protected final ClientOptions clientOptions; - - public AccountTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken) { - return retrieve(publicToken, null); - } - - /** - * Returns the account token for the end user with the provided public token. - */ - public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/account-token") - .addPathSegment(publicToken) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AccountToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/asyncpassthrough/AsyncPassthroughClient.java b/src/main/java/com/merge/api/resources/ticketing/asyncpassthrough/AsyncPassthroughClient.java deleted file mode 100644 index e7dc575c6..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/asyncpassthrough/AsyncPassthroughClient.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.asyncpassthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.asyncpassthrough.types.AsyncPassthroughRetrieveResponse; -import com.merge.api.resources.ticketing.types.AsyncPassthroughReciept; -import com.merge.api.resources.ticketing.types.DataPassthroughRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AsyncPassthroughClient { - protected final ClientOptions clientOptions; - - public AsyncPassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Asynchronously pull data from an endpoint not currently supported by Merge. - */ - public AsyncPassthroughReciept create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/async-passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), AsyncPassthroughReciept.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); - } - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); - } - - /** - * Retrieves data from earlier async-passthrough POST request - */ - public AsyncPassthroughRetrieveResponse retrieve(String asyncPassthroughReceiptId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/async-passthrough") - .addPathSegment(asyncPassthroughReceiptId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AsyncPassthroughRetrieveResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/resources/ticketing/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java deleted file mode 100644 index b3ad1c8b3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/asyncpassthrough/types/AsyncPassthroughRetrieveResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.asyncpassthrough.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.types.RemoteResponse; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) -public final class AsyncPassthroughRetrieveResponse { - private final Object value; - - private final int type; - - private AsyncPassthroughRetrieveResponse(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RemoteResponse) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); - } - - private boolean equalTo(AsyncPassthroughRetrieveResponse other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { - return new AsyncPassthroughRetrieveResponse(value, 0); - } - - public static AsyncPassthroughRetrieveResponse of(String value) { - return new AsyncPassthroughRetrieveResponse(value, 1); - } - - public interface Visitor { - T visit(RemoteResponse value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AsyncPassthroughRetrieveResponse.class); - } - - @java.lang.Override - public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/attachments/AttachmentsClient.java b/src/main/java/com/merge/api/resources/ticketing/attachments/AttachmentsClient.java deleted file mode 100644 index 8c1dfe696..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/attachments/AttachmentsClient.java +++ /dev/null @@ -1,341 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.attachments; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.core.ResponseBodyInputStream; -import com.merge.api.resources.ticketing.attachments.requests.AttachmentsDownloadRetrieveRequest; -import com.merge.api.resources.ticketing.attachments.requests.AttachmentsListRequest; -import com.merge.api.resources.ticketing.attachments.requests.AttachmentsRetrieveRequest; -import com.merge.api.resources.ticketing.attachments.requests.TicketingAttachmentEndpointRequest; -import com.merge.api.resources.ticketing.types.Attachment; -import com.merge.api.resources.ticketing.types.MetaResponse; -import com.merge.api.resources.ticketing.types.PaginatedAttachmentList; -import com.merge.api.resources.ticketing.types.TicketingAttachmentResponse; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AttachmentsClient { - protected final ClientOptions clientOptions; - - public AttachmentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Attachment objects. - */ - public PaginatedAttachmentList list() { - return list(AttachmentsListRequest.builder().build()); - } - - /** - * Returns a list of Attachment objects. - */ - public PaginatedAttachmentList list(AttachmentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Attachment objects. - */ - public PaginatedAttachmentList list(AttachmentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/attachments"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "remote_created_after", - request.getRemoteCreatedAfter().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTicketId().isPresent()) { - httpUrl.addQueryParameter("ticket_id", request.getTicketId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAttachmentList.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); - } - } - - /** - * Creates an Attachment object with the given values. - */ - public TicketingAttachmentResponse create(TicketingAttachmentEndpointRequest request) { - return create(request, null); - } - - /** - * Creates an Attachment object with the given values. - */ - public TicketingAttachmentResponse create( - TicketingAttachmentEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/attachments"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TicketingAttachmentResponse.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); - } - } - - /** - * Returns an Attachment object with the given id. - */ - public Attachment retrieve(String id) { - return retrieve(id, AttachmentsRetrieveRequest.builder().build()); - } - - /** - * Returns an Attachment object with the given id. - */ - public Attachment retrieve(String id, AttachmentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns an Attachment object with the given id. - */ - public Attachment retrieve(String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/attachments") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Attachment.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); - } - } - - /** - * Returns the File content with the given id as a stream of bytes. - */ - public InputStream downloadRetrieve(String id) { - return downloadRetrieve(id, AttachmentsDownloadRetrieveRequest.builder().build()); - } - - /** - * Returns the File content with the given id as a stream of bytes. - */ - public InputStream downloadRetrieve(String id, AttachmentsDownloadRetrieveRequest request) { - return downloadRetrieve(id, request, null); - } - - /** - * Returns the File content with the given id as a stream of bytes. - */ - public InputStream downloadRetrieve( - String id, AttachmentsDownloadRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/attachments") - .addPathSegment(id) - .addPathSegments("download"); - if (request.getMimeType().isPresent()) { - httpUrl.addQueryParameter("mime_type", request.getMimeType().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json"); - Request okhttpRequest = _requestBuilder.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 new ResponseBodyInputStream(response); - } - 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); - } - } - - /** - * Returns metadata for TicketingAttachment POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for TicketingAttachment POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/attachments/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsDownloadRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsDownloadRetrieveRequest.java deleted file mode 100644 index a9e397e51..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsDownloadRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.attachments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentsDownloadRetrieveRequest.Builder.class) -public final class AttachmentsDownloadRetrieveRequest { - private final Optional mimeType; - - private final Map additionalProperties; - - private AttachmentsDownloadRetrieveRequest(Optional mimeType, Map additionalProperties) { - this.mimeType = mimeType; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. - */ - @JsonProperty("mime_type") - public Optional getMimeType() { - return mimeType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentsDownloadRetrieveRequest - && equalTo((AttachmentsDownloadRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentsDownloadRetrieveRequest other) { - return mimeType.equals(other.mimeType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.mimeType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional mimeType = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentsDownloadRetrieveRequest other) { - mimeType(other.getMimeType()); - return this; - } - - @JsonSetter(value = "mime_type", nulls = Nulls.SKIP) - public Builder mimeType(Optional mimeType) { - this.mimeType = mimeType; - return this; - } - - public Builder mimeType(String mimeType) { - this.mimeType = Optional.ofNullable(mimeType); - return this; - } - - public AttachmentsDownloadRetrieveRequest build() { - return new AttachmentsDownloadRetrieveRequest(mimeType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsListRequest.java b/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsListRequest.java deleted file mode 100644 index e499cfee7..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsListRequest.java +++ /dev/null @@ -1,452 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.attachments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentsListRequest.Builder.class) -public final class AttachmentsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteCreatedAfter; - - private final Optional remoteId; - - private final Optional ticketId; - - private final Map additionalProperties; - - private AttachmentsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteCreatedAfter, - Optional remoteId, - Optional ticketId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteCreatedAfter = remoteCreatedAfter; - this.remoteId = remoteId; - this.ticketId = ticketId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If provided, will only return attachments created in the third party platform after this datetime. - */ - @JsonProperty("remote_created_after") - public Optional getRemoteCreatedAfter() { - return remoteCreatedAfter; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return If provided, will only return comments for this ticket. - */ - @JsonProperty("ticket_id") - public Optional getTicketId() { - return ticketId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentsListRequest && equalTo((AttachmentsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteCreatedAfter.equals(other.remoteCreatedAfter) - && remoteId.equals(other.remoteId) - && ticketId.equals(other.ticketId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteCreatedAfter, - this.remoteId, - this.ticketId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteCreatedAfter = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional ticketId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteCreatedAfter(other.getRemoteCreatedAfter()); - remoteId(other.getRemoteId()); - ticketId(other.getTicketId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_created_after", nulls = Nulls.SKIP) - public Builder remoteCreatedAfter(Optional remoteCreatedAfter) { - this.remoteCreatedAfter = remoteCreatedAfter; - return this; - } - - public Builder remoteCreatedAfter(OffsetDateTime remoteCreatedAfter) { - this.remoteCreatedAfter = Optional.ofNullable(remoteCreatedAfter); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "ticket_id", nulls = Nulls.SKIP) - public Builder ticketId(Optional ticketId) { - this.ticketId = ticketId; - return this; - } - - public Builder ticketId(String ticketId) { - this.ticketId = Optional.ofNullable(ticketId); - return this; - } - - public AttachmentsListRequest build() { - return new AttachmentsListRequest( - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteCreatedAfter, - remoteId, - ticketId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsRetrieveRequest.java deleted file mode 100644 index a403f2974..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/attachments/requests/AttachmentsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.attachments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) -public final class AttachmentsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private AttachmentsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentsRetrieveRequest && equalTo((AttachmentsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public AttachmentsRetrieveRequest build() { - return new AttachmentsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/audittrail/AuditTrailClient.java b/src/main/java/com/merge/api/resources/ticketing/audittrail/AuditTrailClient.java deleted file mode 100644 index 05c1114a1..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/audittrail/AuditTrailClient.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.audittrail; - -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.ticketing.audittrail.requests.AuditTrailListRequest; -import com.merge.api.resources.ticketing.types.PaginatedAuditLogEventList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AuditTrailClient { - protected final ClientOptions clientOptions; - - public AuditTrailClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list() { - return list(AuditTrailListRequest.builder().build()); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request) { - return list(request, null); - } - - /** - * Gets a list of audit trail events. - */ - public PaginatedAuditLogEventList list(AuditTrailListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/audit-trail"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEventType().isPresent()) { - httpUrl.addQueryParameter("event_type", request.getEventType().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getUserEmail().isPresent()) { - httpUrl.addQueryParameter("user_email", request.getUserEmail().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAuditLogEventList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/audittrail/requests/AuditTrailListRequest.java b/src/main/java/com/merge/api/resources/ticketing/audittrail/requests/AuditTrailListRequest.java deleted file mode 100644 index 696f09e89..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/audittrail/requests/AuditTrailListRequest.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.audittrail.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) -public final class AuditTrailListRequest { - private final Optional cursor; - - private final Optional endDate; - - private final Optional eventType; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional userEmail; - - private final Map additionalProperties; - - private AuditTrailListRequest( - Optional cursor, - Optional endDate, - Optional eventType, - Optional pageSize, - Optional startDate, - Optional userEmail, - Map additionalProperties) { - this.cursor = cursor; - this.endDate = endDate; - this.eventType = eventType; - this.pageSize = pageSize; - this.startDate = startDate; - this.userEmail = userEmail; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include audit trail events that occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - /** - * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED - */ - @JsonProperty("event_type") - public Optional getEventType() { - return eventType; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include audit trail events that occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditTrailListRequest other) { - return cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && eventType.equals(other.eventType) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && userEmail.equals(other.userEmail); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional eventType = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AuditTrailListRequest other) { - cursor(other.getCursor()); - endDate(other.getEndDate()); - eventType(other.getEventType()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - userEmail(other.getUserEmail()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "event_type", nulls = Nulls.SKIP) - public Builder eventType(Optional eventType) { - this.eventType = eventType; - return this; - } - - public Builder eventType(String eventType) { - this.eventType = Optional.ofNullable(eventType); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public Builder userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - public Builder userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - public AuditTrailListRequest build() { - return new AuditTrailListRequest( - cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/availableactions/AvailableActionsClient.java b/src/main/java/com/merge/api/resources/ticketing/availableactions/AvailableActionsClient.java deleted file mode 100644 index 9ce48f8ab..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/availableactions/AvailableActionsClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.availableactions; - -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.ticketing.types.AvailableActions; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class AvailableActionsClient { - protected final ClientOptions clientOptions; - - public AvailableActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve() { - return retrieve(null); - } - - /** - * Returns a list of models and actions available for an account. - */ - public AvailableActions retrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/available-actions") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), AvailableActions.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/collections/CollectionsClient.java b/src/main/java/com/merge/api/resources/ticketing/collections/CollectionsClient.java deleted file mode 100644 index 2a06f63ba..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/collections/CollectionsClient.java +++ /dev/null @@ -1,194 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.collections; - -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.ticketing.collections.requests.CollectionsListRequest; -import com.merge.api.resources.ticketing.collections.requests.CollectionsRetrieveRequest; -import com.merge.api.resources.ticketing.types.Collection; -import com.merge.api.resources.ticketing.types.PaginatedCollectionList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CollectionsClient { - protected final ClientOptions clientOptions; - - public CollectionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Collection objects. - */ - public PaginatedCollectionList list() { - return list(CollectionsListRequest.builder().build()); - } - - /** - * Returns a list of Collection objects. - */ - public PaginatedCollectionList list(CollectionsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Collection objects. - */ - public PaginatedCollectionList list(CollectionsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/collections"); - if (request.getCollectionType().isPresent()) { - httpUrl.addQueryParameter( - "collection_type", request.getCollectionType().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getParentCollectionId().isPresent()) { - httpUrl.addQueryParameter( - "parent_collection_id", request.getParentCollectionId().get()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCollectionList.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); - } - } - - /** - * Returns a Collection object with the given id. - */ - public Collection retrieve(String id) { - return retrieve(id, CollectionsRetrieveRequest.builder().build()); - } - - /** - * Returns a Collection object with the given id. - */ - public Collection retrieve(String id, CollectionsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Collection object with the given id. - */ - public Collection retrieve(String id, CollectionsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/collections") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter("remote_fields", request.getRemoteFields().get()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Collection.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/collections/types/CollectionsListRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/collections/types/CollectionsListRequestExpand.java deleted file mode 100644 index 0122fd5f0..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/collections/types/CollectionsListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.collections.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CollectionsListRequestExpand { - PARENT_COLLECTION("parent_collection"), - - TEAMS("teams"), - - TEAMS_PARENT_COLLECTION("teams,parent_collection"); - - private final String value; - - CollectionsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/collections/types/CollectionsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/collections/types/CollectionsRetrieveRequestExpand.java deleted file mode 100644 index 9fd13b404..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/collections/types/CollectionsRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.collections.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CollectionsRetrieveRequestExpand { - PARENT_COLLECTION("parent_collection"), - - TEAMS("teams"), - - TEAMS_PARENT_COLLECTION("teams,parent_collection"); - - private final String value; - - CollectionsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/comments/CommentsClient.java b/src/main/java/com/merge/api/resources/ticketing/comments/CommentsClient.java deleted file mode 100644 index c446df77b..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/comments/CommentsClient.java +++ /dev/null @@ -1,284 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.comments; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.comments.requests.CommentEndpointRequest; -import com.merge.api.resources.ticketing.comments.requests.CommentsListRequest; -import com.merge.api.resources.ticketing.comments.requests.CommentsRetrieveRequest; -import com.merge.api.resources.ticketing.types.Comment; -import com.merge.api.resources.ticketing.types.CommentResponse; -import com.merge.api.resources.ticketing.types.MetaResponse; -import com.merge.api.resources.ticketing.types.PaginatedCommentList; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class CommentsClient { - protected final ClientOptions clientOptions; - - public CommentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Comment objects. - */ - public PaginatedCommentList list() { - return list(CommentsListRequest.builder().build()); - } - - /** - * Returns a list of Comment objects. - */ - public PaginatedCommentList list(CommentsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Comment objects. - */ - public PaginatedCommentList list(CommentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/comments"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "remote_created_after", - request.getRemoteCreatedAfter().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getTicketId().isPresent()) { - httpUrl.addQueryParameter("ticket_id", request.getTicketId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedCommentList.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); - } - } - - /** - * Creates a Comment object with the given values. - */ - public CommentResponse create(CommentEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Comment object with the given values. - */ - public CommentResponse create(CommentEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/comments"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), CommentResponse.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); - } - } - - /** - * Returns a Comment object with the given id. - */ - public Comment retrieve(String id) { - return retrieve(id, CommentsRetrieveRequest.builder().build()); - } - - /** - * Returns a Comment object with the given id. - */ - public Comment retrieve(String id, CommentsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Comment object with the given id. - */ - public Comment retrieve(String id, CommentsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/comments") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Comment.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); - } - } - - /** - * Returns metadata for Comment POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Comment POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/comments/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentsRetrieveRequest.java deleted file mode 100644 index 5ecf9eebd..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentsRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.comments.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.comments.types.CommentsRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommentsRetrieveRequest.Builder.class) -public final class CommentsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private CommentsRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommentsRetrieveRequest && equalTo((CommentsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommentsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CommentsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CommentsRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public CommentsRetrieveRequest build() { - return new CommentsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/comments/types/CommentsListRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/comments/types/CommentsListRequestExpand.java deleted file mode 100644 index 1179d62c8..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/comments/types/CommentsListRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.comments.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CommentsListRequestExpand { - CONTACT("contact"), - - CONTACT_TICKET("contact,ticket"), - - TICKET("ticket"), - - USER("user"), - - USER_CONTACT("user,contact"), - - USER_CONTACT_TICKET("user,contact,ticket"), - - USER_TICKET("user,ticket"); - - private final String value; - - CommentsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/comments/types/CommentsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/comments/types/CommentsRetrieveRequestExpand.java deleted file mode 100644 index 8b3b01d4b..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/comments/types/CommentsRetrieveRequestExpand.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.comments.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CommentsRetrieveRequestExpand { - CONTACT("contact"), - - CONTACT_TICKET("contact,ticket"), - - TICKET("ticket"), - - USER("user"), - - USER_CONTACT("user,contact"), - - USER_CONTACT_TICKET("user,contact,ticket"), - - USER_TICKET("user,ticket"); - - private final String value; - - CommentsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/contacts/ContactsClient.java b/src/main/java/com/merge/api/resources/ticketing/contacts/ContactsClient.java deleted file mode 100644 index f9cb502d9..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/contacts/ContactsClient.java +++ /dev/null @@ -1,276 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.contacts; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.contacts.requests.ContactsListRequest; -import com.merge.api.resources.ticketing.contacts.requests.ContactsRetrieveRequest; -import com.merge.api.resources.ticketing.contacts.requests.TicketingContactEndpointRequest; -import com.merge.api.resources.ticketing.types.Contact; -import com.merge.api.resources.ticketing.types.MetaResponse; -import com.merge.api.resources.ticketing.types.PaginatedContactList; -import com.merge.api.resources.ticketing.types.TicketingContactResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ContactsClient { - protected final ClientOptions clientOptions; - - public ContactsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list() { - return list(ContactsListRequest.builder().build()); - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list(ContactsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Contact objects. - */ - public PaginatedContactList list(ContactsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/contacts"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedContactList.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); - } - } - - /** - * Creates a Contact object with the given values. - */ - public TicketingContactResponse create(TicketingContactEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Contact object with the given values. - */ - public TicketingContactResponse create(TicketingContactEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/contacts"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TicketingContactResponse.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); - } - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id) { - return retrieve(id, ContactsRetrieveRequest.builder().build()); - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id, ContactsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Contact object with the given id. - */ - public Contact retrieve(String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/contacts") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Contact.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); - } - } - - /** - * Returns metadata for TicketingContact POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for TicketingContact POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/contacts/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/contacts/requests/ContactsListRequest.java b/src/main/java/com/merge/api/resources/ticketing/contacts/requests/ContactsListRequest.java deleted file mode 100644 index 03b185839..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/contacts/requests/ContactsListRequest.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsListRequest.Builder.class) -public final class ContactsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private ContactsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsListRequest && equalTo((ContactsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public ContactsListRequest build() { - return new ContactsListRequest( - createdAfter, - createdBefore, - cursor, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/contacts/requests/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/contacts/requests/ContactsRetrieveRequest.java deleted file mode 100644 index a3cdf3db4..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/contacts/requests/ContactsRetrieveRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.contacts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactsRetrieveRequest.Builder.class) -public final class ContactsRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private ContactsRetrieveRequest( - Optional expand, Optional includeRemoteData, Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactsRetrieveRequest && equalTo((ContactsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactsRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactsRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(String expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public ContactsRetrieveRequest build() { - return new ContactsRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/deleteaccount/DeleteAccountClient.java b/src/main/java/com/merge/api/resources/ticketing/deleteaccount/DeleteAccountClient.java deleted file mode 100644 index 5f4a41a25..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/deleteaccount/DeleteAccountClient.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.deleteaccount; - -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 java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class DeleteAccountClient { - protected final ClientOptions clientOptions; - - public DeleteAccountClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Delete a linked account. - */ - public void delete() { - delete(null); - } - - /** - * Delete a linked account. - */ - public void delete(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/delete-account") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .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; - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/FieldMappingClient.java b/src/main/java/com/merge/api/resources/ticketing/fieldmapping/FieldMappingClient.java deleted file mode 100644 index 2e245fd2e..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/FieldMappingClient.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.fieldmapping; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.fieldmapping.requests.CreateFieldMappingRequest; -import com.merge.api.resources.ticketing.fieldmapping.requests.FieldMappingsRetrieveRequest; -import com.merge.api.resources.ticketing.fieldmapping.requests.PatchedEditFieldMappingRequest; -import com.merge.api.resources.ticketing.fieldmapping.requests.RemoteFieldsRetrieveRequest; -import com.merge.api.resources.ticketing.types.ExternalTargetFieldApiResponse; -import com.merge.api.resources.ticketing.types.FieldMappingApiInstanceResponse; -import com.merge.api.resources.ticketing.types.FieldMappingInstanceResponse; -import com.merge.api.resources.ticketing.types.RemoteFieldApiResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class FieldMappingClient { - protected final ClientOptions clientOptions; - - public FieldMappingClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { - return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { - return fieldMappingsRetrieve(request, null); - } - - /** - * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. - */ - public FieldMappingApiInstanceResponse fieldMappingsRetrieve( - FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingApiInstanceResponse.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); - } - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { - return fieldMappingsCreate(request, null); - } - - /** - * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsCreate( - CreateFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/field-mappings"); - if (request.getExcludeRemoteFieldMetadata().isPresent()) { - httpUrl.addQueryParameter( - "exclude_remote_field_metadata", - request.getExcludeRemoteFieldMetadata().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); - } - - /** - * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { - return fieldMappingsPartialUpdate( - fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request) { - return fieldMappingsPartialUpdate(fieldMappingId, request, null); - } - - /** - * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. - */ - public FieldMappingInstanceResponse fieldMappingsPartialUpdate( - String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), FieldMappingInstanceResponse.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); - } - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve() { - return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { - return remoteFieldsRetrieve(request, null); - } - - /** - * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. - */ - public RemoteFieldApiResponse remoteFieldsRetrieve( - RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/remote-fields"); - if (request.getCommonModels().isPresent()) { - httpUrl.addQueryParameter("common_models", request.getCommonModels().get()); - } - if (request.getIncludeExampleValues().isPresent()) { - httpUrl.addQueryParameter( - "include_example_values", request.getIncludeExampleValues().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), RemoteFieldApiResponse.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); - } - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve() { - return targetFieldsRetrieve(null); - } - - /** - * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. - */ - public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/target-fields") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), ExternalTargetFieldApiResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/CreateFieldMappingRequest.java deleted file mode 100644 index 6429e5b76..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/CreateFieldMappingRequest.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) -public final class CreateFieldMappingRequest { - private final Optional excludeRemoteFieldMetadata; - - private final String targetFieldName; - - private final String targetFieldDescription; - - private final List remoteFieldTraversalPath; - - private final String remoteMethod; - - private final String remoteUrlPath; - - private final String commonModelName; - - private final Map additionalProperties; - - private CreateFieldMappingRequest( - Optional excludeRemoteFieldMetadata, - String targetFieldName, - String targetFieldDescription, - List remoteFieldTraversalPath, - String remoteMethod, - String remoteUrlPath, - String commonModelName, - Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.targetFieldName = targetFieldName; - this.targetFieldDescription = targetFieldDescription; - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.commonModelName = commonModelName; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - /** - * @return The name of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_name") - public String getTargetFieldName() { - return targetFieldName; - } - - /** - * @return The description of the target field you want this remote field to map to. - */ - @JsonProperty("target_field_description") - public String getTargetFieldDescription() { - return targetFieldDescription; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public List getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public String getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public String getRemoteUrlPath() { - return remoteUrlPath; - } - - /** - * @return The name of the Common Model that the remote field corresponds to in a given category. - */ - @JsonProperty("common_model_name") - public String getCommonModelName() { - return commonModelName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateFieldMappingRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) - && targetFieldName.equals(other.targetFieldName) - && targetFieldDescription.equals(other.targetFieldDescription) - && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.excludeRemoteFieldMetadata, - this.targetFieldName, - this.targetFieldDescription, - this.remoteFieldTraversalPath, - this.remoteMethod, - this.remoteUrlPath, - this.commonModelName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TargetFieldNameStage builder() { - return new Builder(); - } - - public interface TargetFieldNameStage { - TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); - - Builder from(CreateFieldMappingRequest other); - } - - public interface TargetFieldDescriptionStage { - RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); - } - - public interface RemoteMethodStage { - RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); - } - - public interface RemoteUrlPathStage { - CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); - } - - public interface CommonModelNameStage { - _FinalStage commonModelName(@NotNull String commonModelName); - } - - public interface _FinalStage { - CreateFieldMappingRequest build(); - - _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); - - _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); - - _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); - - _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); - - _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements TargetFieldNameStage, - TargetFieldDescriptionStage, - RemoteMethodStage, - RemoteUrlPathStage, - CommonModelNameStage, - _FinalStage { - private String targetFieldName; - - private String targetFieldDescription; - - private String remoteMethod; - - private String remoteUrlPath; - - private String commonModelName; - - private List remoteFieldTraversalPath = new ArrayList<>(); - - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateFieldMappingRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - targetFieldName(other.getTargetFieldName()); - targetFieldDescription(other.getTargetFieldDescription()); - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - commonModelName(other.getCommonModelName()); - return this; - } - - /** - *

The name of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_name") - public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { - this.targetFieldName = targetFieldName; - return this; - } - - /** - *

The description of the target field you want this remote field to map to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("target_field_description") - public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { - this.targetFieldDescription = targetFieldDescription; - return this; - } - - /** - *

The method of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_method") - public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - /** - *

The path of the remote endpoint where the remote field is coming from.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("remote_url_path") - public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - /** - *

The name of the Common Model that the remote field corresponds to in a given category.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("common_model_name") - public _FinalStage commonModelName(@NotNull String commonModelName) { - this.commonModelName = commonModelName; - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath.clear(); - this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); - return this; - } - - /** - *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - @java.lang.Override - public CreateFieldMappingRequest build() { - return new CreateFieldMappingRequest( - excludeRemoteFieldMetadata, - targetFieldName, - targetFieldDescription, - remoteFieldTraversalPath, - remoteMethod, - remoteUrlPath, - commonModelName, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/FieldMappingsRetrieveRequest.java deleted file mode 100644 index a2676bdae..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/FieldMappingsRetrieveRequest.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) -public final class FieldMappingsRetrieveRequest { - private final Optional excludeRemoteFieldMetadata; - - private final Map additionalProperties; - - private FieldMappingsRetrieveRequest( - Optional excludeRemoteFieldMetadata, Map additionalProperties) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - this.additionalProperties = additionalProperties; - } - - /** - * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. - */ - @JsonProperty("exclude_remote_field_metadata") - public Optional getExcludeRemoteFieldMetadata() { - return excludeRemoteFieldMetadata; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingsRetrieveRequest other) { - return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.excludeRemoteFieldMetadata); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional excludeRemoteFieldMetadata = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingsRetrieveRequest other) { - excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); - return this; - } - - @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) - public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; - return this; - } - - public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { - this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); - return this; - } - - public FieldMappingsRetrieveRequest build() { - return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/PatchedEditFieldMappingRequest.java deleted file mode 100644 index e42c69303..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/PatchedEditFieldMappingRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) -public final class PatchedEditFieldMappingRequest { - private final Optional> remoteFieldTraversalPath; - - private final Optional remoteMethod; - - private final Optional remoteUrlPath; - - private final Map additionalProperties; - - private PatchedEditFieldMappingRequest( - Optional> remoteFieldTraversalPath, - Optional remoteMethod, - Optional remoteUrlPath, - Map additionalProperties) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - this.remoteMethod = remoteMethod; - this.remoteUrlPath = remoteUrlPath; - this.additionalProperties = additionalProperties; - } - - /** - * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - */ - @JsonProperty("remote_field_traversal_path") - public Optional> getRemoteFieldTraversalPath() { - return remoteFieldTraversalPath; - } - - /** - * @return The method of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_method") - public Optional getRemoteMethod() { - return remoteMethod; - } - - /** - * @return The path of the remote endpoint where the remote field is coming from. - */ - @JsonProperty("remote_url_path") - public Optional getRemoteUrlPath() { - return remoteUrlPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) - && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> remoteFieldTraversalPath = Optional.empty(); - - private Optional remoteMethod = Optional.empty(); - - private Optional remoteUrlPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PatchedEditFieldMappingRequest other) { - remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); - remoteMethod(other.getRemoteMethod()); - remoteUrlPath(other.getRemoteUrlPath()); - return this; - } - - @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) - public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = remoteFieldTraversalPath; - return this; - } - - public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { - this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); - return this; - } - - @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) - public Builder remoteMethod(Optional remoteMethod) { - this.remoteMethod = remoteMethod; - return this; - } - - public Builder remoteMethod(String remoteMethod) { - this.remoteMethod = Optional.ofNullable(remoteMethod); - return this; - } - - @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) - public Builder remoteUrlPath(Optional remoteUrlPath) { - this.remoteUrlPath = remoteUrlPath; - return this; - } - - public Builder remoteUrlPath(String remoteUrlPath) { - this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); - return this; - } - - public PatchedEditFieldMappingRequest build() { - return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/RemoteFieldsRetrieveRequest.java deleted file mode 100644 index 63208cafc..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/fieldmapping/requests/RemoteFieldsRetrieveRequest.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.fieldmapping.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) -public final class RemoteFieldsRetrieveRequest { - private final Optional commonModels; - - private final Optional includeExampleValues; - - private final Map additionalProperties; - - private RemoteFieldsRetrieveRequest( - Optional commonModels, - Optional includeExampleValues, - Map additionalProperties) { - this.commonModels = commonModels; - this.includeExampleValues = includeExampleValues; - this.additionalProperties = additionalProperties; - } - - /** - * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. - */ - @JsonProperty("common_models") - public Optional getCommonModels() { - return commonModels; - } - - /** - * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. - */ - @JsonProperty("include_example_values") - public Optional getIncludeExampleValues() { - return includeExampleValues; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldsRetrieveRequest other) { - return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels, this.includeExampleValues); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional commonModels = Optional.empty(); - - private Optional includeExampleValues = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldsRetrieveRequest other) { - commonModels(other.getCommonModels()); - includeExampleValues(other.getIncludeExampleValues()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(Optional commonModels) { - this.commonModels = commonModels; - return this; - } - - public Builder commonModels(String commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) - public Builder includeExampleValues(Optional includeExampleValues) { - this.includeExampleValues = includeExampleValues; - return this; - } - - public Builder includeExampleValues(String includeExampleValues) { - this.includeExampleValues = Optional.ofNullable(includeExampleValues); - return this; - } - - public RemoteFieldsRetrieveRequest build() { - return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/forceresync/ForceResyncClient.java b/src/main/java/com/merge/api/resources/ticketing/forceresync/ForceResyncClient.java deleted file mode 100644 index c2194e9eb..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/forceresync/ForceResyncClient.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.forceresync; - -import com.fasterxml.jackson.core.type.TypeReference; -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.ticketing.types.SyncStatus; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ForceResyncClient { - protected final ClientOptions clientOptions; - - public ForceResyncClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate() { - return syncStatusResyncCreate(null); - } - - /** - * Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. - */ - public List syncStatusResyncCreate(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/sync-status/resync") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", RequestBody.create("", null)) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/generatekey/GenerateKeyClient.java b/src/main/java/com/merge/api/resources/ticketing/generatekey/GenerateKeyClient.java deleted file mode 100644 index 3d9185645..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/generatekey/GenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.generatekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.generatekey.requests.GenerateRemoteKeyRequest; -import com.merge.api.resources.ticketing.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class GenerateKeyClient { - protected final ClientOptions clientOptions; - - public GenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request) { - return create(request, null); - } - - /** - * Create a remote key. - */ - public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/generate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/generatekey/requests/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/resources/ticketing/generatekey/requests/GenerateRemoteKeyRequest.java deleted file mode 100644 index d1024d870..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/generatekey/requests/GenerateRemoteKeyRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.generatekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) -public final class GenerateRemoteKeyRequest { - private final String name; - - private final Map additionalProperties; - - private GenerateRemoteKeyRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GenerateRemoteKeyRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(GenerateRemoteKeyRequest other); - } - - public interface _FinalStage { - GenerateRemoteKeyRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GenerateRemoteKeyRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public GenerateRemoteKeyRequest build() { - return new GenerateRemoteKeyRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/issues/IssuesClient.java b/src/main/java/com/merge/api/resources/ticketing/issues/IssuesClient.java deleted file mode 100644 index 17931c31c..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/issues/IssuesClient.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.issues; - -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.ticketing.issues.requests.IssuesListRequest; -import com.merge.api.resources.ticketing.types.Issue; -import com.merge.api.resources.ticketing.types.PaginatedIssueList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuesClient { - protected final ClientOptions clientOptions; - - public IssuesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list() { - return list(IssuesListRequest.builder().build()); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request) { - return list(request, null); - } - - /** - * Gets all issues for Organization. - */ - public PaginatedIssueList list(IssuesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/issues"); - if (request.getAccountToken().isPresent()) { - httpUrl.addQueryParameter("account_token", request.getAccountToken().get()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndDate().isPresent()) { - httpUrl.addQueryParameter("end_date", request.getEndDate().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getFirstIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_after", - request.getFirstIncidentTimeAfter().get().toString()); - } - if (request.getFirstIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "first_incident_time_before", - request.getFirstIncidentTimeBefore().get().toString()); - } - if (request.getIncludeMuted().isPresent()) { - httpUrl.addQueryParameter("include_muted", request.getIncludeMuted().get()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getLastIncidentTimeAfter().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_after", - request.getLastIncidentTimeAfter().get().toString()); - } - if (request.getLastIncidentTimeBefore().isPresent()) { - httpUrl.addQueryParameter( - "last_incident_time_before", - request.getLastIncidentTimeBefore().get().toString()); - } - if (request.getLinkedAccountId().isPresent()) { - httpUrl.addQueryParameter( - "linked_account_id", request.getLinkedAccountId().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStartDate().isPresent()) { - httpUrl.addQueryParameter("start_date", request.getStartDate().get()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedIssueList.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); - } - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id) { - return retrieve(id, null); - } - - /** - * Get a specific issue. - */ - public Issue retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/issues") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), Issue.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/issues/requests/IssuesListRequest.java b/src/main/java/com/merge/api/resources/ticketing/issues/requests/IssuesListRequest.java deleted file mode 100644 index 323d98156..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/issues/requests/IssuesListRequest.java +++ /dev/null @@ -1,477 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.issues.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.issues.types.IssuesListRequestStatus; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IssuesListRequest.Builder.class) -public final class IssuesListRequest { - private final Optional accountToken; - - private final Optional cursor; - - private final Optional endDate; - - private final Optional endUserOrganizationName; - - private final Optional firstIncidentTimeAfter; - - private final Optional firstIncidentTimeBefore; - - private final Optional includeMuted; - - private final Optional integrationName; - - private final Optional lastIncidentTimeAfter; - - private final Optional lastIncidentTimeBefore; - - private final Optional linkedAccountId; - - private final Optional pageSize; - - private final Optional startDate; - - private final Optional status; - - private final Map additionalProperties; - - private IssuesListRequest( - Optional accountToken, - Optional cursor, - Optional endDate, - Optional endUserOrganizationName, - Optional firstIncidentTimeAfter, - Optional firstIncidentTimeBefore, - Optional includeMuted, - Optional integrationName, - Optional lastIncidentTimeAfter, - Optional lastIncidentTimeBefore, - Optional linkedAccountId, - Optional pageSize, - Optional startDate, - Optional status, - Map additionalProperties) { - this.accountToken = accountToken; - this.cursor = cursor; - this.endDate = endDate; - this.endUserOrganizationName = endUserOrganizationName; - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - this.includeMuted = includeMuted; - this.integrationName = integrationName; - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - this.linkedAccountId = linkedAccountId; - this.pageSize = pageSize; - this.startDate = startDate; - this.status = status; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public Optional getAccountToken() { - return accountToken; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If included, will only include issues whose most recent action occurred before this time - */ - @JsonProperty("end_date") - public Optional getEndDate() { - return endDate; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return issues whose first incident time was after this datetime. - */ - @JsonProperty("first_incident_time_after") - public Optional getFirstIncidentTimeAfter() { - return firstIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose first incident time was before this datetime. - */ - @JsonProperty("first_incident_time_before") - public Optional getFirstIncidentTimeBefore() { - return firstIncidentTimeBefore; - } - - /** - * @return If true, will include muted issues - */ - @JsonProperty("include_muted") - public Optional getIncludeMuted() { - return includeMuted; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If provided, will only return issues whose last incident time was after this datetime. - */ - @JsonProperty("last_incident_time_after") - public Optional getLastIncidentTimeAfter() { - return lastIncidentTimeAfter; - } - - /** - * @return If provided, will only return issues whose last incident time was before this datetime. - */ - @JsonProperty("last_incident_time_before") - public Optional getLastIncidentTimeBefore() { - return lastIncidentTimeBefore; - } - - /** - * @return If provided, will only include issues pertaining to the linked account passed in. - */ - @JsonProperty("linked_account_id") - public Optional getLinkedAccountId() { - return linkedAccountId; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return If included, will only include issues whose most recent action occurred after this time - */ - @JsonProperty("start_date") - public Optional getStartDate() { - return startDate; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IssuesListRequest other) { - return accountToken.equals(other.accountToken) - && cursor.equals(other.cursor) - && endDate.equals(other.endDate) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) - && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) - && includeMuted.equals(other.includeMuted) - && integrationName.equals(other.integrationName) - && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) - && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) - && linkedAccountId.equals(other.linkedAccountId) - && pageSize.equals(other.pageSize) - && startDate.equals(other.startDate) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.accountToken, - this.cursor, - this.endDate, - this.endUserOrganizationName, - this.firstIncidentTimeAfter, - this.firstIncidentTimeBefore, - this.includeMuted, - this.integrationName, - this.lastIncidentTimeAfter, - this.lastIncidentTimeBefore, - this.linkedAccountId, - this.pageSize, - this.startDate, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional accountToken = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endDate = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional firstIncidentTimeAfter = Optional.empty(); - - private Optional firstIncidentTimeBefore = Optional.empty(); - - private Optional includeMuted = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional lastIncidentTimeAfter = Optional.empty(); - - private Optional lastIncidentTimeBefore = Optional.empty(); - - private Optional linkedAccountId = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional startDate = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(IssuesListRequest other) { - accountToken(other.getAccountToken()); - cursor(other.getCursor()); - endDate(other.getEndDate()); - endUserOrganizationName(other.getEndUserOrganizationName()); - firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); - firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); - includeMuted(other.getIncludeMuted()); - integrationName(other.getIntegrationName()); - lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); - lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); - linkedAccountId(other.getLinkedAccountId()); - pageSize(other.getPageSize()); - startDate(other.getStartDate()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "account_token", nulls = Nulls.SKIP) - public Builder accountToken(Optional accountToken) { - this.accountToken = accountToken; - return this; - } - - public Builder accountToken(String accountToken) { - this.accountToken = Optional.ofNullable(accountToken); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_date", nulls = Nulls.SKIP) - public Builder endDate(Optional endDate) { - this.endDate = endDate; - return this; - } - - public Builder endDate(String endDate) { - this.endDate = Optional.ofNullable(endDate); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) - public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = firstIncidentTimeAfter; - return this; - } - - public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { - this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) - public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = firstIncidentTimeBefore; - return this; - } - - public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { - this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) - public Builder includeMuted(Optional includeMuted) { - this.includeMuted = includeMuted; - return this; - } - - public Builder includeMuted(String includeMuted) { - this.includeMuted = Optional.ofNullable(includeMuted); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) - public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = lastIncidentTimeAfter; - return this; - } - - public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { - this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); - return this; - } - - @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) - public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = lastIncidentTimeBefore; - return this; - } - - public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { - this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); - return this; - } - - @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) - public Builder linkedAccountId(Optional linkedAccountId) { - this.linkedAccountId = linkedAccountId; - return this; - } - - public Builder linkedAccountId(String linkedAccountId) { - this.linkedAccountId = Optional.ofNullable(linkedAccountId); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "start_date", nulls = Nulls.SKIP) - public Builder startDate(Optional startDate) { - this.startDate = startDate; - return this; - } - - public Builder startDate(String startDate) { - this.startDate = Optional.ofNullable(startDate); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(IssuesListRequestStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - public IssuesListRequest build() { - return new IssuesListRequest( - accountToken, - cursor, - endDate, - endUserOrganizationName, - firstIncidentTimeAfter, - firstIncidentTimeBefore, - includeMuted, - integrationName, - lastIncidentTimeAfter, - lastIncidentTimeBefore, - linkedAccountId, - pageSize, - startDate, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/issues/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/resources/ticketing/issues/types/IssuesListRequestStatus.java deleted file mode 100644 index 5059572c3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/issues/types/IssuesListRequestStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.issues.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssuesListRequestStatus { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssuesListRequestStatus(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/LinkedAccountsClient.java b/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/LinkedAccountsClient.java deleted file mode 100644 index cd5e77193..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/LinkedAccountsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.linkedaccounts; - -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.ticketing.linkedaccounts.requests.LinkedAccountsListRequest; -import com.merge.api.resources.ticketing.types.PaginatedAccountDetailsAndActionsList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkedAccountsClient { - protected final ClientOptions clientOptions; - - public LinkedAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list() { - return list(LinkedAccountsListRequest.builder().build()); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list(LinkedAccountsListRequest request) { - return list(request, null); - } - - /** - * List linked accounts for your organization. - */ - public PaginatedAccountDetailsAndActionsList list( - LinkedAccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/linked-accounts"); - if (request.getCategory().isPresent()) { - httpUrl.addQueryParameter("category", request.getCategory().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEndUserEmailAddress().isPresent()) { - httpUrl.addQueryParameter( - "end_user_email_address", request.getEndUserEmailAddress().get()); - } - if (request.getEndUserOrganizationName().isPresent()) { - httpUrl.addQueryParameter( - "end_user_organization_name", - request.getEndUserOrganizationName().get()); - } - if (request.getEndUserOriginId().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_id", request.getEndUserOriginId().get()); - } - if (request.getEndUserOriginIds().isPresent()) { - httpUrl.addQueryParameter( - "end_user_origin_ids", request.getEndUserOriginIds().get()); - } - if (request.getId().isPresent()) { - httpUrl.addQueryParameter("id", request.getId().get()); - } - if (request.getIds().isPresent()) { - httpUrl.addQueryParameter("ids", request.getIds().get()); - } - if (request.getIncludeDuplicates().isPresent()) { - httpUrl.addQueryParameter( - "include_duplicates", request.getIncludeDuplicates().get().toString()); - } - if (request.getIntegrationName().isPresent()) { - httpUrl.addQueryParameter( - "integration_name", request.getIntegrationName().get()); - } - if (request.getIsTestAccount().isPresent()) { - httpUrl.addQueryParameter( - "is_test_account", request.getIsTestAccount().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedAccountDetailsAndActionsList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/requests/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/requests/LinkedAccountsListRequest.java deleted file mode 100644 index 4f75cf305..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/requests/LinkedAccountsListRequest.java +++ /dev/null @@ -1,458 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.linkedaccounts.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.linkedaccounts.types.LinkedAccountsListRequestCategory; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) -public final class LinkedAccountsListRequest { - private final Optional category; - - private final Optional cursor; - - private final Optional endUserEmailAddress; - - private final Optional endUserOrganizationName; - - private final Optional endUserOriginId; - - private final Optional endUserOriginIds; - - private final Optional id; - - private final Optional ids; - - private final Optional includeDuplicates; - - private final Optional integrationName; - - private final Optional isTestAccount; - - private final Optional pageSize; - - private final Optional status; - - private final Map additionalProperties; - - private LinkedAccountsListRequest( - Optional category, - Optional cursor, - Optional endUserEmailAddress, - Optional endUserOrganizationName, - Optional endUserOriginId, - Optional endUserOriginIds, - Optional id, - Optional ids, - Optional includeDuplicates, - Optional integrationName, - Optional isTestAccount, - Optional pageSize, - Optional status, - Map additionalProperties) { - this.category = category; - this.cursor = cursor; - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.endUserOriginIds = endUserOriginIds; - this.id = id; - this.ids = ids; - this.includeDuplicates = includeDuplicates; - this.integrationName = integrationName; - this.isTestAccount = isTestAccount; - this.pageSize = pageSize; - this.status = status; - this.additionalProperties = additionalProperties; - } - - /** - * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing - *
    - *
  • hris - hris
  • - *
  • ats - ats
  • - *
  • accounting - accounting
  • - *
  • ticketing - ticketing
  • - *
  • crm - crm
  • - *
  • mktg - mktg
  • - *
  • filestorage - filestorage
  • - *
- */ - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return linked accounts associated with the given email address. - */ - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return If provided, will only return linked accounts associated with the given organization name. - */ - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return If provided, will only return linked accounts associated with the given origin ID. - */ - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. - */ - @JsonProperty("end_user_origin_ids") - public Optional getEndUserOriginIds() { - return endUserOriginIds; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. - */ - @JsonProperty("ids") - public Optional getIds() { - return ids; - } - - /** - * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. - */ - @JsonProperty("include_duplicates") - public Optional getIncludeDuplicates() { - return includeDuplicates; - } - - /** - * @return If provided, will only return linked accounts associated with the given integration name. - */ - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - /** - * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. - */ - @JsonProperty("is_test_account") - public Optional getIsTestAccount() { - return isTestAccount; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountsListRequest other) { - return category.equals(other.category) - && cursor.equals(other.cursor) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOriginIds.equals(other.endUserOriginIds) - && id.equals(other.id) - && ids.equals(other.ids) - && includeDuplicates.equals(other.includeDuplicates) - && integrationName.equals(other.integrationName) - && isTestAccount.equals(other.isTestAccount) - && pageSize.equals(other.pageSize) - && status.equals(other.status); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.category, - this.cursor, - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.endUserOriginIds, - this.id, - this.ids, - this.includeDuplicates, - this.integrationName, - this.isTestAccount, - this.pageSize, - this.status); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional category = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOriginIds = Optional.empty(); - - private Optional id = Optional.empty(); - - private Optional ids = Optional.empty(); - - private Optional includeDuplicates = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - private Optional isTestAccount = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional status = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountsListRequest other) { - category(other.getCategory()); - cursor(other.getCursor()); - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - endUserOriginIds(other.getEndUserOriginIds()); - id(other.getId()); - ids(other.getIds()); - includeDuplicates(other.getIncludeDuplicates()); - integrationName(other.getIntegrationName()); - isTestAccount(other.getIsTestAccount()); - pageSize(other.getPageSize()); - status(other.getStatus()); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(LinkedAccountsListRequestCategory category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) - public Builder endUserOriginIds(Optional endUserOriginIds) { - this.endUserOriginIds = endUserOriginIds; - return this; - } - - public Builder endUserOriginIds(String endUserOriginIds) { - this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "ids", nulls = Nulls.SKIP) - public Builder ids(Optional ids) { - this.ids = ids; - return this; - } - - public Builder ids(String ids) { - this.ids = Optional.ofNullable(ids); - return this; - } - - @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) - public Builder includeDuplicates(Optional includeDuplicates) { - this.includeDuplicates = includeDuplicates; - return this; - } - - public Builder includeDuplicates(Boolean includeDuplicates) { - this.includeDuplicates = Optional.ofNullable(includeDuplicates); - return this; - } - - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public Builder integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - public Builder integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) - public Builder isTestAccount(Optional isTestAccount) { - this.isTestAccount = isTestAccount; - return this; - } - - public Builder isTestAccount(String isTestAccount) { - this.isTestAccount = Optional.ofNullable(isTestAccount); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - public LinkedAccountsListRequest build() { - return new LinkedAccountsListRequest( - category, - cursor, - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - endUserOriginIds, - id, - ids, - includeDuplicates, - integrationName, - isTestAccount, - pageSize, - status, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/types/LinkedAccountsListRequestCategory.java deleted file mode 100644 index 27f6b58df..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/linkedaccounts/types/LinkedAccountsListRequestCategory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.linkedaccounts.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LinkedAccountsListRequestCategory { - ACCOUNTING("accounting"), - - ATS("ats"), - - CRM("crm"), - - FILESTORAGE("filestorage"), - - HRIS("hris"), - - MKTG("mktg"), - - TICKETING("ticketing"); - - private final String value; - - LinkedAccountsListRequestCategory(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/linktoken/LinkTokenClient.java b/src/main/java/com/merge/api/resources/ticketing/linktoken/LinkTokenClient.java deleted file mode 100644 index b8c8c7949..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/linktoken/LinkTokenClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.linktoken; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.linktoken.requests.EndUserDetailsRequest; -import com.merge.api.resources.ticketing.types.LinkToken; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class LinkTokenClient { - protected final ClientOptions clientOptions; - - public LinkTokenClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request) { - return create(request, null); - } - - /** - * Creates a link token to be used when linking a new end user. - */ - public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/link-token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), LinkToken.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/linktoken/requests/EndUserDetailsRequest.java b/src/main/java/com/merge/api/resources/ticketing/linktoken/requests/EndUserDetailsRequest.java deleted file mode 100644 index 9a5f1a332..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/linktoken/requests/EndUserDetailsRequest.java +++ /dev/null @@ -1,611 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.linktoken.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.types.CategoriesEnum; -import com.merge.api.resources.ticketing.types.CommonModelScopesBodyRequest; -import com.merge.api.resources.ticketing.types.IndividualCommonModelScopeDeserializerRequest; -import com.merge.api.resources.ticketing.types.LanguageEnum; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) -public final class EndUserDetailsRequest { - private final String endUserEmailAddress; - - private final String endUserOrganizationName; - - private final String endUserOriginId; - - private final List categories; - - private final Optional integration; - - private final Optional linkExpiryMins; - - private final Optional shouldCreateMagicLinkUrl; - - private final Optional hideAdminMagicLink; - - private final Optional> commonModels; - - private final Optional>>> - categoryCommonModelScopes; - - private final Optional language; - - private final Optional areSyncsDisabled; - - private final Optional> integrationSpecificConfig; - - private final Map additionalProperties; - - private EndUserDetailsRequest( - String endUserEmailAddress, - String endUserOrganizationName, - String endUserOriginId, - List categories, - Optional integration, - Optional linkExpiryMins, - Optional shouldCreateMagicLinkUrl, - Optional hideAdminMagicLink, - Optional> commonModels, - Optional>>> - categoryCommonModelScopes, - Optional language, - Optional areSyncsDisabled, - Optional> integrationSpecificConfig, - Map additionalProperties) { - this.endUserEmailAddress = endUserEmailAddress; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserOriginId = endUserOriginId; - this.categories = categories; - this.integration = integration; - this.linkExpiryMins = linkExpiryMins; - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - this.hideAdminMagicLink = hideAdminMagicLink; - this.commonModels = commonModels; - this.categoryCommonModelScopes = categoryCommonModelScopes; - this.language = language; - this.areSyncsDisabled = areSyncsDisabled; - this.integrationSpecificConfig = integrationSpecificConfig; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. - */ - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return Your end user's organization. - */ - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - /** - * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. - */ - @JsonProperty("end_user_origin_id") - public String getEndUserOriginId() { - return endUserOriginId; - } - - /** - * @return The integration categories to show in Merge Link. - */ - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - /** - * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. - */ - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - /** - * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. - */ - @JsonProperty("link_expiry_mins") - public Optional getLinkExpiryMins() { - return linkExpiryMins; - } - - /** - * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("should_create_magic_link_url") - public Optional getShouldCreateMagicLinkUrl() { - return shouldCreateMagicLinkUrl; - } - - /** - * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - */ - @JsonProperty("hide_admin_magic_link") - public Optional getHideAdminMagicLink() { - return hideAdminMagicLink; - } - - /** - * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. - */ - @JsonProperty("common_models") - public Optional> getCommonModels() { - return commonModels; - } - - /** - * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. - */ - @JsonProperty("category_common_model_scopes") - public Optional>>> - getCategoryCommonModelScopes() { - return categoryCommonModelScopes; - } - - /** - * @return The following subset of IETF language tags can be used to configure localization. - *
    - *
  • en - en
  • - *
  • de - de
  • - *
- */ - @JsonProperty("language") - public Optional getLanguage() { - return language; - } - - /** - * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. - */ - @JsonProperty("are_syncs_disabled") - public Optional getAreSyncsDisabled() { - return areSyncsDisabled; - } - - /** - * @return A JSON object containing integration-specific configuration options. - */ - @JsonProperty("integration_specific_config") - public Optional> getIntegrationSpecificConfig() { - return integrationSpecificConfig; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EndUserDetailsRequest other) { - return endUserEmailAddress.equals(other.endUserEmailAddress) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserOriginId.equals(other.endUserOriginId) - && categories.equals(other.categories) - && integration.equals(other.integration) - && linkExpiryMins.equals(other.linkExpiryMins) - && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) - && hideAdminMagicLink.equals(other.hideAdminMagicLink) - && commonModels.equals(other.commonModels) - && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) - && language.equals(other.language) - && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.endUserEmailAddress, - this.endUserOrganizationName, - this.endUserOriginId, - this.categories, - this.integration, - this.linkExpiryMins, - this.shouldCreateMagicLinkUrl, - this.hideAdminMagicLink, - this.commonModels, - this.categoryCommonModelScopes, - this.language, - this.areSyncsDisabled, - this.integrationSpecificConfig); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EndUserEmailAddressStage builder() { - return new Builder(); - } - - public interface EndUserEmailAddressStage { - EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); - - Builder from(EndUserDetailsRequest other); - } - - public interface EndUserOrganizationNameStage { - EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserOriginIdStage { - _FinalStage endUserOriginId(@NotNull String endUserOriginId); - } - - public interface _FinalStage { - EndUserDetailsRequest build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage integration(Optional integration); - - _FinalStage integration(String integration); - - _FinalStage linkExpiryMins(Optional linkExpiryMins); - - _FinalStage linkExpiryMins(Integer linkExpiryMins); - - _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); - - _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); - - _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); - - _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); - - _FinalStage commonModels(Optional> commonModels); - - _FinalStage commonModels(List commonModels); - - _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes); - - _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes); - - _FinalStage language(Optional language); - - _FinalStage language(LanguageEnum language); - - _FinalStage areSyncsDisabled(Optional areSyncsDisabled); - - _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); - - _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); - - _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { - private String endUserEmailAddress; - - private String endUserOrganizationName; - - private String endUserOriginId; - - private Optional> integrationSpecificConfig = Optional.empty(); - - private Optional areSyncsDisabled = Optional.empty(); - - private Optional language = Optional.empty(); - - private Optional>>> - categoryCommonModelScopes = Optional.empty(); - - private Optional> commonModels = Optional.empty(); - - private Optional hideAdminMagicLink = Optional.empty(); - - private Optional shouldCreateMagicLinkUrl = Optional.empty(); - - private Optional linkExpiryMins = Optional.empty(); - - private Optional integration = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EndUserDetailsRequest other) { - endUserEmailAddress(other.getEndUserEmailAddress()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserOriginId(other.getEndUserOriginId()); - categories(other.getCategories()); - integration(other.getIntegration()); - linkExpiryMins(other.getLinkExpiryMins()); - shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); - hideAdminMagicLink(other.getHideAdminMagicLink()); - commonModels(other.getCommonModels()); - categoryCommonModelScopes(other.getCategoryCommonModelScopes()); - language(other.getLanguage()); - areSyncsDisabled(other.getAreSyncsDisabled()); - integrationSpecificConfig(other.getIntegrationSpecificConfig()); - return this; - } - - /** - *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_email_address") - public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - /** - *

Your end user's organization.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - /** - *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("end_user_origin_id") - public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - /** - *

A JSON object containing integration-specific configuration options.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { - this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) - public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { - this.integrationSpecificConfig = integrationSpecificConfig; - return this; - } - - /** - *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { - this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); - return this; - } - - @java.lang.Override - @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) - public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { - this.areSyncsDisabled = areSyncsDisabled; - return this; - } - - /** - *

The following subset of IETF language tags can be used to configure localization.

- *
    - *
  • en - en
  • - *
  • de - de
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage language(LanguageEnum language) { - this.language = Optional.ofNullable(language); - return this; - } - - @java.lang.Override - @JsonSetter(value = "language", nulls = Nulls.SKIP) - public _FinalStage language(Optional language) { - this.language = language; - return this; - } - - /** - *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryCommonModelScopes( - Map>> categoryCommonModelScopes) { - this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) - public _FinalStage categoryCommonModelScopes( - Optional>>> - categoryCommonModelScopes) { - this.categoryCommonModelScopes = categoryCommonModelScopes; - return this; - } - - /** - *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage commonModels(List commonModels) { - this.commonModels = Optional.ofNullable(commonModels); - return this; - } - - @java.lang.Override - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public _FinalStage commonModels(Optional> commonModels) { - this.commonModels = commonModels; - return this; - } - - /** - *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { - this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); - return this; - } - - @java.lang.Override - @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) - public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { - this.hideAdminMagicLink = hideAdminMagicLink; - return this; - } - - /** - *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) - public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { - this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; - return this; - } - - /** - *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage linkExpiryMins(Integer linkExpiryMins) { - this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); - return this; - } - - @java.lang.Override - @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) - public _FinalStage linkExpiryMins(Optional linkExpiryMins) { - this.linkExpiryMins = linkExpiryMins; - return this; - } - - /** - *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - /** - *

The integration categories to show in Merge Link.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public EndUserDetailsRequest build() { - return new EndUserDetailsRequest( - endUserEmailAddress, - endUserOrganizationName, - endUserOriginId, - categories, - integration, - linkExpiryMins, - shouldCreateMagicLinkUrl, - hideAdminMagicLink, - commonModels, - categoryCommonModelScopes, - language, - areSyncsDisabled, - integrationSpecificConfig, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/passthrough/PassthroughClient.java b/src/main/java/com/merge/api/resources/ticketing/passthrough/PassthroughClient.java deleted file mode 100644 index a3eff87cc..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/passthrough/PassthroughClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.passthrough; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.types.DataPassthroughRequest; -import com.merge.api.resources.ticketing.types.RemoteResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class PassthroughClient { - protected final ClientOptions clientOptions; - - public PassthroughClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request) { - return create(request, null); - } - - /** - * Pull data from an endpoint not currently supported by Merge. - */ - public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/passthrough") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .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(), RemoteResponse.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/projects/ProjectsClient.java b/src/main/java/com/merge/api/resources/ticketing/projects/ProjectsClient.java deleted file mode 100644 index 5e0d757f1..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/projects/ProjectsClient.java +++ /dev/null @@ -1,240 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.projects; - -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.ticketing.projects.requests.ProjectsListRequest; -import com.merge.api.resources.ticketing.projects.requests.ProjectsRetrieveRequest; -import com.merge.api.resources.ticketing.projects.requests.ProjectsUsersListRequest; -import com.merge.api.resources.ticketing.types.PaginatedProjectList; -import com.merge.api.resources.ticketing.types.PaginatedUserList; -import com.merge.api.resources.ticketing.types.Project; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ProjectsClient { - protected final ClientOptions clientOptions; - - public ProjectsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Project objects. - */ - public PaginatedProjectList list() { - return list(ProjectsListRequest.builder().build()); - } - - /** - * Returns a list of Project objects. - */ - public PaginatedProjectList list(ProjectsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Project objects. - */ - public PaginatedProjectList list(ProjectsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/projects"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedProjectList.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); - } - } - - /** - * Returns a Project object with the given id. - */ - public Project retrieve(String id) { - return retrieve(id, ProjectsRetrieveRequest.builder().build()); - } - - /** - * Returns a Project object with the given id. - */ - public Project retrieve(String id, ProjectsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Project object with the given id. - */ - public Project retrieve(String id, ProjectsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/projects") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Project.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); - } - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList usersList(String parentId) { - return usersList(parentId, ProjectsUsersListRequest.builder().build()); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList usersList(String parentId, ProjectsUsersListRequest request) { - return usersList(parentId, request, null); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList usersList( - String parentId, ProjectsUsersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/projects") - .addPathSegment(parentId) - .addPathSegments("users"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedUserList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsRetrieveRequest.java deleted file mode 100644 index 7fb18c7dc..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.projects.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProjectsRetrieveRequest.Builder.class) -public final class ProjectsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private ProjectsRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProjectsRetrieveRequest && equalTo((ProjectsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProjectsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ProjectsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public ProjectsRetrieveRequest build() { - return new ProjectsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/projects/types/ProjectsUsersListRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/projects/types/ProjectsUsersListRequestExpand.java deleted file mode 100644 index b55183a18..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/projects/types/ProjectsUsersListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.projects.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ProjectsUsersListRequestExpand { - ROLES("roles"), - - TEAMS("teams"), - - TEAMS_ROLES("teams,roles"); - - private final String value; - - ProjectsUsersListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/regeneratekey/RegenerateKeyClient.java b/src/main/java/com/merge/api/resources/ticketing/regeneratekey/RegenerateKeyClient.java deleted file mode 100644 index e8cf0c19c..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/regeneratekey/RegenerateKeyClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.regeneratekey; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.regeneratekey.requests.RemoteKeyForRegenerationRequest; -import com.merge.api.resources.ticketing.types.RemoteKey; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RegenerateKeyClient { - protected final ClientOptions clientOptions; - - public RegenerateKeyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request) { - return create(request, null); - } - - /** - * Exchange remote keys. - */ - public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/regenerate-key") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), RemoteKey.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/regeneratekey/requests/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/resources/ticketing/regeneratekey/requests/RemoteKeyForRegenerationRequest.java deleted file mode 100644 index d27604c47..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/regeneratekey/requests/RemoteKeyForRegenerationRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.regeneratekey.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) -public final class RemoteKeyForRegenerationRequest { - private final String name; - - private final Map additionalProperties; - - private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the remote key - */ - @JsonProperty("name") - public String getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKeyForRegenerationRequest other) { - return name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(RemoteKeyForRegenerationRequest other); - } - - public interface _FinalStage { - RemoteKeyForRegenerationRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKeyForRegenerationRequest other) { - name(other.getName()); - return this; - } - - /** - *

The name of the remote key

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - public RemoteKeyForRegenerationRequest build() { - return new RemoteKeyForRegenerationRequest(name, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/roles/RolesClient.java b/src/main/java/com/merge/api/resources/ticketing/roles/RolesClient.java deleted file mode 100644 index 91b5bbeec..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/roles/RolesClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.roles; - -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.ticketing.roles.requests.RolesListRequest; -import com.merge.api.resources.ticketing.roles.requests.RolesRetrieveRequest; -import com.merge.api.resources.ticketing.types.PaginatedRoleList; -import com.merge.api.resources.ticketing.types.Role; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RolesClient { - protected final ClientOptions clientOptions; - - public RolesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Role objects. - */ - public PaginatedRoleList list() { - return list(RolesListRequest.builder().build()); - } - - /** - * Returns a list of Role objects. - */ - public PaginatedRoleList list(RolesListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Role objects. - */ - public PaginatedRoleList list(RolesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/roles"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRoleList.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); - } - } - - /** - * Returns a Role object with the given id. - */ - public Role retrieve(String id) { - return retrieve(id, RolesRetrieveRequest.builder().build()); - } - - /** - * Returns a Role object with the given id. - */ - public Role retrieve(String id, RolesRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Role object with the given id. - */ - public Role retrieve(String id, RolesRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/roles") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Role.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/roles/requests/RolesRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/roles/requests/RolesRetrieveRequest.java deleted file mode 100644 index b1cd109aa..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/roles/requests/RolesRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.roles.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RolesRetrieveRequest.Builder.class) -public final class RolesRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private RolesRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RolesRetrieveRequest && equalTo((RolesRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RolesRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RolesRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public RolesRetrieveRequest build() { - return new RolesRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/scopes/ScopesClient.java b/src/main/java/com/merge/api/resources/ticketing/scopes/ScopesClient.java deleted file mode 100644 index 48fed55ea..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/scopes/ScopesClient.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.scopes; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.scopes.requests.LinkedAccountCommonModelScopeDeserializerRequest; -import com.merge.api.resources.ticketing.types.CommonModelScopeApi; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class ScopesClient { - protected final ClientOptions clientOptions; - - public ScopesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve() { - return defaultScopesRetrieve(null); - } - - /** - * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. - */ - public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/default-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve() { - return linkedAccountScopesRetrieve(null); - } - - /** - * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. - */ - public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/linked-account-scopes") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { - return linkedAccountScopesCreate(request, null); - } - - /** - * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more - */ - public CommonModelScopeApi linkedAccountScopesCreate( - LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/linked-account-scopes") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), CommonModelScopeApi.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/ticketing/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 5c4fd2901..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/scopes/requests/LinkedAccountCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.scopes.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.types.IndividualCommonModelScopeDeserializerRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) -public final class LinkedAccountCommonModelScopeDeserializerRequest { - private final List commonModels; - - private final Map additionalProperties; - - private LinkedAccountCommonModelScopeDeserializerRequest( - List commonModels, - Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountCommonModelScopeDeserializerRequest - && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public LinkedAccountCommonModelScopeDeserializerRequest build() { - return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/syncstatus/SyncStatusClient.java b/src/main/java/com/merge/api/resources/ticketing/syncstatus/SyncStatusClient.java deleted file mode 100644 index bdfb8a655..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/syncstatus/SyncStatusClient.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.syncstatus; - -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.ticketing.syncstatus.requests.SyncStatusListRequest; -import com.merge.api.resources.ticketing.types.PaginatedSyncStatusList; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SyncStatusClient { - protected final ClientOptions clientOptions; - - public SyncStatusClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list() { - return list(SyncStatusListRequest.builder().build()); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request) { - return list(request, null); - } - - /** - * Get syncing status. Possible values: DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. - */ - public PaginatedSyncStatusList list(SyncStatusListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/sync-status"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedSyncStatusList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/syncstatus/requests/SyncStatusListRequest.java b/src/main/java/com/merge/api/resources/ticketing/syncstatus/requests/SyncStatusListRequest.java deleted file mode 100644 index 33bc3a5cf..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/syncstatus/requests/SyncStatusListRequest.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.syncstatus.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) -public final class SyncStatusListRequest { - private final Optional cursor; - - private final Optional pageSize; - - private final Map additionalProperties; - - private SyncStatusListRequest( - Optional cursor, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; - this.pageSize = pageSize; - this.additionalProperties = additionalProperties; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatusListRequest other) { - return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.cursor, this.pageSize); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional cursor = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(SyncStatusListRequest other) { - cursor(other.getCursor()); - pageSize(other.getPageSize()); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - public SyncStatusListRequest build() { - return new SyncStatusListRequest(cursor, pageSize, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/tags/TagsClient.java b/src/main/java/com/merge/api/resources/ticketing/tags/TagsClient.java deleted file mode 100644 index ef526798a..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/tags/TagsClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.tags; - -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.ticketing.tags.requests.TagsListRequest; -import com.merge.api.resources.ticketing.tags.requests.TagsRetrieveRequest; -import com.merge.api.resources.ticketing.types.PaginatedTagList; -import com.merge.api.resources.ticketing.types.Tag; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TagsClient { - protected final ClientOptions clientOptions; - - public TagsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Tag objects. - */ - public PaginatedTagList list() { - return list(TagsListRequest.builder().build()); - } - - /** - * Returns a list of Tag objects. - */ - public PaginatedTagList list(TagsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Tag objects. - */ - public PaginatedTagList list(TagsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tags"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTagList.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); - } - } - - /** - * Returns a Tag object with the given id. - */ - public Tag retrieve(String id) { - return retrieve(id, TagsRetrieveRequest.builder().build()); - } - - /** - * Returns a Tag object with the given id. - */ - public Tag retrieve(String id, TagsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Tag object with the given id. - */ - public Tag retrieve(String id, TagsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tags") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Tag.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/tags/requests/TagsListRequest.java b/src/main/java/com/merge/api/resources/ticketing/tags/requests/TagsListRequest.java deleted file mode 100644 index 32785bc78..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/tags/requests/TagsListRequest.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.tags.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TagsListRequest.Builder.class) -public final class TagsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private TagsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TagsListRequest && equalTo((TagsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TagsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TagsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public TagsListRequest build() { - return new TagsListRequest( - createdAfter, - createdBefore, - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/tags/requests/TagsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/tags/requests/TagsRetrieveRequest.java deleted file mode 100644 index 8b74e7c55..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/tags/requests/TagsRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.tags.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TagsRetrieveRequest.Builder.class) -public final class TagsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private TagsRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TagsRetrieveRequest && equalTo((TagsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TagsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TagsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public TagsRetrieveRequest build() { - return new TagsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/teams/TeamsClient.java b/src/main/java/com/merge/api/resources/ticketing/teams/TeamsClient.java deleted file mode 100644 index 3f12e7825..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/teams/TeamsClient.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.teams; - -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.ticketing.teams.requests.TeamsListRequest; -import com.merge.api.resources.ticketing.teams.requests.TeamsRetrieveRequest; -import com.merge.api.resources.ticketing.types.PaginatedTeamList; -import com.merge.api.resources.ticketing.types.Team; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TeamsClient { - protected final ClientOptions clientOptions; - - public TeamsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Team objects. - */ - public PaginatedTeamList list() { - return list(TeamsListRequest.builder().build()); - } - - /** - * Returns a list of Team objects. - */ - public PaginatedTeamList list(TeamsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Team objects. - */ - public PaginatedTeamList list(TeamsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/teams"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTeamList.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); - } - } - - /** - * Returns a Team object with the given id. - */ - public Team retrieve(String id) { - return retrieve(id, TeamsRetrieveRequest.builder().build()); - } - - /** - * Returns a Team object with the given id. - */ - public Team retrieve(String id, TeamsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Team object with the given id. - */ - public Team retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/teams") - .addPathSegment(id); - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Team.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/teams/requests/TeamsListRequest.java b/src/main/java/com/merge/api/resources/ticketing/teams/requests/TeamsListRequest.java deleted file mode 100644 index 563112ad2..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/teams/requests/TeamsListRequest.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.teams.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TeamsListRequest.Builder.class) -public final class TeamsListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private TeamsListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TeamsListRequest && equalTo((TeamsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TeamsListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TeamsListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public TeamsListRequest build() { - return new TeamsListRequest( - createdAfter, - createdBefore, - cursor, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/teams/requests/TeamsRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/teams/requests/TeamsRetrieveRequest.java deleted file mode 100644 index 466b6fb63..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/teams/requests/TeamsRetrieveRequest.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.teams.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TeamsRetrieveRequest.Builder.class) -public final class TeamsRetrieveRequest { - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private TeamsRetrieveRequest(Optional includeRemoteData, Map additionalProperties) { - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TeamsRetrieveRequest && equalTo((TeamsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TeamsRetrieveRequest other) { - return includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TeamsRetrieveRequest other) { - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public TeamsRetrieveRequest build() { - return new TeamsRetrieveRequest(includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/TicketsClient.java b/src/main/java/com/merge/api/resources/ticketing/tickets/TicketsClient.java deleted file mode 100644 index 1db4eccbc..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/TicketsClient.java +++ /dev/null @@ -1,618 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.tickets; - -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.tickets.requests.PatchedTicketEndpointRequest; -import com.merge.api.resources.ticketing.tickets.requests.TicketEndpointRequest; -import com.merge.api.resources.ticketing.tickets.requests.TicketsListRequest; -import com.merge.api.resources.ticketing.tickets.requests.TicketsRemoteFieldClassesListRequest; -import com.merge.api.resources.ticketing.tickets.requests.TicketsRetrieveRequest; -import com.merge.api.resources.ticketing.tickets.requests.TicketsViewersListRequest; -import com.merge.api.resources.ticketing.types.MetaResponse; -import com.merge.api.resources.ticketing.types.PaginatedRemoteFieldClassList; -import com.merge.api.resources.ticketing.types.PaginatedTicketList; -import com.merge.api.resources.ticketing.types.PaginatedViewerList; -import com.merge.api.resources.ticketing.types.Ticket; -import com.merge.api.resources.ticketing.types.TicketResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class TicketsClient { - protected final ClientOptions clientOptions; - - public TicketsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of Ticket objects. - */ - public PaginatedTicketList list() { - return list(TicketsListRequest.builder().build()); - } - - /** - * Returns a list of Ticket objects. - */ - public PaginatedTicketList list(TicketsListRequest request) { - return list(request, null); - } - - /** - * Returns a list of Ticket objects. - */ - public PaginatedTicketList list(TicketsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets"); - if (request.getAccountId().isPresent()) { - httpUrl.addQueryParameter("account_id", request.getAccountId().get()); - } - if (request.getAssigneeIds().isPresent()) { - httpUrl.addQueryParameter("assignee_ids", request.getAssigneeIds().get()); - } - if (request.getCollectionIds().isPresent()) { - httpUrl.addQueryParameter( - "collection_ids", request.getCollectionIds().get()); - } - if (request.getCompletedAfter().isPresent()) { - httpUrl.addQueryParameter( - "completed_after", request.getCompletedAfter().get().toString()); - } - if (request.getCompletedBefore().isPresent()) { - httpUrl.addQueryParameter( - "completed_before", request.getCompletedBefore().get().toString()); - } - if (request.getContactId().isPresent()) { - httpUrl.addQueryParameter("contact_id", request.getContactId().get()); - } - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getDueAfter().isPresent()) { - httpUrl.addQueryParameter("due_after", request.getDueAfter().get().toString()); - } - if (request.getDueBefore().isPresent()) { - httpUrl.addQueryParameter("due_before", request.getDueBefore().get().toString()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getParentTicketId().isPresent()) { - httpUrl.addQueryParameter( - "parent_ticket_id", request.getParentTicketId().get()); - } - if (request.getPriority().isPresent()) { - httpUrl.addQueryParameter("priority", request.getPriority().get().toString()); - } - if (request.getRemoteCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "remote_created_after", - request.getRemoteCreatedAfter().get().toString()); - } - if (request.getRemoteCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "remote_created_before", - request.getRemoteCreatedBefore().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - if (request.getRemoteUpdatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "remote_updated_after", - request.getRemoteUpdatedAfter().get().toString()); - } - if (request.getRemoteUpdatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "remote_updated_before", - request.getRemoteUpdatedBefore().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - if (request.getStatus().isPresent()) { - httpUrl.addQueryParameter("status", request.getStatus().get()); - } - if (request.getTags().isPresent()) { - httpUrl.addQueryParameter("tags", request.getTags().get()); - } - if (request.getTicketType().isPresent()) { - httpUrl.addQueryParameter("ticket_type", request.getTicketType().get()); - } - if (request.getTicketUrl().isPresent()) { - httpUrl.addQueryParameter("ticket_url", request.getTicketUrl().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedTicketList.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); - } - } - - /** - * Creates a Ticket object with the given values. - */ - public TicketResponse create(TicketEndpointRequest request) { - return create(request, null); - } - - /** - * Creates a Ticket object with the given values. - */ - public TicketResponse create(TicketEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets"); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TicketResponse.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); - } - } - - /** - * Returns a Ticket object with the given id. - */ - public Ticket retrieve(String id) { - return retrieve(id, TicketsRetrieveRequest.builder().build()); - } - - /** - * Returns a Ticket object with the given id. - */ - public Ticket retrieve(String id, TicketsRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a Ticket object with the given id. - */ - public Ticket retrieve(String id, TicketsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_fields", - request.getIncludeRemoteFields().get().toString()); - } - if (request.getRemoteFields().isPresent()) { - httpUrl.addQueryParameter( - "remote_fields", request.getRemoteFields().get().toString()); - } - if (request.getShowEnumOrigins().isPresent()) { - httpUrl.addQueryParameter( - "show_enum_origins", request.getShowEnumOrigins().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), Ticket.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); - } - } - - /** - * Updates a Ticket object with the given id. - */ - public TicketResponse partialUpdate(String id, PatchedTicketEndpointRequest request) { - return partialUpdate(id, request, null); - } - - /** - * Updates a Ticket object with the given id. - */ - public TicketResponse partialUpdate( - String id, PatchedTicketEndpointRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets") - .addPathSegment(id); - if (request.getIsDebugMode().isPresent()) { - httpUrl.addQueryParameter( - "is_debug_mode", request.getIsDebugMode().get().toString()); - } - if (request.getRunAsync().isPresent()) { - httpUrl.addQueryParameter("run_async", request.getRunAsync().get().toString()); - } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), TicketResponse.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); - } - } - - /** - * Returns a list of Viewer objects. - */ - public PaginatedViewerList viewersList(String ticketId) { - return viewersList(ticketId, TicketsViewersListRequest.builder().build()); - } - - /** - * Returns a list of Viewer objects. - */ - public PaginatedViewerList viewersList(String ticketId, TicketsViewersListRequest request) { - return viewersList(ticketId, request, null); - } - - /** - * Returns a list of Viewer objects. - */ - public PaginatedViewerList viewersList( - String ticketId, TicketsViewersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets") - .addPathSegment(ticketId) - .addPathSegments("viewers"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedViewerList.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); - } - } - - /** - * Returns metadata for Ticket PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); - } - - /** - * Returns metadata for Ticket PATCHs. - */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets/meta/patch") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns metadata for Ticket POSTs. - */ - public MetaResponse metaPostRetrieve() { - return metaPostRetrieve(null); - } - - /** - * Returns metadata for Ticket POSTs. - */ - public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets/meta/post") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), MetaResponse.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); - } - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList() { - return remoteFieldClassesList( - TicketsRemoteFieldClassesListRequest.builder().build()); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList(TicketsRemoteFieldClassesListRequest request) { - return remoteFieldClassesList(request, null); - } - - /** - * Returns a list of RemoteFieldClass objects. - */ - public PaginatedRemoteFieldClassList remoteFieldClassesList( - TicketsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/tickets/remote-field-classes"); - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getIsCommonModelField().isPresent()) { - httpUrl.addQueryParameter( - "is_common_model_field", - request.getIsCommonModelField().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedRemoteFieldClassList.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestExpand.java deleted file mode 100644 index 0418c1ab0..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestExpand.java +++ /dev/null @@ -1,586 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.tickets.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TicketsListRequestExpand { - ACCOUNT("account"), - - ACCOUNT_CONTACT("account,contact"), - - ACCOUNT_CONTACT_CREATOR("account,contact,creator"), - - ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("account,contact,creator,parent_ticket"), - - ACCOUNT_CONTACT_PARENT_TICKET("account,contact,parent_ticket"), - - ACCOUNT_CREATOR("account,creator"), - - ACCOUNT_CREATOR_PARENT_TICKET("account,creator,parent_ticket"), - - ACCOUNT_PARENT_TICKET("account,parent_ticket"), - - ASSIGNED_TEAMS("assigned_teams"), - - ASSIGNED_TEAMS_ACCOUNT("assigned_teams,account"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT("assigned_teams,account,contact"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("assigned_teams,account,contact,creator"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("assigned_teams,account,contact,creator,parent_ticket"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET("assigned_teams,account,contact,parent_ticket"), - - ASSIGNED_TEAMS_ACCOUNT_CREATOR("assigned_teams,account,creator"), - - ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET("assigned_teams,account,creator,parent_ticket"), - - ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("assigned_teams,account,parent_ticket"), - - ASSIGNED_TEAMS_CONTACT("assigned_teams,contact"), - - ASSIGNED_TEAMS_CONTACT_CREATOR("assigned_teams,contact,creator"), - - ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET("assigned_teams,contact,creator,parent_ticket"), - - ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("assigned_teams,contact,parent_ticket"), - - ASSIGNED_TEAMS_CREATOR("assigned_teams,creator"), - - ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("assigned_teams,creator,parent_ticket"), - - ASSIGNED_TEAMS_PARENT_TICKET("assigned_teams,parent_ticket"), - - ASSIGNEES("assignees"), - - ASSIGNEES_ACCOUNT("assignees,account"), - - ASSIGNEES_ACCOUNT_CONTACT("assignees,account,contact"), - - ASSIGNEES_ACCOUNT_CONTACT_CREATOR("assignees,account,contact,creator"), - - ASSIGNEES_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("assignees,account,contact,creator,parent_ticket"), - - ASSIGNEES_ACCOUNT_CONTACT_PARENT_TICKET("assignees,account,contact,parent_ticket"), - - ASSIGNEES_ACCOUNT_CREATOR("assignees,account,creator"), - - ASSIGNEES_ACCOUNT_CREATOR_PARENT_TICKET("assignees,account,creator,parent_ticket"), - - ASSIGNEES_ACCOUNT_PARENT_TICKET("assignees,account,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS("assignees,assigned_teams"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT("assignees,assigned_teams,account"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT("assignees,assigned_teams,account,contact"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("assignees,assigned_teams,account,contact,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "assignees,assigned_teams,account,contact,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET("assignees,assigned_teams,account,contact,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR("assignees,assigned_teams,account,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET("assignees,assigned_teams,account,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("assignees,assigned_teams,account,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT("assignees,assigned_teams,contact"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR("assignees,assigned_teams,contact,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET("assignees,assigned_teams,contact,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("assignees,assigned_teams,contact,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_CREATOR("assignees,assigned_teams,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("assignees,assigned_teams,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_PARENT_TICKET("assignees,assigned_teams,parent_ticket"), - - ASSIGNEES_COLLECTIONS("assignees,collections"), - - ASSIGNEES_COLLECTIONS_ACCOUNT("assignees,collections,account"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT("assignees,collections,account,contact"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR("assignees,collections,account,contact,creator"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "assignees,collections,account,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET("assignees,collections,account,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR("assignees,collections,account,creator"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET("assignees,collections,account,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_PARENT_TICKET("assignees,collections,account,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS("assignees,collections,assigned_teams"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT("assignees,collections,assigned_teams,account"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("assignees,collections,assigned_teams,account,contact"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "assignees,collections,assigned_teams,account,contact,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,account,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "assignees,collections,assigned_teams,account,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("assignees,collections,assigned_teams,account,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,account,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "assignees,collections,assigned_teams,account,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT("assignees,collections,assigned_teams,contact"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR("assignees,collections,assigned_teams,contact,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "assignees,collections,assigned_teams,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR("assignees,collections,assigned_teams,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET("assignees,collections,assigned_teams,parent_ticket"), - - ASSIGNEES_COLLECTIONS_CONTACT("assignees,collections,contact"), - - ASSIGNEES_COLLECTIONS_CONTACT_CREATOR("assignees,collections,contact,creator"), - - ASSIGNEES_COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET("assignees,collections,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_CONTACT_PARENT_TICKET("assignees,collections,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_CREATOR("assignees,collections,creator"), - - ASSIGNEES_COLLECTIONS_CREATOR_PARENT_TICKET("assignees,collections,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_PARENT_TICKET("assignees,collections,parent_ticket"), - - ASSIGNEES_CONTACT("assignees,contact"), - - ASSIGNEES_CONTACT_CREATOR("assignees,contact,creator"), - - ASSIGNEES_CONTACT_CREATOR_PARENT_TICKET("assignees,contact,creator,parent_ticket"), - - ASSIGNEES_CONTACT_PARENT_TICKET("assignees,contact,parent_ticket"), - - ASSIGNEES_CREATOR("assignees,creator"), - - ASSIGNEES_CREATOR_PARENT_TICKET("assignees,creator,parent_ticket"), - - ASSIGNEES_PARENT_TICKET("assignees,parent_ticket"), - - ATTACHMENTS("attachments"), - - ATTACHMENTS_ACCOUNT("attachments,account"), - - ATTACHMENTS_ACCOUNT_CONTACT("attachments,account,contact"), - - ATTACHMENTS_ACCOUNT_CONTACT_CREATOR("attachments,account,contact,creator"), - - ATTACHMENTS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("attachments,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ACCOUNT_CONTACT_PARENT_TICKET("attachments,account,contact,parent_ticket"), - - ATTACHMENTS_ACCOUNT_CREATOR("attachments,account,creator"), - - ATTACHMENTS_ACCOUNT_CREATOR_PARENT_TICKET("attachments,account,creator,parent_ticket"), - - ATTACHMENTS_ACCOUNT_PARENT_TICKET("attachments,account,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS("attachments,assigned_teams"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT("attachments,assigned_teams,account"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("attachments,assigned_teams,account,contact"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("attachments,assigned_teams,account,contact,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("attachments,assigned_teams,account,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("attachments,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT("attachments,assigned_teams,contact"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT_CREATOR("attachments,assigned_teams,contact,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("attachments,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_CREATOR("attachments,assigned_teams,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("attachments,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_PARENT_TICKET("attachments,assigned_teams,parent_ticket"), - - ATTACHMENTS_ASSIGNEES("attachments,assignees"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT("attachments,assignees,account"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT("attachments,assignees,account,contact"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT_CREATOR("attachments,assignees,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT_PARENT_TICKET("attachments,assignees,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CREATOR("attachments,assignees,account,creator"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CREATOR_PARENT_TICKET("attachments,assignees,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_PARENT_TICKET("attachments,assignees,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS("attachments,assignees,assigned_teams"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT("attachments,assignees,assigned_teams,account"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT("attachments,assignees,assigned_teams,account,contact"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "attachments,assignees,assigned_teams,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR("attachments,assignees,assigned_teams,account,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT("attachments,assignees,assigned_teams,contact"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR("attachments,assignees,assigned_teams,contact,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "attachments,assignees,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CREATOR("attachments,assignees,assigned_teams,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_PARENT_TICKET("attachments,assignees,assigned_teams,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS("attachments,assignees,collections"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT("attachments,assignees,collections,account"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT("attachments,assignees,collections,account,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR( - "attachments,assignees,collections,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assignees,collections,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR("attachments,assignees,collections,account,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_PARENT_TICKET("attachments,assignees,collections,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS("attachments,assignees,collections,assigned_teams"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT( - "attachments,assignees,collections,assigned_teams,account"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT( - "attachments,assignees,collections,assigned_teams,account,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "attachments,assignees,collections,assigned_teams,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR( - "attachments,assignees,collections,assigned_teams,account,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT( - "attachments,assignees,collections,assigned_teams,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR( - "attachments,assignees,collections,assigned_teams,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR( - "attachments,assignees,collections,assigned_teams,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT("attachments,assignees,collections,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT_CREATOR("attachments,assignees,collections,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT_PARENT_TICKET("attachments,assignees,collections,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CREATOR("attachments,assignees,collections,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CREATOR_PARENT_TICKET("attachments,assignees,collections,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_PARENT_TICKET("attachments,assignees,collections,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_CONTACT("attachments,assignees,contact"), - - ATTACHMENTS_ASSIGNEES_CONTACT_CREATOR("attachments,assignees,contact,creator"), - - ATTACHMENTS_ASSIGNEES_CONTACT_CREATOR_PARENT_TICKET("attachments,assignees,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_CONTACT_PARENT_TICKET("attachments,assignees,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_CREATOR("attachments,assignees,creator"), - - ATTACHMENTS_ASSIGNEES_CREATOR_PARENT_TICKET("attachments,assignees,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_PARENT_TICKET("attachments,assignees,parent_ticket"), - - ATTACHMENTS_COLLECTIONS("attachments,collections"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT("attachments,collections,account"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT("attachments,collections,account,contact"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT_CREATOR("attachments,collections,account,contact,creator"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,collections,account,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET("attachments,collections,account,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CREATOR("attachments,collections,account,creator"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET("attachments,collections,account,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_PARENT_TICKET("attachments,collections,account,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS("attachments,collections,assigned_teams"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT("attachments,collections,assigned_teams,account"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("attachments,collections,assigned_teams,account,contact"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "attachments,collections,assigned_teams,account,contact,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,collections,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("attachments,collections,assigned_teams,account,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "attachments,collections,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT("attachments,collections,assigned_teams,contact"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR("attachments,collections,assigned_teams,contact,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "attachments,collections,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CREATOR("attachments,collections,assigned_teams,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET("attachments,collections,assigned_teams,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_CONTACT("attachments,collections,contact"), - - ATTACHMENTS_COLLECTIONS_CONTACT_CREATOR("attachments,collections,contact,creator"), - - ATTACHMENTS_COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET("attachments,collections,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_CONTACT_PARENT_TICKET("attachments,collections,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_CREATOR("attachments,collections,creator"), - - ATTACHMENTS_COLLECTIONS_CREATOR_PARENT_TICKET("attachments,collections,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_PARENT_TICKET("attachments,collections,parent_ticket"), - - ATTACHMENTS_CONTACT("attachments,contact"), - - ATTACHMENTS_CONTACT_CREATOR("attachments,contact,creator"), - - ATTACHMENTS_CONTACT_CREATOR_PARENT_TICKET("attachments,contact,creator,parent_ticket"), - - ATTACHMENTS_CONTACT_PARENT_TICKET("attachments,contact,parent_ticket"), - - ATTACHMENTS_CREATOR("attachments,creator"), - - ATTACHMENTS_CREATOR_PARENT_TICKET("attachments,creator,parent_ticket"), - - ATTACHMENTS_PARENT_TICKET("attachments,parent_ticket"), - - COLLECTIONS("collections"), - - COLLECTIONS_ACCOUNT("collections,account"), - - COLLECTIONS_ACCOUNT_CONTACT("collections,account,contact"), - - COLLECTIONS_ACCOUNT_CONTACT_CREATOR("collections,account,contact,creator"), - - COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("collections,account,contact,creator,parent_ticket"), - - COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET("collections,account,contact,parent_ticket"), - - COLLECTIONS_ACCOUNT_CREATOR("collections,account,creator"), - - COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET("collections,account,creator,parent_ticket"), - - COLLECTIONS_ACCOUNT_PARENT_TICKET("collections,account,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS("collections,assigned_teams"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT("collections,assigned_teams,account"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("collections,assigned_teams,account,contact"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("collections,assigned_teams,account,contact,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "collections,assigned_teams,account,contact,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "collections,assigned_teams,account,contact,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("collections,assigned_teams,account,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "collections,assigned_teams,account,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("collections,assigned_teams,account,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT("collections,assigned_teams,contact"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR("collections,assigned_teams,contact,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "collections,assigned_teams,contact,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("collections,assigned_teams,contact,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_CREATOR("collections,assigned_teams,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("collections,assigned_teams,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET("collections,assigned_teams,parent_ticket"), - - COLLECTIONS_CONTACT("collections,contact"), - - COLLECTIONS_CONTACT_CREATOR("collections,contact,creator"), - - COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET("collections,contact,creator,parent_ticket"), - - COLLECTIONS_CONTACT_PARENT_TICKET("collections,contact,parent_ticket"), - - COLLECTIONS_CREATOR("collections,creator"), - - COLLECTIONS_CREATOR_PARENT_TICKET("collections,creator,parent_ticket"), - - COLLECTIONS_PARENT_TICKET("collections,parent_ticket"), - - CONTACT("contact"), - - CONTACT_CREATOR("contact,creator"), - - CONTACT_CREATOR_PARENT_TICKET("contact,creator,parent_ticket"), - - CONTACT_PARENT_TICKET("contact,parent_ticket"), - - CREATOR("creator"), - - CREATOR_PARENT_TICKET("creator,parent_ticket"), - - PARENT_TICKET("parent_ticket"); - - private final String value; - - TicketsListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestExpand.java deleted file mode 100644 index db93e13a7..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestExpand.java +++ /dev/null @@ -1,586 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.tickets.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TicketsRetrieveRequestExpand { - ACCOUNT("account"), - - ACCOUNT_CONTACT("account,contact"), - - ACCOUNT_CONTACT_CREATOR("account,contact,creator"), - - ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("account,contact,creator,parent_ticket"), - - ACCOUNT_CONTACT_PARENT_TICKET("account,contact,parent_ticket"), - - ACCOUNT_CREATOR("account,creator"), - - ACCOUNT_CREATOR_PARENT_TICKET("account,creator,parent_ticket"), - - ACCOUNT_PARENT_TICKET("account,parent_ticket"), - - ASSIGNED_TEAMS("assigned_teams"), - - ASSIGNED_TEAMS_ACCOUNT("assigned_teams,account"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT("assigned_teams,account,contact"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("assigned_teams,account,contact,creator"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("assigned_teams,account,contact,creator,parent_ticket"), - - ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET("assigned_teams,account,contact,parent_ticket"), - - ASSIGNED_TEAMS_ACCOUNT_CREATOR("assigned_teams,account,creator"), - - ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET("assigned_teams,account,creator,parent_ticket"), - - ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("assigned_teams,account,parent_ticket"), - - ASSIGNED_TEAMS_CONTACT("assigned_teams,contact"), - - ASSIGNED_TEAMS_CONTACT_CREATOR("assigned_teams,contact,creator"), - - ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET("assigned_teams,contact,creator,parent_ticket"), - - ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("assigned_teams,contact,parent_ticket"), - - ASSIGNED_TEAMS_CREATOR("assigned_teams,creator"), - - ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("assigned_teams,creator,parent_ticket"), - - ASSIGNED_TEAMS_PARENT_TICKET("assigned_teams,parent_ticket"), - - ASSIGNEES("assignees"), - - ASSIGNEES_ACCOUNT("assignees,account"), - - ASSIGNEES_ACCOUNT_CONTACT("assignees,account,contact"), - - ASSIGNEES_ACCOUNT_CONTACT_CREATOR("assignees,account,contact,creator"), - - ASSIGNEES_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("assignees,account,contact,creator,parent_ticket"), - - ASSIGNEES_ACCOUNT_CONTACT_PARENT_TICKET("assignees,account,contact,parent_ticket"), - - ASSIGNEES_ACCOUNT_CREATOR("assignees,account,creator"), - - ASSIGNEES_ACCOUNT_CREATOR_PARENT_TICKET("assignees,account,creator,parent_ticket"), - - ASSIGNEES_ACCOUNT_PARENT_TICKET("assignees,account,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS("assignees,assigned_teams"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT("assignees,assigned_teams,account"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT("assignees,assigned_teams,account,contact"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("assignees,assigned_teams,account,contact,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "assignees,assigned_teams,account,contact,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET("assignees,assigned_teams,account,contact,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR("assignees,assigned_teams,account,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET("assignees,assigned_teams,account,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("assignees,assigned_teams,account,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT("assignees,assigned_teams,contact"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR("assignees,assigned_teams,contact,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET("assignees,assigned_teams,contact,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("assignees,assigned_teams,contact,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_CREATOR("assignees,assigned_teams,creator"), - - ASSIGNEES_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("assignees,assigned_teams,creator,parent_ticket"), - - ASSIGNEES_ASSIGNED_TEAMS_PARENT_TICKET("assignees,assigned_teams,parent_ticket"), - - ASSIGNEES_COLLECTIONS("assignees,collections"), - - ASSIGNEES_COLLECTIONS_ACCOUNT("assignees,collections,account"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT("assignees,collections,account,contact"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR("assignees,collections,account,contact,creator"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "assignees,collections,account,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET("assignees,collections,account,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR("assignees,collections,account,creator"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET("assignees,collections,account,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ACCOUNT_PARENT_TICKET("assignees,collections,account,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS("assignees,collections,assigned_teams"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT("assignees,collections,assigned_teams,account"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("assignees,collections,assigned_teams,account,contact"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "assignees,collections,assigned_teams,account,contact,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,account,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "assignees,collections,assigned_teams,account,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("assignees,collections,assigned_teams,account,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,account,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "assignees,collections,assigned_teams,account,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT("assignees,collections,assigned_teams,contact"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR("assignees,collections,assigned_teams,contact,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "assignees,collections,assigned_teams,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR("assignees,collections,assigned_teams,creator"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "assignees,collections,assigned_teams,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET("assignees,collections,assigned_teams,parent_ticket"), - - ASSIGNEES_COLLECTIONS_CONTACT("assignees,collections,contact"), - - ASSIGNEES_COLLECTIONS_CONTACT_CREATOR("assignees,collections,contact,creator"), - - ASSIGNEES_COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET("assignees,collections,contact,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_CONTACT_PARENT_TICKET("assignees,collections,contact,parent_ticket"), - - ASSIGNEES_COLLECTIONS_CREATOR("assignees,collections,creator"), - - ASSIGNEES_COLLECTIONS_CREATOR_PARENT_TICKET("assignees,collections,creator,parent_ticket"), - - ASSIGNEES_COLLECTIONS_PARENT_TICKET("assignees,collections,parent_ticket"), - - ASSIGNEES_CONTACT("assignees,contact"), - - ASSIGNEES_CONTACT_CREATOR("assignees,contact,creator"), - - ASSIGNEES_CONTACT_CREATOR_PARENT_TICKET("assignees,contact,creator,parent_ticket"), - - ASSIGNEES_CONTACT_PARENT_TICKET("assignees,contact,parent_ticket"), - - ASSIGNEES_CREATOR("assignees,creator"), - - ASSIGNEES_CREATOR_PARENT_TICKET("assignees,creator,parent_ticket"), - - ASSIGNEES_PARENT_TICKET("assignees,parent_ticket"), - - ATTACHMENTS("attachments"), - - ATTACHMENTS_ACCOUNT("attachments,account"), - - ATTACHMENTS_ACCOUNT_CONTACT("attachments,account,contact"), - - ATTACHMENTS_ACCOUNT_CONTACT_CREATOR("attachments,account,contact,creator"), - - ATTACHMENTS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("attachments,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ACCOUNT_CONTACT_PARENT_TICKET("attachments,account,contact,parent_ticket"), - - ATTACHMENTS_ACCOUNT_CREATOR("attachments,account,creator"), - - ATTACHMENTS_ACCOUNT_CREATOR_PARENT_TICKET("attachments,account,creator,parent_ticket"), - - ATTACHMENTS_ACCOUNT_PARENT_TICKET("attachments,account,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS("attachments,assigned_teams"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT("attachments,assigned_teams,account"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("attachments,assigned_teams,account,contact"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("attachments,assigned_teams,account,contact,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("attachments,assigned_teams,account,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("attachments,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT("attachments,assigned_teams,contact"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT_CREATOR("attachments,assigned_teams,contact,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("attachments,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_CREATOR("attachments,assigned_teams,creator"), - - ATTACHMENTS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("attachments,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNED_TEAMS_PARENT_TICKET("attachments,assigned_teams,parent_ticket"), - - ATTACHMENTS_ASSIGNEES("attachments,assignees"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT("attachments,assignees,account"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT("attachments,assignees,account,contact"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT_CREATOR("attachments,assignees,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CONTACT_PARENT_TICKET("attachments,assignees,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CREATOR("attachments,assignees,account,creator"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_CREATOR_PARENT_TICKET("attachments,assignees,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ACCOUNT_PARENT_TICKET("attachments,assignees,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS("attachments,assignees,assigned_teams"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT("attachments,assignees,assigned_teams,account"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT("attachments,assignees,assigned_teams,account,contact"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "attachments,assignees,assigned_teams,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR("attachments,assignees,assigned_teams,account,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "attachments,assignees,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT("attachments,assignees,assigned_teams,contact"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR("attachments,assignees,assigned_teams,contact,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "attachments,assignees,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CREATOR("attachments,assignees,assigned_teams,creator"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "attachments,assignees,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_ASSIGNED_TEAMS_PARENT_TICKET("attachments,assignees,assigned_teams,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS("attachments,assignees,collections"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT("attachments,assignees,collections,account"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT("attachments,assignees,collections,account,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR( - "attachments,assignees,collections,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assignees,collections,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR("attachments,assignees,collections,account,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ACCOUNT_PARENT_TICKET("attachments,assignees,collections,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS("attachments,assignees,collections,assigned_teams"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT( - "attachments,assignees,collections,assigned_teams,account"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT( - "attachments,assignees,collections,assigned_teams,account,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "attachments,assignees,collections,assigned_teams,account,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR( - "attachments,assignees,collections,assigned_teams,account,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT( - "attachments,assignees,collections,assigned_teams,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR( - "attachments,assignees,collections,assigned_teams,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR( - "attachments,assignees,collections,assigned_teams,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET( - "attachments,assignees,collections,assigned_teams,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT("attachments,assignees,collections,contact"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT_CREATOR("attachments,assignees,collections,contact,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,assignees,collections,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CONTACT_PARENT_TICKET("attachments,assignees,collections,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CREATOR("attachments,assignees,collections,creator"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_CREATOR_PARENT_TICKET("attachments,assignees,collections,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_COLLECTIONS_PARENT_TICKET("attachments,assignees,collections,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_CONTACT("attachments,assignees,contact"), - - ATTACHMENTS_ASSIGNEES_CONTACT_CREATOR("attachments,assignees,contact,creator"), - - ATTACHMENTS_ASSIGNEES_CONTACT_CREATOR_PARENT_TICKET("attachments,assignees,contact,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_CONTACT_PARENT_TICKET("attachments,assignees,contact,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_CREATOR("attachments,assignees,creator"), - - ATTACHMENTS_ASSIGNEES_CREATOR_PARENT_TICKET("attachments,assignees,creator,parent_ticket"), - - ATTACHMENTS_ASSIGNEES_PARENT_TICKET("attachments,assignees,parent_ticket"), - - ATTACHMENTS_COLLECTIONS("attachments,collections"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT("attachments,collections,account"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT("attachments,collections,account,contact"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT_CREATOR("attachments,collections,account,contact,creator"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,collections,account,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET("attachments,collections,account,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CREATOR("attachments,collections,account,creator"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET("attachments,collections,account,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ACCOUNT_PARENT_TICKET("attachments,collections,account,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS("attachments,collections,assigned_teams"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT("attachments,collections,assigned_teams,account"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("attachments,collections,assigned_teams,account,contact"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR( - "attachments,collections,assigned_teams,account,contact,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,account,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "attachments,collections,assigned_teams,account,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("attachments,collections,assigned_teams,account,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,account,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET( - "attachments,collections,assigned_teams,account,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT("attachments,collections,assigned_teams,contact"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR("attachments,collections,assigned_teams,contact,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET( - "attachments,collections,assigned_teams,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CREATOR("attachments,collections,assigned_teams,creator"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET( - "attachments,collections,assigned_teams,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET("attachments,collections,assigned_teams,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_CONTACT("attachments,collections,contact"), - - ATTACHMENTS_COLLECTIONS_CONTACT_CREATOR("attachments,collections,contact,creator"), - - ATTACHMENTS_COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET("attachments,collections,contact,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_CONTACT_PARENT_TICKET("attachments,collections,contact,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_CREATOR("attachments,collections,creator"), - - ATTACHMENTS_COLLECTIONS_CREATOR_PARENT_TICKET("attachments,collections,creator,parent_ticket"), - - ATTACHMENTS_COLLECTIONS_PARENT_TICKET("attachments,collections,parent_ticket"), - - ATTACHMENTS_CONTACT("attachments,contact"), - - ATTACHMENTS_CONTACT_CREATOR("attachments,contact,creator"), - - ATTACHMENTS_CONTACT_CREATOR_PARENT_TICKET("attachments,contact,creator,parent_ticket"), - - ATTACHMENTS_CONTACT_PARENT_TICKET("attachments,contact,parent_ticket"), - - ATTACHMENTS_CREATOR("attachments,creator"), - - ATTACHMENTS_CREATOR_PARENT_TICKET("attachments,creator,parent_ticket"), - - ATTACHMENTS_PARENT_TICKET("attachments,parent_ticket"), - - COLLECTIONS("collections"), - - COLLECTIONS_ACCOUNT("collections,account"), - - COLLECTIONS_ACCOUNT_CONTACT("collections,account,contact"), - - COLLECTIONS_ACCOUNT_CONTACT_CREATOR("collections,account,contact,creator"), - - COLLECTIONS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET("collections,account,contact,creator,parent_ticket"), - - COLLECTIONS_ACCOUNT_CONTACT_PARENT_TICKET("collections,account,contact,parent_ticket"), - - COLLECTIONS_ACCOUNT_CREATOR("collections,account,creator"), - - COLLECTIONS_ACCOUNT_CREATOR_PARENT_TICKET("collections,account,creator,parent_ticket"), - - COLLECTIONS_ACCOUNT_PARENT_TICKET("collections,account,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS("collections,assigned_teams"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT("collections,assigned_teams,account"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT("collections,assigned_teams,account,contact"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR("collections,assigned_teams,account,contact,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_CREATOR_PARENT_TICKET( - "collections,assigned_teams,account,contact,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CONTACT_PARENT_TICKET( - "collections,assigned_teams,account,contact,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR("collections,assigned_teams,account,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_CREATOR_PARENT_TICKET( - "collections,assigned_teams,account,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_ACCOUNT_PARENT_TICKET("collections,assigned_teams,account,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT("collections,assigned_teams,contact"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR("collections,assigned_teams,contact,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT_CREATOR_PARENT_TICKET( - "collections,assigned_teams,contact,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_CONTACT_PARENT_TICKET("collections,assigned_teams,contact,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_CREATOR("collections,assigned_teams,creator"), - - COLLECTIONS_ASSIGNED_TEAMS_CREATOR_PARENT_TICKET("collections,assigned_teams,creator,parent_ticket"), - - COLLECTIONS_ASSIGNED_TEAMS_PARENT_TICKET("collections,assigned_teams,parent_ticket"), - - COLLECTIONS_CONTACT("collections,contact"), - - COLLECTIONS_CONTACT_CREATOR("collections,contact,creator"), - - COLLECTIONS_CONTACT_CREATOR_PARENT_TICKET("collections,contact,creator,parent_ticket"), - - COLLECTIONS_CONTACT_PARENT_TICKET("collections,contact,parent_ticket"), - - COLLECTIONS_CREATOR("collections,creator"), - - COLLECTIONS_CREATOR_PARENT_TICKET("collections,creator,parent_ticket"), - - COLLECTIONS_PARENT_TICKET("collections,parent_ticket"), - - CONTACT("contact"), - - CONTACT_CREATOR("contact,creator"), - - CONTACT_CREATOR_PARENT_TICKET("contact,creator,parent_ticket"), - - CONTACT_PARENT_TICKET("contact,parent_ticket"), - - CREATOR("creator"), - - CREATOR_PARENT_TICKET("creator,parent_ticket"), - - PARENT_TICKET("parent_ticket"); - - private final String value; - - TicketsRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsViewersListRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsViewersListRequestExpand.java deleted file mode 100644 index 60c2fe992..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsViewersListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.tickets.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum TicketsViewersListRequestExpand { - TEAM("team"), - - USER("user"), - - USER_TEAM("user,team"); - - private final String value; - - TicketsViewersListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Account.java b/src/main/java/com/merge/api/resources/ticketing/types/Account.java deleted file mode 100644 index 3e6c5631a..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/Account.java +++ /dev/null @@ -1,329 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Account.Builder.class) -public final class Account { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional>> domains; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Account( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional>> domains, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.domains = domains; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The account's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The account's domain names. - */ - @JsonProperty("domains") - public Optional>> getDomains() { - return domains; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Account && equalTo((Account) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Account other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && domains.equals(other.domains) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.domains, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional>> domains = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Account other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - domains(other.getDomains()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "domains", nulls = Nulls.SKIP) - public Builder domains(Optional>> domains) { - this.domains = domains; - return this; - } - - public Builder domains(List> domains) { - this.domains = Optional.ofNullable(domains); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Account build() { - return new Account( - id, - remoteId, - createdAt, - modifiedAt, - name, - domains, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetails.java b/src/main/java/com/merge/api/resources/ticketing/types/AccountDetails.java deleted file mode 100644 index 9e71de3cc..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetails.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetails.Builder.class) -public final class AccountDetails { - private final Optional id; - - private final Optional integration; - - private final Optional integrationSlug; - - private final Optional category; - - private final Optional endUserOriginId; - - private final Optional endUserOrganizationName; - - private final Optional endUserEmailAddress; - - private final Optional status; - - private final Optional webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional accountType; - - private final Optional completedAt; - - private final Map additionalProperties; - - private AccountDetails( - Optional id, - Optional integration, - Optional integrationSlug, - Optional category, - Optional endUserOriginId, - Optional endUserOrganizationName, - Optional endUserEmailAddress, - Optional status, - Optional webhookListenerUrl, - Optional isDuplicate, - Optional accountType, - Optional completedAt, - Map additionalProperties) { - this.id = id; - this.integration = integration; - this.integrationSlug = integrationSlug; - this.category = category; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.status = status; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("integration_slug") - public Optional getIntegrationSlug() { - return integrationSlug; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public Optional getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public Optional getEndUserEmailAddress() { - return endUserEmailAddress; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("webhook_listener_url") - public Optional getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("account_type") - public Optional getAccountType() { - return accountType; - } - - /** - * @return The time at which account completes the linking flow. - */ - @JsonProperty("completed_at") - public Optional getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetails && equalTo((AccountDetails) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetails other) { - return id.equals(other.id) - && integration.equals(other.integration) - && integrationSlug.equals(other.integrationSlug) - && category.equals(other.category) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && status.equals(other.status) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.integration, - this.integrationSlug, - this.category, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.status, - this.webhookListenerUrl, - this.isDuplicate, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional integration = Optional.empty(); - - private Optional integrationSlug = Optional.empty(); - - private Optional category = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional endUserOrganizationName = Optional.empty(); - - private Optional endUserEmailAddress = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional webhookListenerUrl = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional accountType = Optional.empty(); - - private Optional completedAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountDetails other) { - id(other.getId()); - integration(other.getIntegration()); - integrationSlug(other.getIntegrationSlug()); - category(other.getCategory()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - status(other.getStatus()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public Builder integration(Optional integration) { - this.integration = integration; - return this; - } - - public Builder integration(String integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) - public Builder integrationSlug(Optional integrationSlug) { - this.integrationSlug = integrationSlug; - return this; - } - - public Builder integrationSlug(String integrationSlug) { - this.integrationSlug = Optional.ofNullable(integrationSlug); - return this; - } - - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { - this.category = category; - return this; - } - - public Builder category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public Builder endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - public Builder endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) - public Builder endUserOrganizationName(Optional endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - public Builder endUserOrganizationName(String endUserOrganizationName) { - this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); - return this; - } - - @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) - public Builder endUserEmailAddress(Optional endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - public Builder endUserEmailAddress(String endUserEmailAddress) { - this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); - return this; - } - - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(String status) { - this.status = Optional.ofNullable(status); - return this; - } - - @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) - public Builder webhookListenerUrl(Optional webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - public Builder webhookListenerUrl(String webhookListenerUrl) { - this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); - return this; - } - - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public Builder isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - public Builder isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @JsonSetter(value = "account_type", nulls = Nulls.SKIP) - public Builder accountType(Optional accountType) { - this.accountType = accountType; - return this; - } - - public Builder accountType(String accountType) { - this.accountType = Optional.ofNullable(accountType); - return this; - } - - @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) - public Builder completedAt(Optional completedAt) { - this.completedAt = completedAt; - return this; - } - - public Builder completedAt(OffsetDateTime completedAt) { - this.completedAt = Optional.ofNullable(completedAt); - return this; - } - - public AccountDetails build() { - return new AccountDetails( - id, - integration, - integrationSlug, - category, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - status, - webhookListenerUrl, - isDuplicate, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActions.java deleted file mode 100644 index ac67f3597..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActions.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) -public final class AccountDetailsAndActions { - private final String id; - - private final Optional category; - - private final AccountDetailsAndActionsStatusEnum status; - - private final Optional statusDetail; - - private final Optional endUserOriginId; - - private final String endUserOrganizationName; - - private final String endUserEmailAddress; - - private final Optional subdomain; - - private final String webhookListenerUrl; - - private final Optional isDuplicate; - - private final Optional integration; - - private final String accountType; - - private final OffsetDateTime completedAt; - - private final Map additionalProperties; - - private AccountDetailsAndActions( - String id, - Optional category, - AccountDetailsAndActionsStatusEnum status, - Optional statusDetail, - Optional endUserOriginId, - String endUserOrganizationName, - String endUserEmailAddress, - Optional subdomain, - String webhookListenerUrl, - Optional isDuplicate, - Optional integration, - String accountType, - OffsetDateTime completedAt, - Map additionalProperties) { - this.id = id; - this.category = category; - this.status = status; - this.statusDetail = statusDetail; - this.endUserOriginId = endUserOriginId; - this.endUserOrganizationName = endUserOrganizationName; - this.endUserEmailAddress = endUserEmailAddress; - this.subdomain = subdomain; - this.webhookListenerUrl = webhookListenerUrl; - this.isDuplicate = isDuplicate; - this.integration = integration; - this.accountType = accountType; - this.completedAt = completedAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("category") - public Optional getCategory() { - return category; - } - - @JsonProperty("status") - public AccountDetailsAndActionsStatusEnum getStatus() { - return status; - } - - @JsonProperty("status_detail") - public Optional getStatusDetail() { - return statusDetail; - } - - @JsonProperty("end_user_origin_id") - public Optional getEndUserOriginId() { - return endUserOriginId; - } - - @JsonProperty("end_user_organization_name") - public String getEndUserOrganizationName() { - return endUserOrganizationName; - } - - @JsonProperty("end_user_email_address") - public String getEndUserEmailAddress() { - return endUserEmailAddress; - } - - /** - * @return The tenant or domain the customer has provided access to. - */ - @JsonProperty("subdomain") - public Optional getSubdomain() { - return subdomain; - } - - @JsonProperty("webhook_listener_url") - public String getWebhookListenerUrl() { - return webhookListenerUrl; - } - - /** - * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. - */ - @JsonProperty("is_duplicate") - public Optional getIsDuplicate() { - return isDuplicate; - } - - @JsonProperty("integration") - public Optional getIntegration() { - return integration; - } - - @JsonProperty("account_type") - public String getAccountType() { - return accountType; - } - - @JsonProperty("completed_at") - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActions other) { - return id.equals(other.id) - && category.equals(other.category) - && status.equals(other.status) - && statusDetail.equals(other.statusDetail) - && endUserOriginId.equals(other.endUserOriginId) - && endUserOrganizationName.equals(other.endUserOrganizationName) - && endUserEmailAddress.equals(other.endUserEmailAddress) - && subdomain.equals(other.subdomain) - && webhookListenerUrl.equals(other.webhookListenerUrl) - && isDuplicate.equals(other.isDuplicate) - && integration.equals(other.integration) - && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.category, - this.status, - this.statusDetail, - this.endUserOriginId, - this.endUserOrganizationName, - this.endUserEmailAddress, - this.subdomain, - this.webhookListenerUrl, - this.isDuplicate, - this.integration, - this.accountType, - this.completedAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - StatusStage id(@NotNull String id); - - Builder from(AccountDetailsAndActions other); - } - - public interface StatusStage { - EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); - } - - public interface EndUserOrganizationNameStage { - EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); - } - - public interface EndUserEmailAddressStage { - WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); - } - - public interface WebhookListenerUrlStage { - AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); - } - - public interface AccountTypeStage { - CompletedAtStage accountType(@NotNull String accountType); - } - - public interface CompletedAtStage { - _FinalStage completedAt(@NotNull OffsetDateTime completedAt); - } - - public interface _FinalStage { - AccountDetailsAndActions build(); - - _FinalStage category(Optional category); - - _FinalStage category(CategoryEnum category); - - _FinalStage statusDetail(Optional statusDetail); - - _FinalStage statusDetail(String statusDetail); - - _FinalStage endUserOriginId(Optional endUserOriginId); - - _FinalStage endUserOriginId(String endUserOriginId); - - _FinalStage subdomain(Optional subdomain); - - _FinalStage subdomain(String subdomain); - - _FinalStage isDuplicate(Optional isDuplicate); - - _FinalStage isDuplicate(Boolean isDuplicate); - - _FinalStage integration(Optional integration); - - _FinalStage integration(AccountDetailsAndActionsIntegration integration); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements IdStage, - StatusStage, - EndUserOrganizationNameStage, - EndUserEmailAddressStage, - WebhookListenerUrlStage, - AccountTypeStage, - CompletedAtStage, - _FinalStage { - private String id; - - private AccountDetailsAndActionsStatusEnum status; - - private String endUserOrganizationName; - - private String endUserEmailAddress; - - private String webhookListenerUrl; - - private String accountType; - - private OffsetDateTime completedAt; - - private Optional integration = Optional.empty(); - - private Optional isDuplicate = Optional.empty(); - - private Optional subdomain = Optional.empty(); - - private Optional endUserOriginId = Optional.empty(); - - private Optional statusDetail = Optional.empty(); - - private Optional category = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActions other) { - id(other.getId()); - category(other.getCategory()); - status(other.getStatus()); - statusDetail(other.getStatusDetail()); - endUserOriginId(other.getEndUserOriginId()); - endUserOrganizationName(other.getEndUserOrganizationName()); - endUserEmailAddress(other.getEndUserEmailAddress()); - subdomain(other.getSubdomain()); - webhookListenerUrl(other.getWebhookListenerUrl()); - isDuplicate(other.getIsDuplicate()); - integration(other.getIntegration()); - accountType(other.getAccountType()); - completedAt(other.getCompletedAt()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public StatusStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_organization_name") - public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { - this.endUserOrganizationName = endUserOrganizationName; - return this; - } - - @java.lang.Override - @JsonSetter("end_user_email_address") - public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { - this.endUserEmailAddress = endUserEmailAddress; - return this; - } - - @java.lang.Override - @JsonSetter("webhook_listener_url") - public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { - this.webhookListenerUrl = webhookListenerUrl; - return this; - } - - @java.lang.Override - @JsonSetter("account_type") - public CompletedAtStage accountType(@NotNull String accountType) { - this.accountType = accountType; - return this; - } - - @java.lang.Override - @JsonSetter("completed_at") - public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - @java.lang.Override - public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { - this.integration = Optional.ofNullable(integration); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration", nulls = Nulls.SKIP) - public _FinalStage integration(Optional integration) { - this.integration = integration; - return this; - } - - /** - *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage isDuplicate(Boolean isDuplicate) { - this.isDuplicate = Optional.ofNullable(isDuplicate); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) - public _FinalStage isDuplicate(Optional isDuplicate) { - this.isDuplicate = isDuplicate; - return this; - } - - /** - *

The tenant or domain the customer has provided access to.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage subdomain(String subdomain) { - this.subdomain = Optional.ofNullable(subdomain); - return this; - } - - @java.lang.Override - @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) - public _FinalStage subdomain(Optional subdomain) { - this.subdomain = subdomain; - return this; - } - - @java.lang.Override - public _FinalStage endUserOriginId(String endUserOriginId) { - this.endUserOriginId = Optional.ofNullable(endUserOriginId); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) - public _FinalStage endUserOriginId(Optional endUserOriginId) { - this.endUserOriginId = endUserOriginId; - return this; - } - - @java.lang.Override - public _FinalStage statusDetail(String statusDetail) { - this.statusDetail = Optional.ofNullable(statusDetail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) - public _FinalStage statusDetail(Optional statusDetail) { - this.statusDetail = statusDetail; - return this; - } - - @java.lang.Override - public _FinalStage category(CategoryEnum category) { - this.category = Optional.ofNullable(category); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category", nulls = Nulls.SKIP) - public _FinalStage category(Optional category) { - this.category = category; - return this; - } - - @java.lang.Override - public AccountDetailsAndActions build() { - return new AccountDetailsAndActions( - id, - category, - status, - statusDetail, - endUserOriginId, - endUserOrganizationName, - endUserEmailAddress, - subdomain, - webhookListenerUrl, - isDuplicate, - integration, - accountType, - completedAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActionsIntegration.java deleted file mode 100644 index 4256c68b3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActionsIntegration.java +++ /dev/null @@ -1,328 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) -public final class AccountDetailsAndActionsIntegration { - private final String name; - - private final List categories; - - private final Optional image; - - private final Optional squareImage; - - private final String color; - - private final String slug; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AccountDetailsAndActionsIntegration( - String name, - List categories, - Optional image, - Optional squareImage, - String color, - String slug, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.name = name; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - @JsonProperty("image") - public Optional getImage() { - return image; - } - - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - @JsonProperty("color") - public String getColor() { - return color; - } - - @JsonProperty("slug") - public String getSlug() { - return slug; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountDetailsAndActionsIntegration - && equalTo((AccountDetailsAndActionsIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountDetailsAndActionsIntegration other) { - return name.equals(other.name) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.passthroughAvailable, - this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - ColorStage name(@NotNull String name); - - Builder from(AccountDetailsAndActionsIntegration other); - } - - public interface ColorStage { - SlugStage color(@NotNull String color); - } - - public interface SlugStage { - PassthroughAvailableStage slug(@NotNull String slug); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AccountDetailsAndActionsIntegration build(); - - _FinalStage categories(List categories); - - _FinalStage addCategories(CategoriesEnum categories); - - _FinalStage addAllCategories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { - private String name; - - private String color; - - private String slug; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private List categories = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountDetailsAndActionsIntegration other) { - name(other.getName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public ColorStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("color") - public SlugStage color(@NotNull String color) { - this.color = color; - return this; - } - - @java.lang.Override - @JsonSetter("slug") - public PassthroughAvailableStage slug(@NotNull String slug) { - this.slug = slug; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public _FinalStage addCategories(CategoriesEnum categories) { - this.categories.add(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - @java.lang.Override - public AccountDetailsAndActionsIntegration build() { - return new AccountDetailsAndActionsIntegration( - name, - categories, - image, - squareImage, - color, - slug, - passthroughAvailable, - availableModelOperations, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActionsStatusEnum.java deleted file mode 100644 index 4ee737bcc..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AccountDetailsAndActionsStatusEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AccountDetailsAndActionsStatusEnum { - COMPLETE("COMPLETE"), - - INCOMPLETE("INCOMPLETE"), - - RELINK_NEEDED("RELINK_NEEDED"), - - IDLE("IDLE"); - - private final String value; - - AccountDetailsAndActionsStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AccountIntegration.java b/src/main/java/com/merge/api/resources/ticketing/types/AccountIntegration.java deleted file mode 100644 index 8fe667026..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AccountIntegration.java +++ /dev/null @@ -1,463 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountIntegration.Builder.class) -public final class AccountIntegration { - private final String name; - - private final Optional abbreviatedName; - - private final Optional> categories; - - private final Optional image; - - private final Optional squareImage; - - private final Optional color; - - private final Optional slug; - - private final Optional> apiEndpointsToDocumentationUrls; - - private final Optional webhookSetupGuideUrl; - - private final Optional> categoryBetaStatus; - - private final Map additionalProperties; - - private AccountIntegration( - String name, - Optional abbreviatedName, - Optional> categories, - Optional image, - Optional squareImage, - Optional color, - Optional slug, - Optional> apiEndpointsToDocumentationUrls, - Optional webhookSetupGuideUrl, - Optional> categoryBetaStatus, - Map additionalProperties) { - this.name = name; - this.abbreviatedName = abbreviatedName; - this.categories = categories; - this.image = image; - this.squareImage = squareImage; - this.color = color; - this.slug = slug; - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - this.categoryBetaStatus = categoryBetaStatus; - this.additionalProperties = additionalProperties; - } - - /** - * @return Company name. - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> - */ - @JsonProperty("abbreviated_name") - public Optional getAbbreviatedName() { - return abbreviatedName; - } - - /** - * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. - */ - @JsonProperty("categories") - public Optional> getCategories() { - return categories; - } - - /** - * @return Company logo in rectangular shape. - */ - @JsonProperty("image") - public Optional getImage() { - return image; - } - - /** - * @return Company logo in square shape. - */ - @JsonProperty("square_image") - public Optional getSquareImage() { - return squareImage; - } - - /** - * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> - */ - @JsonProperty("color") - public Optional getColor() { - return color; - } - - @JsonProperty("slug") - public Optional getSlug() { - return slug; - } - - /** - * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} - */ - @JsonProperty("api_endpoints_to_documentation_urls") - public Optional> getApiEndpointsToDocumentationUrls() { - return apiEndpointsToDocumentationUrls; - } - - /** - * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. - */ - @JsonProperty("webhook_setup_guide_url") - public Optional getWebhookSetupGuideUrl() { - return webhookSetupGuideUrl; - } - - /** - * @return Category or categories this integration is in beta status for. - */ - @JsonProperty("category_beta_status") - public Optional> getCategoryBetaStatus() { - return categoryBetaStatus; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountIntegration && equalTo((AccountIntegration) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountIntegration other) { - return name.equals(other.name) - && abbreviatedName.equals(other.abbreviatedName) - && categories.equals(other.categories) - && image.equals(other.image) - && squareImage.equals(other.squareImage) - && color.equals(other.color) - && slug.equals(other.slug) - && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) - && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) - && categoryBetaStatus.equals(other.categoryBetaStatus); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.abbreviatedName, - this.categories, - this.image, - this.squareImage, - this.color, - this.slug, - this.apiEndpointsToDocumentationUrls, - this.webhookSetupGuideUrl, - this.categoryBetaStatus); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - _FinalStage name(@NotNull String name); - - Builder from(AccountIntegration other); - } - - public interface _FinalStage { - AccountIntegration build(); - - _FinalStage abbreviatedName(Optional abbreviatedName); - - _FinalStage abbreviatedName(String abbreviatedName); - - _FinalStage categories(Optional> categories); - - _FinalStage categories(List categories); - - _FinalStage image(Optional image); - - _FinalStage image(String image); - - _FinalStage squareImage(Optional squareImage); - - _FinalStage squareImage(String squareImage); - - _FinalStage color(Optional color); - - _FinalStage color(String color); - - _FinalStage slug(Optional slug); - - _FinalStage slug(String slug); - - _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); - - _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); - - _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); - - _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); - - _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); - - _FinalStage categoryBetaStatus(Map categoryBetaStatus); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, _FinalStage { - private String name; - - private Optional> categoryBetaStatus = Optional.empty(); - - private Optional webhookSetupGuideUrl = Optional.empty(); - - private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); - - private Optional slug = Optional.empty(); - - private Optional color = Optional.empty(); - - private Optional squareImage = Optional.empty(); - - private Optional image = Optional.empty(); - - private Optional> categories = Optional.empty(); - - private Optional abbreviatedName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountIntegration other) { - name(other.getName()); - abbreviatedName(other.getAbbreviatedName()); - categories(other.getCategories()); - image(other.getImage()); - squareImage(other.getSquareImage()); - color(other.getColor()); - slug(other.getSlug()); - apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); - webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); - categoryBetaStatus(other.getCategoryBetaStatus()); - return this; - } - - /** - *

Company name.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public _FinalStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

Category or categories this integration is in beta status for.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { - this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); - return this; - } - - @java.lang.Override - @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) - public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { - this.categoryBetaStatus = categoryBetaStatus; - return this; - } - - /** - *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) - public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { - this.webhookSetupGuideUrl = webhookSetupGuideUrl; - return this; - } - - /** - *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); - return this; - } - - @java.lang.Override - @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) - public _FinalStage apiEndpointsToDocumentationUrls( - Optional> apiEndpointsToDocumentationUrls) { - this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; - return this; - } - - @java.lang.Override - public _FinalStage slug(String slug) { - this.slug = Optional.ofNullable(slug); - return this; - } - - @java.lang.Override - @JsonSetter(value = "slug", nulls = Nulls.SKIP) - public _FinalStage slug(Optional slug) { - this.slug = slug; - return this; - } - - /** - *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage color(String color) { - this.color = Optional.ofNullable(color); - return this; - } - - @java.lang.Override - @JsonSetter(value = "color", nulls = Nulls.SKIP) - public _FinalStage color(Optional color) { - this.color = color; - return this; - } - - /** - *

Company logo in square shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage squareImage(String squareImage) { - this.squareImage = Optional.ofNullable(squareImage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "square_image", nulls = Nulls.SKIP) - public _FinalStage squareImage(Optional squareImage) { - this.squareImage = squareImage; - return this; - } - - /** - *

Company logo in rectangular shape.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage image(String image) { - this.image = Optional.ofNullable(image); - return this; - } - - @java.lang.Override - @JsonSetter(value = "image", nulls = Nulls.SKIP) - public _FinalStage image(Optional image) { - this.image = image; - return this; - } - - /** - *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage categories(List categories) { - this.categories = Optional.ofNullable(categories); - return this; - } - - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(Optional> categories) { - this.categories = categories; - return this; - } - - /** - *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage abbreviatedName(String abbreviatedName) { - this.abbreviatedName = Optional.ofNullable(abbreviatedName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) - public _FinalStage abbreviatedName(Optional abbreviatedName) { - this.abbreviatedName = abbreviatedName; - return this; - } - - @java.lang.Override - public AccountIntegration build() { - return new AccountIntegration( - name, - abbreviatedName, - categories, - image, - squareImage, - color, - slug, - apiEndpointsToDocumentationUrls, - webhookSetupGuideUrl, - categoryBetaStatus, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AccountToken.java b/src/main/java/com/merge/api/resources/ticketing/types/AccountToken.java deleted file mode 100644 index 4e107947e..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AccountToken.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountToken.Builder.class) -public final class AccountToken { - private final String accountToken; - - private final AccountIntegration integration; - - private final Map additionalProperties; - - private AccountToken( - String accountToken, AccountIntegration integration, Map additionalProperties) { - this.accountToken = accountToken; - this.integration = integration; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("account_token") - public String getAccountToken() { - return accountToken; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountToken && equalTo((AccountToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountToken other) { - return accountToken.equals(other.accountToken) && integration.equals(other.integration); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.accountToken, this.integration); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccountTokenStage builder() { - return new Builder(); - } - - public interface AccountTokenStage { - IntegrationStage accountToken(@NotNull String accountToken); - - Builder from(AccountToken other); - } - - public interface IntegrationStage { - _FinalStage integration(@NotNull AccountIntegration integration); - } - - public interface _FinalStage { - AccountToken build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountTokenStage, IntegrationStage, _FinalStage { - private String accountToken; - - private AccountIntegration integration; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AccountToken other) { - accountToken(other.getAccountToken()); - integration(other.getIntegration()); - return this; - } - - @java.lang.Override - @JsonSetter("account_token") - public IntegrationStage accountToken(@NotNull String accountToken) { - this.accountToken = accountToken; - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public _FinalStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - public AccountToken build() { - return new AccountToken(accountToken, integration, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AdvancedMetadata.java b/src/main/java/com/merge/api/resources/ticketing/types/AdvancedMetadata.java deleted file mode 100644 index 07bd9a508..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AdvancedMetadata.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AdvancedMetadata.Builder.class) -public final class AdvancedMetadata { - private final String id; - - private final Optional displayName; - - private final Optional description; - - private final Optional isRequired; - - private final Optional isCustom; - - private final Optional> fieldChoices; - - private final Map additionalProperties; - - private AdvancedMetadata( - String id, - Optional displayName, - Optional description, - Optional isRequired, - Optional isCustom, - Optional> fieldChoices, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.description = description; - this.isRequired = isRequired; - this.isCustom = isCustom; - this.fieldChoices = fieldChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AdvancedMetadata other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && description.equals(other.description) - && isRequired.equals(other.isRequired) - && isCustom.equals(other.isCustom) - && fieldChoices.equals(other.fieldChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - _FinalStage id(@NotNull String id); - - Builder from(AdvancedMetadata other); - } - - public interface _FinalStage { - AdvancedMetadata build(); - - _FinalStage displayName(Optional displayName); - - _FinalStage displayName(String displayName); - - _FinalStage description(Optional description); - - _FinalStage description(String description); - - _FinalStage isRequired(Optional isRequired); - - _FinalStage isRequired(Boolean isRequired); - - _FinalStage isCustom(Optional isCustom); - - _FinalStage isCustom(Boolean isCustom); - - _FinalStage fieldChoices(Optional> fieldChoices); - - _FinalStage fieldChoices(List fieldChoices); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, _FinalStage { - private String id; - - private Optional> fieldChoices = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AdvancedMetadata other) { - id(other.getId()); - displayName(other.getDisplayName()); - description(other.getDescription()); - isRequired(other.getIsRequired()); - isCustom(other.getIsCustom()); - fieldChoices(other.getFieldChoices()); - return this; - } - - @java.lang.Override - @JsonSetter("id") - public _FinalStage id(@NotNull String id) { - this.id = id; - return this; - } - - @java.lang.Override - public _FinalStage fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public _FinalStage fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - @java.lang.Override - public _FinalStage isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public _FinalStage isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - @java.lang.Override - public _FinalStage isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public _FinalStage isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - @java.lang.Override - public _FinalStage description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @java.lang.Override - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public _FinalStage description(Optional description) { - this.description = description; - return this; - } - - @java.lang.Override - public _FinalStage displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public _FinalStage displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - @java.lang.Override - public AdvancedMetadata build() { - return new AdvancedMetadata( - id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/resources/ticketing/types/AsyncPassthroughReciept.java deleted file mode 100644 index 80d15a99b..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AsyncPassthroughReciept.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) -public final class AsyncPassthroughReciept { - private final String asyncPassthroughReceiptId; - - private final Map additionalProperties; - - private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("async_passthrough_receipt_id") - public String getAsyncPassthroughReceiptId() { - return asyncPassthroughReceiptId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AsyncPassthroughReciept other) { - return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncPassthroughReceiptId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AsyncPassthroughReceiptIdStage builder() { - return new Builder(); - } - - public interface AsyncPassthroughReceiptIdStage { - _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); - - Builder from(AsyncPassthroughReciept other); - } - - public interface _FinalStage { - AsyncPassthroughReciept build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { - private String asyncPassthroughReceiptId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AsyncPassthroughReciept other) { - asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); - return this; - } - - @java.lang.Override - @JsonSetter("async_passthrough_receipt_id") - public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { - this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; - return this; - } - - @java.lang.Override - public AsyncPassthroughReciept build() { - return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Attachment.java b/src/main/java/com/merge/api/resources/ticketing/types/Attachment.java deleted file mode 100644 index 185734308..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/Attachment.java +++ /dev/null @@ -1,445 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Attachment.Builder.class) -public final class Attachment { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional fileName; - - private final Optional ticket; - - private final Optional fileUrl; - - private final Optional contentType; - - private final Optional uploadedBy; - - private final Optional remoteCreatedAt; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Attachment( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional fileName, - Optional ticket, - Optional fileUrl, - Optional contentType, - Optional uploadedBy, - Optional remoteCreatedAt, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.fileName = fileName; - this.ticket = ticket; - this.fileUrl = fileUrl; - this.contentType = contentType; - this.uploadedBy = uploadedBy; - this.remoteCreatedAt = remoteCreatedAt; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The attachment's name. It is required to include the file extension in the attachment's name. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The ticket associated with the attachment. - */ - @JsonProperty("ticket") - public Optional getTicket() { - return ticket; - } - - /** - * @return The attachment's url. It is required to include the file extension in the file's URL. - */ - @JsonProperty("file_url") - public Optional getFileUrl() { - return fileUrl; - } - - /** - * @return The attachment's file format. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - /** - * @return The user who uploaded the attachment. - */ - @JsonProperty("uploaded_by") - public Optional getUploadedBy() { - return uploadedBy; - } - - /** - * @return When the third party's attachment was created. - */ - @JsonProperty("remote_created_at") - public Optional getRemoteCreatedAt() { - return remoteCreatedAt; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Attachment && equalTo((Attachment) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Attachment other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && fileName.equals(other.fileName) - && ticket.equals(other.ticket) - && fileUrl.equals(other.fileUrl) - && contentType.equals(other.contentType) - && uploadedBy.equals(other.uploadedBy) - && remoteCreatedAt.equals(other.remoteCreatedAt) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.fileName, - this.ticket, - this.fileUrl, - this.contentType, - this.uploadedBy, - this.remoteCreatedAt, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional ticket = Optional.empty(); - - private Optional fileUrl = Optional.empty(); - - private Optional contentType = Optional.empty(); - - private Optional uploadedBy = Optional.empty(); - - private Optional remoteCreatedAt = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Attachment other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - fileName(other.getFileName()); - ticket(other.getTicket()); - fileUrl(other.getFileUrl()); - contentType(other.getContentType()); - uploadedBy(other.getUploadedBy()); - remoteCreatedAt(other.getRemoteCreatedAt()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public Builder fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - public Builder fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @JsonSetter(value = "ticket", nulls = Nulls.SKIP) - public Builder ticket(Optional ticket) { - this.ticket = ticket; - return this; - } - - public Builder ticket(AttachmentTicket ticket) { - this.ticket = Optional.ofNullable(ticket); - return this; - } - - @JsonSetter(value = "file_url", nulls = Nulls.SKIP) - public Builder fileUrl(Optional fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - public Builder fileUrl(String fileUrl) { - this.fileUrl = Optional.ofNullable(fileUrl); - return this; - } - - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public Builder contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - public Builder contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @JsonSetter(value = "uploaded_by", nulls = Nulls.SKIP) - public Builder uploadedBy(Optional uploadedBy) { - this.uploadedBy = uploadedBy; - return this; - } - - public Builder uploadedBy(String uploadedBy) { - this.uploadedBy = Optional.ofNullable(uploadedBy); - return this; - } - - @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) - public Builder remoteCreatedAt(Optional remoteCreatedAt) { - this.remoteCreatedAt = remoteCreatedAt; - return this; - } - - public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { - this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Attachment build() { - return new Attachment( - id, - remoteId, - createdAt, - modifiedAt, - fileName, - ticket, - fileUrl, - contentType, - uploadedBy, - remoteCreatedAt, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AttachmentRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/AttachmentRequest.java deleted file mode 100644 index dd31f1322..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AttachmentRequest.java +++ /dev/null @@ -1,272 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AttachmentRequest.Builder.class) -public final class AttachmentRequest { - private final Optional fileName; - - private final Optional ticket; - - private final Optional fileUrl; - - private final Optional contentType; - - private final Optional uploadedBy; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private AttachmentRequest( - Optional fileName, - Optional ticket, - Optional fileUrl, - Optional contentType, - Optional uploadedBy, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.fileName = fileName; - this.ticket = ticket; - this.fileUrl = fileUrl; - this.contentType = contentType; - this.uploadedBy = uploadedBy; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The attachment's name. It is required to include the file extension in the attachment's name. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The ticket associated with the attachment. - */ - @JsonProperty("ticket") - public Optional getTicket() { - return ticket; - } - - /** - * @return The attachment's url. It is required to include the file extension in the file's URL. - */ - @JsonProperty("file_url") - public Optional getFileUrl() { - return fileUrl; - } - - /** - * @return The attachment's file format. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - /** - * @return The user who uploaded the attachment. - */ - @JsonProperty("uploaded_by") - public Optional getUploadedBy() { - return uploadedBy; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AttachmentRequest && equalTo((AttachmentRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AttachmentRequest other) { - return fileName.equals(other.fileName) - && ticket.equals(other.ticket) - && fileUrl.equals(other.fileUrl) - && contentType.equals(other.contentType) - && uploadedBy.equals(other.uploadedBy) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.fileName, - this.ticket, - this.fileUrl, - this.contentType, - this.uploadedBy, - this.integrationParams, - this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional fileName = Optional.empty(); - - private Optional ticket = Optional.empty(); - - private Optional fileUrl = Optional.empty(); - - private Optional contentType = Optional.empty(); - - private Optional uploadedBy = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AttachmentRequest other) { - fileName(other.getFileName()); - ticket(other.getTicket()); - fileUrl(other.getFileUrl()); - contentType(other.getContentType()); - uploadedBy(other.getUploadedBy()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public Builder fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - public Builder fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @JsonSetter(value = "ticket", nulls = Nulls.SKIP) - public Builder ticket(Optional ticket) { - this.ticket = ticket; - return this; - } - - public Builder ticket(AttachmentRequestTicket ticket) { - this.ticket = Optional.ofNullable(ticket); - return this; - } - - @JsonSetter(value = "file_url", nulls = Nulls.SKIP) - public Builder fileUrl(Optional fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - public Builder fileUrl(String fileUrl) { - this.fileUrl = Optional.ofNullable(fileUrl); - return this; - } - - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public Builder contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - public Builder contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @JsonSetter(value = "uploaded_by", nulls = Nulls.SKIP) - public Builder uploadedBy(Optional uploadedBy) { - this.uploadedBy = uploadedBy; - return this; - } - - public Builder uploadedBy(String uploadedBy) { - this.uploadedBy = Optional.ofNullable(uploadedBy); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public AttachmentRequest build() { - return new AttachmentRequest( - fileName, - ticket, - fileUrl, - contentType, - uploadedBy, - integrationParams, - linkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEvent.java b/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEvent.java deleted file mode 100644 index fd30c4cbe..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEvent.java +++ /dev/null @@ -1,447 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AuditLogEvent.Builder.class) -public final class AuditLogEvent { - private final Optional id; - - private final Optional userName; - - private final Optional userEmail; - - private final AuditLogEventRole role; - - private final String ipAddress; - - private final AuditLogEventEventType eventType; - - private final String eventDescription; - - private final Optional createdAt; - - private final Map additionalProperties; - - private AuditLogEvent( - Optional id, - Optional userName, - Optional userEmail, - AuditLogEventRole role, - String ipAddress, - AuditLogEventEventType eventType, - String eventDescription, - Optional createdAt, - Map additionalProperties) { - this.id = id; - this.userName = userName; - this.userEmail = userEmail; - this.role = role; - this.ipAddress = ipAddress; - this.eventType = eventType; - this.eventDescription = eventDescription; - this.createdAt = createdAt; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The User's full name at the time of this Event occurring. - */ - @JsonProperty("user_name") - public Optional getUserName() { - return userName; - } - - /** - * @return The User's email at the time of this Event occurring. - */ - @JsonProperty("user_email") - public Optional getUserEmail() { - return userEmail; - } - - /** - * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. - *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- */ - @JsonProperty("role") - public AuditLogEventRole getRole() { - return role; - } - - @JsonProperty("ip_address") - public String getIpAddress() { - return ipAddress; - } - - /** - * @return Designates the type of event that occurred. - *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- */ - @JsonProperty("event_type") - public AuditLogEventEventType getEventType() { - return eventType; - } - - @JsonProperty("event_description") - public String getEventDescription() { - return eventDescription; - } - - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AuditLogEvent other) { - return id.equals(other.id) - && userName.equals(other.userName) - && userEmail.equals(other.userEmail) - && role.equals(other.role) - && ipAddress.equals(other.ipAddress) - && eventType.equals(other.eventType) - && eventDescription.equals(other.eventDescription) - && createdAt.equals(other.createdAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.userName, - this.userEmail, - this.role, - this.ipAddress, - this.eventType, - this.eventDescription, - this.createdAt); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RoleStage builder() { - return new Builder(); - } - - public interface RoleStage { - IpAddressStage role(@NotNull AuditLogEventRole role); - - Builder from(AuditLogEvent other); - } - - public interface IpAddressStage { - EventTypeStage ipAddress(@NotNull String ipAddress); - } - - public interface EventTypeStage { - EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); - } - - public interface EventDescriptionStage { - _FinalStage eventDescription(@NotNull String eventDescription); - } - - public interface _FinalStage { - AuditLogEvent build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage userName(Optional userName); - - _FinalStage userName(String userName); - - _FinalStage userEmail(Optional userEmail); - - _FinalStage userEmail(String userEmail); - - _FinalStage createdAt(Optional createdAt); - - _FinalStage createdAt(OffsetDateTime createdAt); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { - private AuditLogEventRole role; - - private String ipAddress; - - private AuditLogEventEventType eventType; - - private String eventDescription; - - private Optional createdAt = Optional.empty(); - - private Optional userEmail = Optional.empty(); - - private Optional userName = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AuditLogEvent other) { - id(other.getId()); - userName(other.getUserName()); - userEmail(other.getUserEmail()); - role(other.getRole()); - ipAddress(other.getIpAddress()); - eventType(other.getEventType()); - eventDescription(other.getEventDescription()); - createdAt(other.getCreatedAt()); - return this; - } - - /** - *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

- *
    - *
  • ADMIN - ADMIN
  • - *
  • DEVELOPER - DEVELOPER
  • - *
  • MEMBER - MEMBER
  • - *
  • API - API
  • - *
  • SYSTEM - SYSTEM
  • - *
  • MERGE_TEAM - MERGE_TEAM
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("role") - public IpAddressStage role(@NotNull AuditLogEventRole role) { - this.role = role; - return this; - } - - @java.lang.Override - @JsonSetter("ip_address") - public EventTypeStage ipAddress(@NotNull String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - *

Designates the type of event that occurred.

- *
    - *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • - *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • - *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • - *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • - *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • - *
  • INVITED_USER - INVITED_USER
  • - *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • - *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • - *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • - *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • - *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • - *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • - *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • - *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • - *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • - *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • - *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • - *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • - *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • - *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • - *
  • RESET_PASSWORD - RESET_PASSWORD
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • - *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • - *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • - *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • - *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • - *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • - *
  • MUTED_ISSUE - MUTED_ISSUE
  • - *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • - *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • - *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • - *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • - *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("event_type") - public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { - this.eventType = eventType; - return this; - } - - @java.lang.Override - @JsonSetter("event_description") - public _FinalStage eventDescription(@NotNull String eventDescription) { - this.eventDescription = eventDescription; - return this; - } - - @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @java.lang.Override - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public _FinalStage createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The User's email at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userEmail(String userEmail) { - this.userEmail = Optional.ofNullable(userEmail); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_email", nulls = Nulls.SKIP) - public _FinalStage userEmail(Optional userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - *

The User's full name at the time of this Event occurring.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage userName(String userName) { - this.userName = Optional.ofNullable(userName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "user_name", nulls = Nulls.SKIP) - public _FinalStage userName(Optional userName) { - this.userName = userName; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public AuditLogEvent build() { - return new AuditLogEvent( - id, - userName, - userEmail, - role, - ipAddress, - eventType, - eventDescription, - createdAt, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEventEventType.java deleted file mode 100644 index 47ecf8bab..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEventEventType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) -public final class AuditLogEventEventType { - private final Object value; - - private final int type; - - private AuditLogEventEventType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EventTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); - } - - private boolean equalTo(AuditLogEventEventType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventEventType of(EventTypeEnum value) { - return new AuditLogEventEventType(value, 0); - } - - public static AuditLogEventEventType of(String value) { - return new AuditLogEventEventType(value, 1); - } - - public interface Visitor { - T visit(EventTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventEventType.class); - } - - @java.lang.Override - public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEventRole.java b/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEventRole.java deleted file mode 100644 index b73d6378b..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AuditLogEventRole.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) -public final class AuditLogEventRole { - private final Object value; - - private final int type; - - private AuditLogEventRole(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((RoleEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); - } - - private boolean equalTo(AuditLogEventRole other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static AuditLogEventRole of(RoleEnum value) { - return new AuditLogEventRole(value, 0); - } - - public static AuditLogEventRole of(String value) { - return new AuditLogEventRole(value, 1); - } - - public interface Visitor { - T visit(RoleEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(AuditLogEventRole.class); - } - - @java.lang.Override - public AuditLogEventRole deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AvailableActions.java b/src/main/java/com/merge/api/resources/ticketing/types/AvailableActions.java deleted file mode 100644 index 81648221f..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/AvailableActions.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AvailableActions.Builder.class) -public final class AvailableActions { - private final AccountIntegration integration; - - private final boolean passthroughAvailable; - - private final Optional> availableModelOperations; - - private final Map additionalProperties; - - private AvailableActions( - AccountIntegration integration, - boolean passthroughAvailable, - Optional> availableModelOperations, - Map additionalProperties) { - this.integration = integration; - this.passthroughAvailable = passthroughAvailable; - this.availableModelOperations = availableModelOperations; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("integration") - public AccountIntegration getIntegration() { - return integration; - } - - @JsonProperty("passthrough_available") - public boolean getPassthroughAvailable() { - return passthroughAvailable; - } - - @JsonProperty("available_model_operations") - public Optional> getAvailableModelOperations() { - return availableModelOperations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AvailableActions && equalTo((AvailableActions) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AvailableActions other) { - return integration.equals(other.integration) - && passthroughAvailable == other.passthroughAvailable - && availableModelOperations.equals(other.availableModelOperations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IntegrationStage builder() { - return new Builder(); - } - - public interface IntegrationStage { - PassthroughAvailableStage integration(@NotNull AccountIntegration integration); - - Builder from(AvailableActions other); - } - - public interface PassthroughAvailableStage { - _FinalStage passthroughAvailable(boolean passthroughAvailable); - } - - public interface _FinalStage { - AvailableActions build(); - - _FinalStage availableModelOperations(Optional> availableModelOperations); - - _FinalStage availableModelOperations(List availableModelOperations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { - private AccountIntegration integration; - - private boolean passthroughAvailable; - - private Optional> availableModelOperations = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AvailableActions other) { - integration(other.getIntegration()); - passthroughAvailable(other.getPassthroughAvailable()); - availableModelOperations(other.getAvailableModelOperations()); - return this; - } - - @java.lang.Override - @JsonSetter("integration") - public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { - this.integration = integration; - return this; - } - - @java.lang.Override - @JsonSetter("passthrough_available") - public _FinalStage passthroughAvailable(boolean passthroughAvailable) { - this.passthroughAvailable = passthroughAvailable; - return this; - } - - @java.lang.Override - public _FinalStage availableModelOperations(List availableModelOperations) { - this.availableModelOperations = Optional.ofNullable(availableModelOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) - public _FinalStage availableModelOperations(Optional> availableModelOperations) { - this.availableModelOperations = availableModelOperations; - return this; - } - - @java.lang.Override - public AvailableActions build() { - return new AvailableActions( - integration, passthroughAvailable, availableModelOperations, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CategoriesEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/CategoriesEnum.java deleted file mode 100644 index 0f305f3a1..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/CategoriesEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoriesEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoriesEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CategoryEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/CategoryEnum.java deleted file mode 100644 index f380b6ed1..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/CategoryEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CategoryEnum { - HRIS("hris"), - - ATS("ats"), - - ACCOUNTING("accounting"), - - TICKETING("ticketing"), - - CRM("crm"), - - MKTG("mktg"), - - FILESTORAGE("filestorage"); - - private final String value; - - CategoryEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CollectionAccessLevel.java b/src/main/java/com/merge/api/resources/ticketing/types/CollectionAccessLevel.java deleted file mode 100644 index 4601009df..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/CollectionAccessLevel.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CollectionAccessLevel.Deserializer.class) -public final class CollectionAccessLevel { - private final Object value; - - private final int type; - - private CollectionAccessLevel(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((AccessLevelEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CollectionAccessLevel && equalTo((CollectionAccessLevel) other); - } - - private boolean equalTo(CollectionAccessLevel other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CollectionAccessLevel of(AccessLevelEnum value) { - return new CollectionAccessLevel(value, 0); - } - - public static CollectionAccessLevel of(String value) { - return new CollectionAccessLevel(value, 1); - } - - public interface Visitor { - T visit(AccessLevelEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CollectionAccessLevel.class); - } - - @java.lang.Override - public CollectionAccessLevel deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccessLevelEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CollectionCollectionType.java b/src/main/java/com/merge/api/resources/ticketing/types/CollectionCollectionType.java deleted file mode 100644 index 8b36fef47..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/CollectionCollectionType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CollectionCollectionType.Deserializer.class) -public final class CollectionCollectionType { - private final Object value; - - private final int type; - - private CollectionCollectionType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((CollectionTypeEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CollectionCollectionType && equalTo((CollectionCollectionType) other); - } - - private boolean equalTo(CollectionCollectionType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CollectionCollectionType of(CollectionTypeEnum value) { - return new CollectionCollectionType(value, 0); - } - - public static CollectionCollectionType of(String value) { - return new CollectionCollectionType(value, 1); - } - - public interface Visitor { - T visit(CollectionTypeEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CollectionCollectionType.class); - } - - @java.lang.Override - public CollectionCollectionType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CollectionTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CollectionTeamsItem.java b/src/main/java/com/merge/api/resources/ticketing/types/CollectionTeamsItem.java deleted file mode 100644 index 37ce10990..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/CollectionTeamsItem.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = CollectionTeamsItem.Deserializer.class) -public final class CollectionTeamsItem { - private final Object value; - - private final int type; - - private CollectionTeamsItem(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((Team) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CollectionTeamsItem && equalTo((CollectionTeamsItem) other); - } - - private boolean equalTo(CollectionTeamsItem other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static CollectionTeamsItem of(String value) { - return new CollectionTeamsItem(value, 0); - } - - public static CollectionTeamsItem of(Team value) { - return new CollectionTeamsItem(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(Team value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(CollectionTeamsItem.class); - } - - @java.lang.Override - public CollectionTeamsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Team.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/resources/ticketing/types/CommonModelScopeApi.java deleted file mode 100644 index 33640fdcd..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommonModelScopeApi.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) -public final class CommonModelScopeApi { - private final List commonModels; - - private final Map additionalProperties; - - private CommonModelScopeApi( - List commonModels, Map additionalProperties) { - this.commonModels = commonModels; - this.additionalProperties = additionalProperties; - } - - /** - * @return The common models you want to update the scopes for - */ - @JsonProperty("common_models") - public List getCommonModels() { - return commonModels; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopeApi other) { - return commonModels.equals(other.commonModels); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.commonModels); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private List commonModels = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CommonModelScopeApi other) { - commonModels(other.getCommonModels()); - return this; - } - - @JsonSetter(value = "common_models", nulls = Nulls.SKIP) - public Builder commonModels(List commonModels) { - this.commonModels.clear(); - this.commonModels.addAll(commonModels); - return this; - } - - public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { - this.commonModels.add(commonModels); - return this; - } - - public Builder addAllCommonModels(List commonModels) { - this.commonModels.addAll(commonModels); - return this; - } - - public CommonModelScopeApi build() { - return new CommonModelScopeApi(commonModels, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/CommonModelScopesBodyRequest.java deleted file mode 100644 index bae80b1d8..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommonModelScopesBodyRequest.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) -public final class CommonModelScopesBodyRequest { - private final String modelId; - - private final List enabledActions; - - private final List disabledFields; - - private final Map additionalProperties; - - private CommonModelScopesBodyRequest( - String modelId, - List enabledActions, - List disabledFields, - Map additionalProperties) { - this.modelId = modelId; - this.enabledActions = enabledActions; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("enabled_actions") - public List getEnabledActions() { - return enabledActions; - } - - @JsonProperty("disabled_fields") - public List getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CommonModelScopesBodyRequest other) { - return modelId.equals(other.modelId) - && enabledActions.equals(other.enabledActions) - && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelIdStage builder() { - return new Builder(); - } - - public interface ModelIdStage { - _FinalStage modelId(@NotNull String modelId); - - Builder from(CommonModelScopesBodyRequest other); - } - - public interface _FinalStage { - CommonModelScopesBodyRequest build(); - - _FinalStage enabledActions(List enabledActions); - - _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); - - _FinalStage addAllEnabledActions(List enabledActions); - - _FinalStage disabledFields(List disabledFields); - - _FinalStage addDisabledFields(String disabledFields); - - _FinalStage addAllDisabledFields(List disabledFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelIdStage, _FinalStage { - private String modelId; - - private List disabledFields = new ArrayList<>(); - - private List enabledActions = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CommonModelScopesBodyRequest other) { - modelId(other.getModelId()); - enabledActions(other.getEnabledActions()); - disabledFields(other.getDisabledFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public _FinalStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - public _FinalStage addAllDisabledFields(List disabledFields) { - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addDisabledFields(String disabledFields) { - this.disabledFields.add(disabledFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public _FinalStage disabledFields(List disabledFields) { - this.disabledFields.clear(); - this.disabledFields.addAll(disabledFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllEnabledActions(List enabledActions) { - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { - this.enabledActions.add(enabledActions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) - public _FinalStage enabledActions(List enabledActions) { - this.enabledActions.clear(); - this.enabledActions.addAll(enabledActions); - return this; - } - - @java.lang.Override - public CommonModelScopesBodyRequest build() { - return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Contact.java b/src/main/java/com/merge/api/resources/ticketing/types/Contact.java deleted file mode 100644 index e8638bfb3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/Contact.java +++ /dev/null @@ -1,416 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Contact.Builder.class) -public final class Contact { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional emailAddress; - - private final Optional phoneNumber; - - private final Optional details; - - private final Optional account; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Contact( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional emailAddress, - Optional phoneNumber, - Optional details, - Optional account, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.emailAddress = emailAddress; - this.phoneNumber = phoneNumber; - this.details = details; - this.account = account; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The contact's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The contact's email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return The contact's phone number. - */ - @JsonProperty("phone_number") - public Optional getPhoneNumber() { - return phoneNumber; - } - - /** - * @return The contact's details. - */ - @JsonProperty("details") - public Optional getDetails() { - return details; - } - - /** - * @return The contact's account. - */ - @JsonProperty("account") - public Optional getAccount() { - return account; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Contact && equalTo((Contact) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Contact other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && emailAddress.equals(other.emailAddress) - && phoneNumber.equals(other.phoneNumber) - && details.equals(other.details) - && account.equals(other.account) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.emailAddress, - this.phoneNumber, - this.details, - this.account, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional phoneNumber = Optional.empty(); - - private Optional details = Optional.empty(); - - private Optional account = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Contact other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - emailAddress(other.getEmailAddress()); - phoneNumber(other.getPhoneNumber()); - details(other.getDetails()); - account(other.getAccount()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) - public Builder phoneNumber(Optional phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - public Builder phoneNumber(String phoneNumber) { - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - - @JsonSetter(value = "details", nulls = Nulls.SKIP) - public Builder details(Optional details) { - this.details = details; - return this; - } - - public Builder details(String details) { - this.details = Optional.ofNullable(details); - return this; - } - - @JsonSetter(value = "account", nulls = Nulls.SKIP) - public Builder account(Optional account) { - this.account = account; - return this; - } - - public Builder account(ContactAccount account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Contact build() { - return new Contact( - id, - remoteId, - createdAt, - modifiedAt, - name, - emailAddress, - phoneNumber, - details, - account, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ContactAccount.java b/src/main/java/com/merge/api/resources/ticketing/types/ContactAccount.java deleted file mode 100644 index f8b3236a7..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ContactAccount.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ContactAccount.Deserializer.class) -public final class ContactAccount { - private final Object value; - - private final int type; - - private ContactAccount(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((Account) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactAccount && equalTo((ContactAccount) other); - } - - private boolean equalTo(ContactAccount other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ContactAccount of(String value) { - return new ContactAccount(value, 0); - } - - public static ContactAccount of(Account value) { - return new ContactAccount(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(Account value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ContactAccount.class); - } - - @java.lang.Override - public ContactAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ContactRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/ContactRequest.java deleted file mode 100644 index 11b57d15c..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ContactRequest.java +++ /dev/null @@ -1,272 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ContactRequest.Builder.class) -public final class ContactRequest { - private final Optional name; - - private final Optional emailAddress; - - private final Optional phoneNumber; - - private final Optional details; - - private final Optional account; - - private final Optional> integrationParams; - - private final Optional> linkedAccountParams; - - private final Map additionalProperties; - - private ContactRequest( - Optional name, - Optional emailAddress, - Optional phoneNumber, - Optional details, - Optional account, - Optional> integrationParams, - Optional> linkedAccountParams, - Map additionalProperties) { - this.name = name; - this.emailAddress = emailAddress; - this.phoneNumber = phoneNumber; - this.details = details; - this.account = account; - this.integrationParams = integrationParams; - this.linkedAccountParams = linkedAccountParams; - this.additionalProperties = additionalProperties; - } - - /** - * @return The contact's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The contact's email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return The contact's phone number. - */ - @JsonProperty("phone_number") - public Optional getPhoneNumber() { - return phoneNumber; - } - - /** - * @return The contact's details. - */ - @JsonProperty("details") - public Optional getDetails() { - return details; - } - - /** - * @return The contact's account. - */ - @JsonProperty("account") - public Optional getAccount() { - return account; - } - - @JsonProperty("integration_params") - public Optional> getIntegrationParams() { - return integrationParams; - } - - @JsonProperty("linked_account_params") - public Optional> getLinkedAccountParams() { - return linkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactRequest && equalTo((ContactRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ContactRequest other) { - return name.equals(other.name) - && emailAddress.equals(other.emailAddress) - && phoneNumber.equals(other.phoneNumber) - && details.equals(other.details) - && account.equals(other.account) - && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.emailAddress, - this.phoneNumber, - this.details, - this.account, - this.integrationParams, - this.linkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional phoneNumber = Optional.empty(); - - private Optional details = Optional.empty(); - - private Optional account = Optional.empty(); - - private Optional> integrationParams = Optional.empty(); - - private Optional> linkedAccountParams = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ContactRequest other) { - name(other.getName()); - emailAddress(other.getEmailAddress()); - phoneNumber(other.getPhoneNumber()); - details(other.getDetails()); - account(other.getAccount()); - integrationParams(other.getIntegrationParams()); - linkedAccountParams(other.getLinkedAccountParams()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) - public Builder phoneNumber(Optional phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - public Builder phoneNumber(String phoneNumber) { - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - - @JsonSetter(value = "details", nulls = Nulls.SKIP) - public Builder details(Optional details) { - this.details = details; - return this; - } - - public Builder details(String details) { - this.details = Optional.ofNullable(details); - return this; - } - - @JsonSetter(value = "account", nulls = Nulls.SKIP) - public Builder account(Optional account) { - this.account = account; - return this; - } - - public Builder account(ContactRequestAccount account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) - public Builder integrationParams(Optional> integrationParams) { - this.integrationParams = integrationParams; - return this; - } - - public Builder integrationParams(Map integrationParams) { - this.integrationParams = Optional.ofNullable(integrationParams); - return this; - } - - @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) - public Builder linkedAccountParams(Optional> linkedAccountParams) { - this.linkedAccountParams = linkedAccountParams; - return this; - } - - public Builder linkedAccountParams(Map linkedAccountParams) { - this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); - return this; - } - - public ContactRequest build() { - return new ContactRequest( - name, - emailAddress, - phoneNumber, - details, - account, - integrationParams, - linkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ContactRequestAccount.java b/src/main/java/com/merge/api/resources/ticketing/types/ContactRequestAccount.java deleted file mode 100644 index 9b1e7c261..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ContactRequestAccount.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = ContactRequestAccount.Deserializer.class) -public final class ContactRequestAccount { - private final Object value; - - private final int type; - - private ContactRequestAccount(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((Account) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ContactRequestAccount && equalTo((ContactRequestAccount) other); - } - - private boolean equalTo(ContactRequestAccount other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static ContactRequestAccount of(String value) { - return new ContactRequestAccount(value, 0); - } - - public static ContactRequestAccount of(Account value) { - return new ContactRequestAccount(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(Account value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(ContactRequestAccount.class); - } - - @java.lang.Override - public ContactRequestAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/DataPassthroughRequest.java deleted file mode 100644 index 16ae8aefe..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/DataPassthroughRequest.java +++ /dev/null @@ -1,371 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) -public final class DataPassthroughRequest { - private final MethodEnum method; - - private final String path; - - private final Optional baseUrlOverride; - - private final Optional data; - - private final Optional> multipartFormData; - - private final Optional> headers; - - private final Optional requestFormat; - - private final Optional normalizeResponse; - - private final Map additionalProperties; - - private DataPassthroughRequest( - MethodEnum method, - String path, - Optional baseUrlOverride, - Optional data, - Optional> multipartFormData, - Optional> headers, - Optional requestFormat, - Optional normalizeResponse, - Map additionalProperties) { - this.method = method; - this.path = path; - this.baseUrlOverride = baseUrlOverride; - this.data = data; - this.multipartFormData = multipartFormData; - this.headers = headers; - this.requestFormat = requestFormat; - this.normalizeResponse = normalizeResponse; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public MethodEnum getMethod() { - return method; - } - - /** - * @return The path of the request in the third party's platform. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - /** - * @return An optional override of the third party's base url for the request. - */ - @JsonProperty("base_url_override") - public Optional getBaseUrlOverride() { - return baseUrlOverride; - } - - /** - * @return The data with the request. You must include a request_format parameter matching the data's format - */ - @JsonProperty("data") - public Optional getData() { - return data; - } - - /** - * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. - */ - @JsonProperty("multipart_form_data") - public Optional> getMultipartFormData() { - return multipartFormData; - } - - /** - * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("request_format") - public Optional getRequestFormat() { - return requestFormat; - } - - /** - * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. - */ - @JsonProperty("normalize_response") - public Optional getNormalizeResponse() { - return normalizeResponse; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DataPassthroughRequest other) { - return method.equals(other.method) - && path.equals(other.path) - && baseUrlOverride.equals(other.baseUrlOverride) - && data.equals(other.data) - && multipartFormData.equals(other.multipartFormData) - && headers.equals(other.headers) - && requestFormat.equals(other.requestFormat) - && normalizeResponse.equals(other.normalizeResponse); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.baseUrlOverride, - this.data, - this.multipartFormData, - this.headers, - this.requestFormat, - this.normalizeResponse); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull MethodEnum method); - - Builder from(DataPassthroughRequest other); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - } - - public interface _FinalStage { - DataPassthroughRequest build(); - - _FinalStage baseUrlOverride(Optional baseUrlOverride); - - _FinalStage baseUrlOverride(String baseUrlOverride); - - _FinalStage data(Optional data); - - _FinalStage data(String data); - - _FinalStage multipartFormData(Optional> multipartFormData); - - _FinalStage multipartFormData(List multipartFormData); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - - _FinalStage requestFormat(Optional requestFormat); - - _FinalStage requestFormat(RequestFormatEnum requestFormat); - - _FinalStage normalizeResponse(Optional normalizeResponse); - - _FinalStage normalizeResponse(Boolean normalizeResponse); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, _FinalStage { - private MethodEnum method; - - private String path; - - private Optional normalizeResponse = Optional.empty(); - - private Optional requestFormat = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional> multipartFormData = Optional.empty(); - - private Optional data = Optional.empty(); - - private Optional baseUrlOverride = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DataPassthroughRequest other) { - method(other.getMethod()); - path(other.getPath()); - baseUrlOverride(other.getBaseUrlOverride()); - data(other.getData()); - multipartFormData(other.getMultipartFormData()); - headers(other.getHeaders()); - requestFormat(other.getRequestFormat()); - normalizeResponse(other.getNormalizeResponse()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull MethodEnum method) { - this.method = method; - return this; - } - - /** - *

The path of the request in the third party's platform.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - /** - *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage normalizeResponse(Boolean normalizeResponse) { - this.normalizeResponse = Optional.ofNullable(normalizeResponse); - return this; - } - - @java.lang.Override - @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) - public _FinalStage normalizeResponse(Optional normalizeResponse) { - this.normalizeResponse = normalizeResponse; - return this; - } - - @java.lang.Override - public _FinalStage requestFormat(RequestFormatEnum requestFormat) { - this.requestFormat = Optional.ofNullable(requestFormat); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_format", nulls = Nulls.SKIP) - public _FinalStage requestFormat(Optional requestFormat) { - this.requestFormat = requestFormat; - return this; - } - - /** - *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - /** - *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage multipartFormData(List multipartFormData) { - this.multipartFormData = Optional.ofNullable(multipartFormData); - return this; - } - - @java.lang.Override - @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) - public _FinalStage multipartFormData(Optional> multipartFormData) { - this.multipartFormData = multipartFormData; - return this; - } - - /** - *

The data with the request. You must include a request_format parameter matching the data's format

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage data(String data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - /** - *

An optional override of the third party's base url for the request.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage baseUrlOverride(String baseUrlOverride) { - this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); - return this; - } - - @java.lang.Override - @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) - public _FinalStage baseUrlOverride(Optional baseUrlOverride) { - this.baseUrlOverride = baseUrlOverride; - return this; - } - - @java.lang.Override - public DataPassthroughRequest build() { - return new DataPassthroughRequest( - method, - path, - baseUrlOverride, - data, - multipartFormData, - headers, - requestFormat, - normalizeResponse, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/DebugModeLog.java b/src/main/java/com/merge/api/resources/ticketing/types/DebugModeLog.java deleted file mode 100644 index e52e1396f..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/DebugModeLog.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModeLog.Builder.class) -public final class DebugModeLog { - private final String logId; - - private final String dashboardView; - - private final DebugModelLogSummary logSummary; - - private final Map additionalProperties; - - private DebugModeLog( - String logId, - String dashboardView, - DebugModelLogSummary logSummary, - Map additionalProperties) { - this.logId = logId; - this.dashboardView = dashboardView; - this.logSummary = logSummary; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("log_id") - public String getLogId() { - return logId; - } - - @JsonProperty("dashboard_view") - public String getDashboardView() { - return dashboardView; - } - - @JsonProperty("log_summary") - public DebugModelLogSummary getLogSummary() { - return logSummary; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModeLog && equalTo((DebugModeLog) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModeLog other) { - return logId.equals(other.logId) - && dashboardView.equals(other.dashboardView) - && logSummary.equals(other.logSummary); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.logId, this.dashboardView, this.logSummary); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LogIdStage builder() { - return new Builder(); - } - - public interface LogIdStage { - DashboardViewStage logId(@NotNull String logId); - - Builder from(DebugModeLog other); - } - - public interface DashboardViewStage { - LogSummaryStage dashboardView(@NotNull String dashboardView); - } - - public interface LogSummaryStage { - _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); - } - - public interface _FinalStage { - DebugModeLog build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { - private String logId; - - private String dashboardView; - - private DebugModelLogSummary logSummary; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModeLog other) { - logId(other.getLogId()); - dashboardView(other.getDashboardView()); - logSummary(other.getLogSummary()); - return this; - } - - @java.lang.Override - @JsonSetter("log_id") - public DashboardViewStage logId(@NotNull String logId) { - this.logId = logId; - return this; - } - - @java.lang.Override - @JsonSetter("dashboard_view") - public LogSummaryStage dashboardView(@NotNull String dashboardView) { - this.dashboardView = dashboardView; - return this; - } - - @java.lang.Override - @JsonSetter("log_summary") - public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { - this.logSummary = logSummary; - return this; - } - - @java.lang.Override - public DebugModeLog build() { - return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/resources/ticketing/types/DebugModelLogSummary.java deleted file mode 100644 index 595bf1cd1..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/DebugModelLogSummary.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) -public final class DebugModelLogSummary { - private final String url; - - private final String method; - - private final int statusCode; - - private final Map additionalProperties; - - private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { - this.url = url; - this.method = method; - this.statusCode = statusCode; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("url") - public String getUrl() { - return url; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("status_code") - public int getStatusCode() { - return statusCode; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DebugModelLogSummary other) { - return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.url, this.method, this.statusCode); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static UrlStage builder() { - return new Builder(); - } - - public interface UrlStage { - MethodStage url(@NotNull String url); - - Builder from(DebugModelLogSummary other); - } - - public interface MethodStage { - StatusCodeStage method(@NotNull String method); - } - - public interface StatusCodeStage { - _FinalStage statusCode(int statusCode); - } - - public interface _FinalStage { - DebugModelLogSummary build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { - private String url; - - private String method; - - private int statusCode; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DebugModelLogSummary other) { - url(other.getUrl()); - method(other.getMethod()); - statusCode(other.getStatusCode()); - return this; - } - - @java.lang.Override - @JsonSetter("url") - public MethodStage url(@NotNull String url) { - this.url = url; - return this; - } - - @java.lang.Override - @JsonSetter("method") - public StatusCodeStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("status_code") - public _FinalStage statusCode(int statusCode) { - this.statusCode = statusCode; - return this; - } - - @java.lang.Override - public DebugModelLogSummary build() { - return new DebugModelLogSummary(url, method, statusCode, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/EnabledActionsEnum.java deleted file mode 100644 index 99cafb1d6..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/EnabledActionsEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EnabledActionsEnum { - READ("READ"), - - WRITE("WRITE"); - - private final String value; - - EnabledActionsEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/EncodingEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/EncodingEnum.java deleted file mode 100644 index 31feb2daf..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/EncodingEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EncodingEnum { - RAW("RAW"), - - BASE_64("BASE64"), - - GZIP_BASE_64("GZIP_BASE64"); - - private final String value; - - EncodingEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/resources/ticketing/types/ErrorValidationProblem.java deleted file mode 100644 index 8bfa66ec3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ErrorValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) -public final class ErrorValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private ErrorValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ErrorValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(ErrorValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - ErrorValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ErrorValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public ErrorValidationProblem build() { - return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/EventTypeEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/EventTypeEnum.java deleted file mode 100644 index 4adf46a40..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/EventTypeEnum.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum EventTypeEnum { - CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), - - DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), - - CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), - - DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), - - REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), - - INVITED_USER("INVITED_USER"), - - TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), - - TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), - - DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), - - CREATED_DESTINATION("CREATED_DESTINATION"), - - DELETED_DESTINATION("DELETED_DESTINATION"), - - CHANGED_DESTINATION("CHANGED_DESTINATION"), - - CHANGED_SCOPES("CHANGED_SCOPES"), - - CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), - - CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), - - ENABLED_INTEGRATION("ENABLED_INTEGRATION"), - - DISABLED_INTEGRATION("DISABLED_INTEGRATION"), - - ENABLED_CATEGORY("ENABLED_CATEGORY"), - - DISABLED_CATEGORY("DISABLED_CATEGORY"), - - CHANGED_PASSWORD("CHANGED_PASSWORD"), - - RESET_PASSWORD("RESET_PASSWORD"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), - - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), - - CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), - - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), - - DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), - - DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), - - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), - - FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), - - MUTED_ISSUE("MUTED_ISSUE"), - - GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), - - ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), - - DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), - - MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), - - END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); - - private final String value; - - EventTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/resources/ticketing/types/ExternalTargetFieldApi.java deleted file mode 100644 index 2f4d32ada..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ExternalTargetFieldApi.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) -public final class ExternalTargetFieldApi { - private final Optional name; - - private final Optional description; - - private final Optional isMapped; - - private final Map additionalProperties; - - private ExternalTargetFieldApi( - Optional name, - Optional description, - Optional isMapped, - Map additionalProperties) { - this.name = name; - this.description = description; - this.isMapped = isMapped; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_mapped") - public Optional getIsMapped() { - return isMapped; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApi other) { - return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isMapped); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isMapped = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApi other) { - name(other.getName()); - description(other.getDescription()); - isMapped(other.getIsMapped()); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) - public Builder isMapped(Optional isMapped) { - this.isMapped = isMapped; - return this; - } - - public Builder isMapped(String isMapped) { - this.isMapped = Optional.ofNullable(isMapped); - return this; - } - - public ExternalTargetFieldApi build() { - return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/resources/ticketing/types/ExternalTargetFieldApiResponse.java deleted file mode 100644 index 8e9b1b1ed..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ExternalTargetFieldApiResponse.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) -public final class ExternalTargetFieldApiResponse { - private final Optional> ticket; - - private final Optional> comment; - - private final Optional> project; - - private final Optional> collection; - - private final Optional> user; - - private final Optional> role; - - private final Optional> account; - - private final Optional> team; - - private final Optional> attachment; - - private final Optional> tag; - - private final Optional> contact; - - private final Map additionalProperties; - - private ExternalTargetFieldApiResponse( - Optional> ticket, - Optional> comment, - Optional> project, - Optional> collection, - Optional> user, - Optional> role, - Optional> account, - Optional> team, - Optional> attachment, - Optional> tag, - Optional> contact, - Map additionalProperties) { - this.ticket = ticket; - this.comment = comment; - this.project = project; - this.collection = collection; - this.user = user; - this.role = role; - this.account = account; - this.team = team; - this.attachment = attachment; - this.tag = tag; - this.contact = contact; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Ticket") - public Optional> getTicket() { - return ticket; - } - - @JsonProperty("Comment") - public Optional> getComment() { - return comment; - } - - @JsonProperty("Project") - public Optional> getProject() { - return project; - } - - @JsonProperty("Collection") - public Optional> getCollection() { - return collection; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @JsonProperty("Role") - public Optional> getRole() { - return role; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("Team") - public Optional> getTeam() { - return team; - } - - @JsonProperty("Attachment") - public Optional> getAttachment() { - return attachment; - } - - @JsonProperty("Tag") - public Optional> getTag() { - return tag; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ExternalTargetFieldApiResponse other) { - return ticket.equals(other.ticket) - && comment.equals(other.comment) - && project.equals(other.project) - && collection.equals(other.collection) - && user.equals(other.user) - && role.equals(other.role) - && account.equals(other.account) - && team.equals(other.team) - && attachment.equals(other.attachment) - && tag.equals(other.tag) - && contact.equals(other.contact); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.ticket, - this.comment, - this.project, - this.collection, - this.user, - this.role, - this.account, - this.team, - this.attachment, - this.tag, - this.contact); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> ticket = Optional.empty(); - - private Optional> comment = Optional.empty(); - - private Optional> project = Optional.empty(); - - private Optional> collection = Optional.empty(); - - private Optional> user = Optional.empty(); - - private Optional> role = Optional.empty(); - - private Optional> account = Optional.empty(); - - private Optional> team = Optional.empty(); - - private Optional> attachment = Optional.empty(); - - private Optional> tag = Optional.empty(); - - private Optional> contact = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ExternalTargetFieldApiResponse other) { - ticket(other.getTicket()); - comment(other.getComment()); - project(other.getProject()); - collection(other.getCollection()); - user(other.getUser()); - role(other.getRole()); - account(other.getAccount()); - team(other.getTeam()); - attachment(other.getAttachment()); - tag(other.getTag()); - contact(other.getContact()); - return this; - } - - @JsonSetter(value = "Ticket", nulls = Nulls.SKIP) - public Builder ticket(Optional> ticket) { - this.ticket = ticket; - return this; - } - - public Builder ticket(List ticket) { - this.ticket = Optional.ofNullable(ticket); - return this; - } - - @JsonSetter(value = "Comment", nulls = Nulls.SKIP) - public Builder comment(Optional> comment) { - this.comment = comment; - return this; - } - - public Builder comment(List comment) { - this.comment = Optional.ofNullable(comment); - return this; - } - - @JsonSetter(value = "Project", nulls = Nulls.SKIP) - public Builder project(Optional> project) { - this.project = project; - return this; - } - - public Builder project(List project) { - this.project = Optional.ofNullable(project); - return this; - } - - @JsonSetter(value = "Collection", nulls = Nulls.SKIP) - public Builder collection(Optional> collection) { - this.collection = collection; - return this; - } - - public Builder collection(List collection) { - this.collection = Optional.ofNullable(collection); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - @JsonSetter(value = "Role", nulls = Nulls.SKIP) - public Builder role(Optional> role) { - this.role = role; - return this; - } - - public Builder role(List role) { - this.role = Optional.ofNullable(role); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "Team", nulls = Nulls.SKIP) - public Builder team(Optional> team) { - this.team = team; - return this; - } - - public Builder team(List team) { - this.team = Optional.ofNullable(team); - return this; - } - - @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) - public Builder attachment(Optional> attachment) { - this.attachment = attachment; - return this; - } - - public Builder attachment(List attachment) { - this.attachment = Optional.ofNullable(attachment); - return this; - } - - @JsonSetter(value = "Tag", nulls = Nulls.SKIP) - public Builder tag(Optional> tag) { - this.tag = tag; - return this; - } - - public Builder tag(List tag) { - this.tag = Optional.ofNullable(tag); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - public ExternalTargetFieldApiResponse build() { - return new ExternalTargetFieldApiResponse( - ticket, - comment, - project, - collection, - user, - role, - account, - team, - attachment, - tag, - contact, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldFormatEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldFormatEnum.java deleted file mode 100644 index ac0c77b43..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldFormatEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FieldFormatEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - FieldFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstance.java deleted file mode 100644 index 0cf775e8a..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstance.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) -public final class FieldMappingApiInstance { - private final Optional id; - - private final Optional isIntegrationWide; - - private final Optional targetField; - - private final Optional remoteField; - - private final Map additionalProperties; - - private FieldMappingApiInstance( - Optional id, - Optional isIntegrationWide, - Optional targetField, - Optional remoteField, - Map additionalProperties) { - this.id = id; - this.isIntegrationWide = isIntegrationWide; - this.targetField = targetField; - this.remoteField = remoteField; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("is_integration_wide") - public Optional getIsIntegrationWide() { - return isIntegrationWide; - } - - @JsonProperty("target_field") - public Optional getTargetField() { - return targetField; - } - - @JsonProperty("remote_field") - public Optional getRemoteField() { - return remoteField; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstance other) { - return id.equals(other.id) - && isIntegrationWide.equals(other.isIntegrationWide) - && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional isIntegrationWide = Optional.empty(); - - private Optional targetField = Optional.empty(); - - private Optional remoteField = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstance other) { - id(other.getId()); - isIntegrationWide(other.getIsIntegrationWide()); - targetField(other.getTargetField()); - remoteField(other.getRemoteField()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) - public Builder isIntegrationWide(Optional isIntegrationWide) { - this.isIntegrationWide = isIntegrationWide; - return this; - } - - public Builder isIntegrationWide(Boolean isIntegrationWide) { - this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); - return this; - } - - @JsonSetter(value = "target_field", nulls = Nulls.SKIP) - public Builder targetField(Optional targetField) { - this.targetField = targetField; - return this; - } - - public Builder targetField(FieldMappingApiInstanceTargetField targetField) { - this.targetField = Optional.ofNullable(targetField); - return this; - } - - @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) - public Builder remoteField(Optional remoteField) { - this.remoteField = remoteField; - return this; - } - - public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { - this.remoteField = Optional.ofNullable(remoteField); - return this; - } - - public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceRemoteField.java deleted file mode 100644 index 505876f78..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceRemoteField.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) -public final class FieldMappingApiInstanceRemoteField { - private final Optional remoteKeyName; - - private final Optional> schema; - - private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteField( - Optional remoteKeyName, - Optional> schema, - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, - Map additionalProperties) { - this.remoteKeyName = remoteKeyName; - this.schema = schema; - this.remoteEndpointInfo = remoteEndpointInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("schema") - public Optional> getSchema() { - return schema; - } - - @JsonProperty("remote_endpoint_info") - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteField - && equalTo((FieldMappingApiInstanceRemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteField other) { - return remoteKeyName.equals(other.remoteKeyName) - && schema.equals(other.schema) - && remoteEndpointInfo.equals(other.remoteEndpointInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteEndpointInfoStage builder() { - return new Builder(); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); - - Builder from(FieldMappingApiInstanceRemoteField other); - } - - public interface _FinalStage { - FieldMappingApiInstanceRemoteField build(); - - _FinalStage remoteKeyName(Optional remoteKeyName); - - _FinalStage remoteKeyName(String remoteKeyName); - - _FinalStage schema(Optional> schema); - - _FinalStage schema(Map schema); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; - - private Optional> schema = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceRemoteField other) { - remoteKeyName(other.getRemoteKeyName()); - schema(other.getSchema()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo( - @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage schema(Map schema) { - this.schema = Optional.ofNullable(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Optional> schema) { - this.schema = schema; - return this; - } - - @java.lang.Override - public _FinalStage remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public _FinalStage remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceRemoteField build() { - return new FieldMappingApiInstanceRemoteField( - remoteKeyName, schema, remoteEndpointInfo, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java deleted file mode 100644 index b52432d0b..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) -public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { - private final Optional method; - - private final Optional urlPath; - - private final Optional> fieldTraversalPath; - - private final Map additionalProperties; - - private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - Optional method, - Optional urlPath, - Optional> fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public Optional getMethod() { - return method; - } - - @JsonProperty("url_path") - public Optional getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public Optional> getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional method = Optional.empty(); - - private Optional urlPath = Optional.empty(); - - private Optional> fieldTraversalPath = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @JsonSetter(value = "method", nulls = Nulls.SKIP) - public Builder method(Optional method) { - this.method = method; - return this; - } - - public Builder method(String method) { - this.method = Optional.ofNullable(method); - return this; - } - - @JsonSetter(value = "url_path", nulls = Nulls.SKIP) - public Builder urlPath(Optional urlPath) { - this.urlPath = urlPath; - return this; - } - - public Builder urlPath(String urlPath) { - this.urlPath = Optional.ofNullable(urlPath); - return this; - } - - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public Builder fieldTraversalPath(Optional> fieldTraversalPath) { - this.fieldTraversalPath = fieldTraversalPath; - return this; - } - - public Builder fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); - return this; - } - - public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { - return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( - method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceResponse.java deleted file mode 100644 index 83a86731d..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceResponse.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) -public final class FieldMappingApiInstanceResponse { - private final Optional> ticket; - - private final Optional> comment; - - private final Optional> project; - - private final Optional> collection; - - private final Optional> user; - - private final Optional> role; - - private final Optional> account; - - private final Optional> team; - - private final Optional> attachment; - - private final Optional> tag; - - private final Optional> contact; - - private final Map additionalProperties; - - private FieldMappingApiInstanceResponse( - Optional> ticket, - Optional> comment, - Optional> project, - Optional> collection, - Optional> user, - Optional> role, - Optional> account, - Optional> team, - Optional> attachment, - Optional> tag, - Optional> contact, - Map additionalProperties) { - this.ticket = ticket; - this.comment = comment; - this.project = project; - this.collection = collection; - this.user = user; - this.role = role; - this.account = account; - this.team = team; - this.attachment = attachment; - this.tag = tag; - this.contact = contact; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Ticket") - public Optional> getTicket() { - return ticket; - } - - @JsonProperty("Comment") - public Optional> getComment() { - return comment; - } - - @JsonProperty("Project") - public Optional> getProject() { - return project; - } - - @JsonProperty("Collection") - public Optional> getCollection() { - return collection; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @JsonProperty("Role") - public Optional> getRole() { - return role; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("Team") - public Optional> getTeam() { - return team; - } - - @JsonProperty("Attachment") - public Optional> getAttachment() { - return attachment; - } - - @JsonProperty("Tag") - public Optional> getTag() { - return tag; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceResponse other) { - return ticket.equals(other.ticket) - && comment.equals(other.comment) - && project.equals(other.project) - && collection.equals(other.collection) - && user.equals(other.user) - && role.equals(other.role) - && account.equals(other.account) - && team.equals(other.team) - && attachment.equals(other.attachment) - && tag.equals(other.tag) - && contact.equals(other.contact); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.ticket, - this.comment, - this.project, - this.collection, - this.user, - this.role, - this.account, - this.team, - this.attachment, - this.tag, - this.contact); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> ticket = Optional.empty(); - - private Optional> comment = Optional.empty(); - - private Optional> project = Optional.empty(); - - private Optional> collection = Optional.empty(); - - private Optional> user = Optional.empty(); - - private Optional> role = Optional.empty(); - - private Optional> account = Optional.empty(); - - private Optional> team = Optional.empty(); - - private Optional> attachment = Optional.empty(); - - private Optional> tag = Optional.empty(); - - private Optional> contact = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldMappingApiInstanceResponse other) { - ticket(other.getTicket()); - comment(other.getComment()); - project(other.getProject()); - collection(other.getCollection()); - user(other.getUser()); - role(other.getRole()); - account(other.getAccount()); - team(other.getTeam()); - attachment(other.getAttachment()); - tag(other.getTag()); - contact(other.getContact()); - return this; - } - - @JsonSetter(value = "Ticket", nulls = Nulls.SKIP) - public Builder ticket(Optional> ticket) { - this.ticket = ticket; - return this; - } - - public Builder ticket(List ticket) { - this.ticket = Optional.ofNullable(ticket); - return this; - } - - @JsonSetter(value = "Comment", nulls = Nulls.SKIP) - public Builder comment(Optional> comment) { - this.comment = comment; - return this; - } - - public Builder comment(List comment) { - this.comment = Optional.ofNullable(comment); - return this; - } - - @JsonSetter(value = "Project", nulls = Nulls.SKIP) - public Builder project(Optional> project) { - this.project = project; - return this; - } - - public Builder project(List project) { - this.project = Optional.ofNullable(project); - return this; - } - - @JsonSetter(value = "Collection", nulls = Nulls.SKIP) - public Builder collection(Optional> collection) { - this.collection = collection; - return this; - } - - public Builder collection(List collection) { - this.collection = Optional.ofNullable(collection); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - @JsonSetter(value = "Role", nulls = Nulls.SKIP) - public Builder role(Optional> role) { - this.role = role; - return this; - } - - public Builder role(List role) { - this.role = Optional.ofNullable(role); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "Team", nulls = Nulls.SKIP) - public Builder team(Optional> team) { - this.team = team; - return this; - } - - public Builder team(List team) { - this.team = Optional.ofNullable(team); - return this; - } - - @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) - public Builder attachment(Optional> attachment) { - this.attachment = attachment; - return this; - } - - public Builder attachment(List attachment) { - this.attachment = Optional.ofNullable(attachment); - return this; - } - - @JsonSetter(value = "Tag", nulls = Nulls.SKIP) - public Builder tag(Optional> tag) { - this.tag = tag; - return this; - } - - public Builder tag(List tag) { - this.tag = Optional.ofNullable(tag); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - public FieldMappingApiInstanceResponse build() { - return new FieldMappingApiInstanceResponse( - ticket, - comment, - project, - collection, - user, - role, - account, - team, - attachment, - tag, - contact, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceTargetField.java deleted file mode 100644 index 358746331..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingApiInstanceTargetField.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) -public final class FieldMappingApiInstanceTargetField { - private final String name; - - private final String description; - - private final boolean isOrganizationWide; - - private final Map additionalProperties; - - private FieldMappingApiInstanceTargetField( - String name, String description, boolean isOrganizationWide, Map additionalProperties) { - this.name = name; - this.description = description; - this.isOrganizationWide = isOrganizationWide; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("is_organization_wide") - public boolean getIsOrganizationWide() { - return isOrganizationWide; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingApiInstanceTargetField - && equalTo((FieldMappingApiInstanceTargetField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingApiInstanceTargetField other) { - return name.equals(other.name) - && description.equals(other.description) - && isOrganizationWide == other.isOrganizationWide; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.description, this.isOrganizationWide); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DescriptionStage name(@NotNull String name); - - Builder from(FieldMappingApiInstanceTargetField other); - } - - public interface DescriptionStage { - IsOrganizationWideStage description(@NotNull String description); - } - - public interface IsOrganizationWideStage { - _FinalStage isOrganizationWide(boolean isOrganizationWide); - } - - public interface _FinalStage { - FieldMappingApiInstanceTargetField build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { - private String name; - - private String description; - - private boolean isOrganizationWide; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingApiInstanceTargetField other) { - name(other.getName()); - description(other.getDescription()); - isOrganizationWide(other.getIsOrganizationWide()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public DescriptionStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("description") - public IsOrganizationWideStage description(@NotNull String description) { - this.description = description; - return this; - } - - @java.lang.Override - @JsonSetter("is_organization_wide") - public _FinalStage isOrganizationWide(boolean isOrganizationWide) { - this.isOrganizationWide = isOrganizationWide; - return this; - } - - @java.lang.Override - public FieldMappingApiInstanceTargetField build() { - return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingInstanceResponse.java deleted file mode 100644 index fa050462a..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldMappingInstanceResponse.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) -public final class FieldMappingInstanceResponse { - private final FieldMappingApiInstance model; - - private final List warnings; - - private final List errors; - - private final Optional> logs; - - private final Map additionalProperties; - - private FieldMappingInstanceResponse( - FieldMappingApiInstance model, - List warnings, - List errors, - Optional> logs, - Map additionalProperties) { - this.model = model; - this.warnings = warnings; - this.errors = errors; - this.logs = logs; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model") - public FieldMappingApiInstance getModel() { - return model; - } - - @JsonProperty("warnings") - public List getWarnings() { - return warnings; - } - - @JsonProperty("errors") - public List getErrors() { - return errors; - } - - @JsonProperty("logs") - public Optional> getLogs() { - return logs; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldMappingInstanceResponse other) { - return model.equals(other.model) - && warnings.equals(other.warnings) - && errors.equals(other.errors) - && logs.equals(other.logs); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.warnings, this.errors, this.logs); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelStage builder() { - return new Builder(); - } - - public interface ModelStage { - _FinalStage model(@NotNull FieldMappingApiInstance model); - - Builder from(FieldMappingInstanceResponse other); - } - - public interface _FinalStage { - FieldMappingInstanceResponse build(); - - _FinalStage warnings(List warnings); - - _FinalStage addWarnings(WarningValidationProblem warnings); - - _FinalStage addAllWarnings(List warnings); - - _FinalStage errors(List errors); - - _FinalStage addErrors(ErrorValidationProblem errors); - - _FinalStage addAllErrors(List errors); - - _FinalStage logs(Optional> logs); - - _FinalStage logs(List logs); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelStage, _FinalStage { - private FieldMappingApiInstance model; - - private Optional> logs = Optional.empty(); - - private List errors = new ArrayList<>(); - - private List warnings = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(FieldMappingInstanceResponse other) { - model(other.getModel()); - warnings(other.getWarnings()); - errors(other.getErrors()); - logs(other.getLogs()); - return this; - } - - @java.lang.Override - @JsonSetter("model") - public _FinalStage model(@NotNull FieldMappingApiInstance model) { - this.model = model; - return this; - } - - @java.lang.Override - public _FinalStage logs(List logs) { - this.logs = Optional.ofNullable(logs); - return this; - } - - @java.lang.Override - @JsonSetter(value = "logs", nulls = Nulls.SKIP) - public _FinalStage logs(Optional> logs) { - this.logs = logs; - return this; - } - - @java.lang.Override - public _FinalStage addAllErrors(List errors) { - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addErrors(ErrorValidationProblem errors) { - this.errors.add(errors); - return this; - } - - @java.lang.Override - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public _FinalStage errors(List errors) { - this.errors.clear(); - this.errors.addAll(errors); - return this; - } - - @java.lang.Override - public _FinalStage addAllWarnings(List warnings) { - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public _FinalStage addWarnings(WarningValidationProblem warnings) { - this.warnings.add(warnings); - return this; - } - - @java.lang.Override - @JsonSetter(value = "warnings", nulls = Nulls.SKIP) - public _FinalStage warnings(List warnings) { - this.warnings.clear(); - this.warnings.addAll(warnings); - return this; - } - - @java.lang.Override - public FieldMappingInstanceResponse build() { - return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldPermissionDeserializer.java deleted file mode 100644 index 8fb738548..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldPermissionDeserializer.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) -public final class FieldPermissionDeserializer { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializer( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializer other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializer other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializer build() { - return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldPermissionDeserializerRequest.java deleted file mode 100644 index 137a97a4b..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldPermissionDeserializerRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) -public final class FieldPermissionDeserializerRequest { - private final Optional> enabledFields; - - private final Optional> disabledFields; - - private final Map additionalProperties; - - private FieldPermissionDeserializerRequest( - Optional> enabledFields, - Optional> disabledFields, - Map additionalProperties) { - this.enabledFields = enabledFields; - this.disabledFields = disabledFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("enabled_fields") - public Optional> getEnabledFields() { - return enabledFields; - } - - @JsonProperty("disabled_fields") - public Optional> getDisabledFields() { - return disabledFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof FieldPermissionDeserializerRequest - && equalTo((FieldPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(FieldPermissionDeserializerRequest other) { - return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.enabledFields, this.disabledFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> enabledFields = Optional.empty(); - - private Optional> disabledFields = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(FieldPermissionDeserializerRequest other) { - enabledFields(other.getEnabledFields()); - disabledFields(other.getDisabledFields()); - return this; - } - - @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) - public Builder enabledFields(Optional> enabledFields) { - this.enabledFields = enabledFields; - return this; - } - - public Builder enabledFields(List enabledFields) { - this.enabledFields = Optional.ofNullable(enabledFields); - return this; - } - - @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) - public Builder disabledFields(Optional> disabledFields) { - this.disabledFields = disabledFields; - return this; - } - - public Builder disabledFields(List disabledFields) { - this.disabledFields = Optional.ofNullable(disabledFields); - return this; - } - - public FieldPermissionDeserializerRequest build() { - return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/FieldTypeEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/FieldTypeEnum.java deleted file mode 100644 index edec7422e..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/FieldTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum FieldTypeEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - FieldTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/resources/ticketing/types/IndividualCommonModelScopeDeserializer.java deleted file mode 100644 index 7fc461a60..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/IndividualCommonModelScopeDeserializer.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) -public final class IndividualCommonModelScopeDeserializer { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializer( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializer - && equalTo((IndividualCommonModelScopeDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializer other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializer other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializer build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializer other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions(Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializer build() { - return new IndividualCommonModelScopeDeserializer( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java deleted file mode 100644 index 262c52987..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) -public final class IndividualCommonModelScopeDeserializerRequest { - private final String modelName; - - private final Optional> modelPermissions; - - private final Optional fieldPermissions; - - private final Map additionalProperties; - - private IndividualCommonModelScopeDeserializerRequest( - String modelName, - Optional> modelPermissions, - Optional fieldPermissions, - Map additionalProperties) { - this.modelName = modelName; - this.modelPermissions = modelPermissions; - this.fieldPermissions = fieldPermissions; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_permissions") - public Optional> getModelPermissions() { - return modelPermissions; - } - - @JsonProperty("field_permissions") - public Optional getFieldPermissions() { - return fieldPermissions; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IndividualCommonModelScopeDeserializerRequest - && equalTo((IndividualCommonModelScopeDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { - return modelName.equals(other.modelName) - && modelPermissions.equals(other.modelPermissions) - && fieldPermissions.equals(other.fieldPermissions); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(IndividualCommonModelScopeDeserializerRequest other); - } - - public interface _FinalStage { - IndividualCommonModelScopeDeserializerRequest build(); - - _FinalStage modelPermissions(Optional> modelPermissions); - - _FinalStage modelPermissions(Map modelPermissions); - - _FinalStage fieldPermissions(Optional fieldPermissions); - - _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private Optional fieldPermissions = Optional.empty(); - - private Optional> modelPermissions = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(IndividualCommonModelScopeDeserializerRequest other) { - modelName(other.getModelName()); - modelPermissions(other.getModelPermissions()); - fieldPermissions(other.getFieldPermissions()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { - this.fieldPermissions = Optional.ofNullable(fieldPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) - public _FinalStage fieldPermissions(Optional fieldPermissions) { - this.fieldPermissions = fieldPermissions; - return this; - } - - @java.lang.Override - public _FinalStage modelPermissions(Map modelPermissions) { - this.modelPermissions = Optional.ofNullable(modelPermissions); - return this; - } - - @java.lang.Override - @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) - public _FinalStage modelPermissions( - Optional> modelPermissions) { - this.modelPermissions = modelPermissions; - return this; - } - - @java.lang.Override - public IndividualCommonModelScopeDeserializerRequest build() { - return new IndividualCommonModelScopeDeserializerRequest( - modelName, modelPermissions, fieldPermissions, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Issue.java b/src/main/java/com/merge/api/resources/ticketing/types/Issue.java deleted file mode 100644 index a36f4d7be..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/Issue.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Issue.Builder.class) -public final class Issue { - private final Optional id; - - private final Optional status; - - private final String errorDescription; - - private final Optional> endUser; - - private final Optional firstIncidentTime; - - private final Optional lastIncidentTime; - - private final Optional isMuted; - - private final Optional> errorDetails; - - private final Map additionalProperties; - - private Issue( - Optional id, - Optional status, - String errorDescription, - Optional> endUser, - Optional firstIncidentTime, - Optional lastIncidentTime, - Optional isMuted, - Optional> errorDetails, - Map additionalProperties) { - this.id = id; - this.status = status; - this.errorDescription = errorDescription; - this.endUser = endUser; - this.firstIncidentTime = firstIncidentTime; - this.lastIncidentTime = lastIncidentTime; - this.isMuted = isMuted; - this.errorDetails = errorDetails; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') - *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("error_description") - public String getErrorDescription() { - return errorDescription; - } - - @JsonProperty("end_user") - public Optional> getEndUser() { - return endUser; - } - - @JsonProperty("first_incident_time") - public Optional getFirstIncidentTime() { - return firstIncidentTime; - } - - @JsonProperty("last_incident_time") - public Optional getLastIncidentTime() { - return lastIncidentTime; - } - - @JsonProperty("is_muted") - public Optional getIsMuted() { - return isMuted; - } - - @JsonProperty("error_details") - public Optional> getErrorDetails() { - return errorDetails; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Issue && equalTo((Issue) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Issue other) { - return id.equals(other.id) - && status.equals(other.status) - && errorDescription.equals(other.errorDescription) - && endUser.equals(other.endUser) - && firstIncidentTime.equals(other.firstIncidentTime) - && lastIncidentTime.equals(other.lastIncidentTime) - && isMuted.equals(other.isMuted) - && errorDetails.equals(other.errorDetails); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.status, - this.errorDescription, - this.endUser, - this.firstIncidentTime, - this.lastIncidentTime, - this.isMuted, - this.errorDetails); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ErrorDescriptionStage builder() { - return new Builder(); - } - - public interface ErrorDescriptionStage { - _FinalStage errorDescription(@NotNull String errorDescription); - - Builder from(Issue other); - } - - public interface _FinalStage { - Issue build(); - - _FinalStage id(Optional id); - - _FinalStage id(String id); - - _FinalStage status(Optional status); - - _FinalStage status(IssueStatus status); - - _FinalStage endUser(Optional> endUser); - - _FinalStage endUser(Map endUser); - - _FinalStage firstIncidentTime(Optional firstIncidentTime); - - _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); - - _FinalStage lastIncidentTime(Optional lastIncidentTime); - - _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); - - _FinalStage isMuted(Optional isMuted); - - _FinalStage isMuted(Boolean isMuted); - - _FinalStage errorDetails(Optional> errorDetails); - - _FinalStage errorDetails(List errorDetails); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ErrorDescriptionStage, _FinalStage { - private String errorDescription; - - private Optional> errorDetails = Optional.empty(); - - private Optional isMuted = Optional.empty(); - - private Optional lastIncidentTime = Optional.empty(); - - private Optional firstIncidentTime = Optional.empty(); - - private Optional> endUser = Optional.empty(); - - private Optional status = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Issue other) { - id(other.getId()); - status(other.getStatus()); - errorDescription(other.getErrorDescription()); - endUser(other.getEndUser()); - firstIncidentTime(other.getFirstIncidentTime()); - lastIncidentTime(other.getLastIncidentTime()); - isMuted(other.getIsMuted()); - errorDetails(other.getErrorDetails()); - return this; - } - - @java.lang.Override - @JsonSetter("error_description") - public _FinalStage errorDescription(@NotNull String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - @java.lang.Override - public _FinalStage errorDetails(List errorDetails) { - this.errorDetails = Optional.ofNullable(errorDetails); - return this; - } - - @java.lang.Override - @JsonSetter(value = "error_details", nulls = Nulls.SKIP) - public _FinalStage errorDetails(Optional> errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - @java.lang.Override - public _FinalStage isMuted(Boolean isMuted) { - this.isMuted = Optional.ofNullable(isMuted); - return this; - } - - @java.lang.Override - @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) - public _FinalStage isMuted(Optional isMuted) { - this.isMuted = isMuted; - return this; - } - - @java.lang.Override - public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { - this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) - public _FinalStage lastIncidentTime(Optional lastIncidentTime) { - this.lastIncidentTime = lastIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { - this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); - return this; - } - - @java.lang.Override - @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) - public _FinalStage firstIncidentTime(Optional firstIncidentTime) { - this.firstIncidentTime = firstIncidentTime; - return this; - } - - @java.lang.Override - public _FinalStage endUser(Map endUser) { - this.endUser = Optional.ofNullable(endUser); - return this; - } - - @java.lang.Override - @JsonSetter(value = "end_user", nulls = Nulls.SKIP) - public _FinalStage endUser(Optional> endUser) { - this.endUser = endUser; - return this; - } - - /** - *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

- *
    - *
  • ONGOING - ONGOING
  • - *
  • RESOLVED - RESOLVED
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage status(IssueStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public Issue build() { - return new Issue( - id, - status, - errorDescription, - endUser, - firstIncidentTime, - lastIncidentTime, - isMuted, - errorDetails, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/IssueStatus.java b/src/main/java/com/merge/api/resources/ticketing/types/IssueStatus.java deleted file mode 100644 index b55316dff..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/IssueStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = IssueStatus.Deserializer.class) -public final class IssueStatus { - private final Object value; - - private final int type; - - private IssueStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((IssueStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof IssueStatus && equalTo((IssueStatus) other); - } - - private boolean equalTo(IssueStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static IssueStatus of(IssueStatusEnum value) { - return new IssueStatus(value, 0); - } - - public static IssueStatus of(String value) { - return new IssueStatus(value, 1); - } - - public interface Visitor { - T visit(IssueStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(IssueStatus.class); - } - - @java.lang.Override - public IssueStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/IssueStatusEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/IssueStatusEnum.java deleted file mode 100644 index b9dad8d84..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/IssueStatusEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum IssueStatusEnum { - ONGOING("ONGOING"), - - RESOLVED("RESOLVED"); - - private final String value; - - IssueStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ItemFormatEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/ItemFormatEnum.java deleted file mode 100644 index fe70f4d83..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ItemFormatEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemFormatEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - ItemFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ItemSchema.java b/src/main/java/com/merge/api/resources/ticketing/types/ItemSchema.java deleted file mode 100644 index 8850579c4..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ItemSchema.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ItemSchema.Builder.class) -public final class ItemSchema { - private final Optional itemType; - - private final Optional itemFormat; - - private final Optional> itemChoices; - - private final Map additionalProperties; - - private ItemSchema( - Optional itemType, - Optional itemFormat, - Optional> itemChoices, - Map additionalProperties) { - this.itemType = itemType; - this.itemFormat = itemFormat; - this.itemChoices = itemChoices; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("item_type") - public Optional getItemType() { - return itemType; - } - - @JsonProperty("item_format") - public Optional getItemFormat() { - return itemFormat; - } - - @JsonProperty("item_choices") - public Optional> getItemChoices() { - return itemChoices; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ItemSchema && equalTo((ItemSchema) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ItemSchema other) { - return itemType.equals(other.itemType) - && itemFormat.equals(other.itemFormat) - && itemChoices.equals(other.itemChoices); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional itemType = Optional.empty(); - - private Optional itemFormat = Optional.empty(); - - private Optional> itemChoices = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ItemSchema other) { - itemType(other.getItemType()); - itemFormat(other.getItemFormat()); - itemChoices(other.getItemChoices()); - return this; - } - - @JsonSetter(value = "item_type", nulls = Nulls.SKIP) - public Builder itemType(Optional itemType) { - this.itemType = itemType; - return this; - } - - public Builder itemType(ItemTypeEnum itemType) { - this.itemType = Optional.ofNullable(itemType); - return this; - } - - @JsonSetter(value = "item_format", nulls = Nulls.SKIP) - public Builder itemFormat(Optional itemFormat) { - this.itemFormat = itemFormat; - return this; - } - - public Builder itemFormat(ItemFormatEnum itemFormat) { - this.itemFormat = Optional.ofNullable(itemFormat); - return this; - } - - @JsonSetter(value = "item_choices", nulls = Nulls.SKIP) - public Builder itemChoices(Optional> itemChoices) { - this.itemChoices = itemChoices; - return this; - } - - public Builder itemChoices(List itemChoices) { - this.itemChoices = Optional.ofNullable(itemChoices); - return this; - } - - public ItemSchema build() { - return new ItemSchema(itemType, itemFormat, itemChoices, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ItemTypeEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/ItemTypeEnum.java deleted file mode 100644 index d499fb1f3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ItemTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ItemTypeEnum { - STRING("string"), - - NUMBER("number"), - - DATE("date"), - - DATETIME("datetime"), - - BOOL("bool"), - - LIST("list"); - - private final String value; - - ItemTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/LanguageEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/LanguageEnum.java deleted file mode 100644 index bf0a1997f..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/LanguageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum LanguageEnum { - EN("en"), - - DE("de"); - - private final String value; - - LanguageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/LinkToken.java b/src/main/java/com/merge/api/resources/ticketing/types/LinkToken.java deleted file mode 100644 index 0037880c3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/LinkToken.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkToken.Builder.class) -public final class LinkToken { - private final String linkToken; - - private final Optional integrationName; - - private final Optional magicLinkUrl; - - private final Map additionalProperties; - - private LinkToken( - String linkToken, - Optional integrationName, - Optional magicLinkUrl, - Map additionalProperties) { - this.linkToken = linkToken; - this.integrationName = integrationName; - this.magicLinkUrl = magicLinkUrl; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("link_token") - public String getLinkToken() { - return linkToken; - } - - @JsonProperty("integration_name") - public Optional getIntegrationName() { - return integrationName; - } - - @JsonProperty("magic_link_url") - public Optional getMagicLinkUrl() { - return magicLinkUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkToken && equalTo((LinkToken) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkToken other) { - return linkToken.equals(other.linkToken) - && integrationName.equals(other.integrationName) - && magicLinkUrl.equals(other.magicLinkUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkTokenStage builder() { - return new Builder(); - } - - public interface LinkTokenStage { - _FinalStage linkToken(@NotNull String linkToken); - - Builder from(LinkToken other); - } - - public interface _FinalStage { - LinkToken build(); - - _FinalStage integrationName(Optional integrationName); - - _FinalStage integrationName(String integrationName); - - _FinalStage magicLinkUrl(Optional magicLinkUrl); - - _FinalStage magicLinkUrl(String magicLinkUrl); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkTokenStage, _FinalStage { - private String linkToken; - - private Optional magicLinkUrl = Optional.empty(); - - private Optional integrationName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkToken other) { - linkToken(other.getLinkToken()); - integrationName(other.getIntegrationName()); - magicLinkUrl(other.getMagicLinkUrl()); - return this; - } - - @java.lang.Override - @JsonSetter("link_token") - public _FinalStage linkToken(@NotNull String linkToken) { - this.linkToken = linkToken; - return this; - } - - @java.lang.Override - public _FinalStage magicLinkUrl(String magicLinkUrl) { - this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); - return this; - } - - @java.lang.Override - @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) - public _FinalStage magicLinkUrl(Optional magicLinkUrl) { - this.magicLinkUrl = magicLinkUrl; - return this; - } - - @java.lang.Override - public _FinalStage integrationName(String integrationName) { - this.integrationName = Optional.ofNullable(integrationName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) - public _FinalStage integrationName(Optional integrationName) { - this.integrationName = integrationName; - return this; - } - - @java.lang.Override - public LinkToken build() { - return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/resources/ticketing/types/LinkedAccountStatus.java deleted file mode 100644 index 2f66c76b2..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/LinkedAccountStatus.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) -public final class LinkedAccountStatus { - private final String linkedAccountStatus; - - private final boolean canMakeRequest; - - private final Map additionalProperties; - - private LinkedAccountStatus( - String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { - this.linkedAccountStatus = linkedAccountStatus; - this.canMakeRequest = canMakeRequest; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("linked_account_status") - public String getLinkedAccountStatus() { - return linkedAccountStatus; - } - - @JsonProperty("can_make_request") - public boolean getCanMakeRequest() { - return canMakeRequest; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(LinkedAccountStatus other) { - return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LinkedAccountStatusStage builder() { - return new Builder(); - } - - public interface LinkedAccountStatusStage { - CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); - - Builder from(LinkedAccountStatus other); - } - - public interface CanMakeRequestStage { - _FinalStage canMakeRequest(boolean canMakeRequest); - } - - public interface _FinalStage { - LinkedAccountStatus build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { - private String linkedAccountStatus; - - private boolean canMakeRequest; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(LinkedAccountStatus other) { - linkedAccountStatus(other.getLinkedAccountStatus()); - canMakeRequest(other.getCanMakeRequest()); - return this; - } - - @java.lang.Override - @JsonSetter("linked_account_status") - public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { - this.linkedAccountStatus = linkedAccountStatus; - return this; - } - - @java.lang.Override - @JsonSetter("can_make_request") - public _FinalStage canMakeRequest(boolean canMakeRequest) { - this.canMakeRequest = canMakeRequest; - return this; - } - - @java.lang.Override - public LinkedAccountStatus build() { - return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/MetaResponse.java b/src/main/java/com/merge/api/resources/ticketing/types/MetaResponse.java deleted file mode 100644 index f6d3b88a5..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/MetaResponse.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MetaResponse.Builder.class) -public final class MetaResponse { - private final Map requestSchema; - - private final Optional> remoteFieldClasses; - - private final Optional status; - - private final boolean hasConditionalParams; - - private final boolean hasRequiredLinkedAccountParams; - - private final Map additionalProperties; - - private MetaResponse( - Map requestSchema, - Optional> remoteFieldClasses, - Optional status, - boolean hasConditionalParams, - boolean hasRequiredLinkedAccountParams, - Map additionalProperties) { - this.requestSchema = requestSchema; - this.remoteFieldClasses = remoteFieldClasses; - this.status = status; - this.hasConditionalParams = hasConditionalParams; - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("request_schema") - public Map getRequestSchema() { - return requestSchema; - } - - @JsonProperty("remote_field_classes") - public Optional> getRemoteFieldClasses() { - return remoteFieldClasses; - } - - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - @JsonProperty("has_conditional_params") - public boolean getHasConditionalParams() { - return hasConditionalParams; - } - - @JsonProperty("has_required_linked_account_params") - public boolean getHasRequiredLinkedAccountParams() { - return hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MetaResponse && equalTo((MetaResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MetaResponse other) { - return requestSchema.equals(other.requestSchema) - && remoteFieldClasses.equals(other.remoteFieldClasses) - && status.equals(other.status) - && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.requestSchema, - this.remoteFieldClasses, - this.status, - this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static HasConditionalParamsStage builder() { - return new Builder(); - } - - public interface HasConditionalParamsStage { - HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); - - Builder from(MetaResponse other); - } - - public interface HasRequiredLinkedAccountParamsStage { - _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); - } - - public interface _FinalStage { - MetaResponse build(); - - _FinalStage requestSchema(Map requestSchema); - - _FinalStage putAllRequestSchema(Map requestSchema); - - _FinalStage requestSchema(String key, JsonNode value); - - _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); - - _FinalStage remoteFieldClasses(Map remoteFieldClasses); - - _FinalStage status(Optional status); - - _FinalStage status(LinkedAccountStatus status); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { - private boolean hasConditionalParams; - - private boolean hasRequiredLinkedAccountParams; - - private Optional status = Optional.empty(); - - private Optional> remoteFieldClasses = Optional.empty(); - - private Map requestSchema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MetaResponse other) { - requestSchema(other.getRequestSchema()); - remoteFieldClasses(other.getRemoteFieldClasses()); - status(other.getStatus()); - hasConditionalParams(other.getHasConditionalParams()); - hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); - return this; - } - - @java.lang.Override - @JsonSetter("has_conditional_params") - public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { - this.hasConditionalParams = hasConditionalParams; - return this; - } - - @java.lang.Override - @JsonSetter("has_required_linked_account_params") - public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { - this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; - return this; - } - - @java.lang.Override - public _FinalStage status(LinkedAccountStatus status) { - this.status = Optional.ofNullable(status); - return this; - } - - @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; - return this; - } - - @java.lang.Override - public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { - this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); - return this; - } - - @java.lang.Override - @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) - public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { - this.remoteFieldClasses = remoteFieldClasses; - return this; - } - - @java.lang.Override - public _FinalStage requestSchema(String key, JsonNode value) { - this.requestSchema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllRequestSchema(Map requestSchema) { - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) - public _FinalStage requestSchema(Map requestSchema) { - this.requestSchema.clear(); - this.requestSchema.putAll(requestSchema); - return this; - } - - @java.lang.Override - public MetaResponse build() { - return new MetaResponse( - requestSchema, - remoteFieldClasses, - status, - hasConditionalParams, - hasRequiredLinkedAccountParams, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/MethodEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/MethodEnum.java deleted file mode 100644 index 136ad6265..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/MethodEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum MethodEnum { - GET("GET"), - - OPTIONS("OPTIONS"), - - HEAD("HEAD"), - - POST("POST"), - - PUT("PUT"), - - PATCH("PATCH"), - - DELETE("DELETE"); - - private final String value; - - MethodEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ModelOperation.java b/src/main/java/com/merge/api/resources/ticketing/types/ModelOperation.java deleted file mode 100644 index 6ee065d3d..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ModelOperation.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelOperation.Builder.class) -public final class ModelOperation { - private final String modelName; - - private final List availableOperations; - - private final List requiredPostParameters; - - private final List supportedFields; - - private final Map additionalProperties; - - private ModelOperation( - String modelName, - List availableOperations, - List requiredPostParameters, - List supportedFields, - Map additionalProperties) { - this.modelName = modelName; - this.availableOperations = availableOperations; - this.requiredPostParameters = requiredPostParameters; - this.supportedFields = supportedFields; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("available_operations") - public List getAvailableOperations() { - return availableOperations; - } - - @JsonProperty("required_post_parameters") - public List getRequiredPostParameters() { - return requiredPostParameters; - } - - @JsonProperty("supported_fields") - public List getSupportedFields() { - return supportedFields; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelOperation && equalTo((ModelOperation) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelOperation other) { - return modelName.equals(other.modelName) - && availableOperations.equals(other.availableOperations) - && requiredPostParameters.equals(other.requiredPostParameters) - && supportedFields.equals(other.supportedFields); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - _FinalStage modelName(@NotNull String modelName); - - Builder from(ModelOperation other); - } - - public interface _FinalStage { - ModelOperation build(); - - _FinalStage availableOperations(List availableOperations); - - _FinalStage addAvailableOperations(String availableOperations); - - _FinalStage addAllAvailableOperations(List availableOperations); - - _FinalStage requiredPostParameters(List requiredPostParameters); - - _FinalStage addRequiredPostParameters(String requiredPostParameters); - - _FinalStage addAllRequiredPostParameters(List requiredPostParameters); - - _FinalStage supportedFields(List supportedFields); - - _FinalStage addSupportedFields(String supportedFields); - - _FinalStage addAllSupportedFields(List supportedFields); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelNameStage, _FinalStage { - private String modelName; - - private List supportedFields = new ArrayList<>(); - - private List requiredPostParameters = new ArrayList<>(); - - private List availableOperations = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ModelOperation other) { - modelName(other.getModelName()); - availableOperations(other.getAvailableOperations()); - requiredPostParameters(other.getRequiredPostParameters()); - supportedFields(other.getSupportedFields()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public _FinalStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - public _FinalStage addAllSupportedFields(List supportedFields) { - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addSupportedFields(String supportedFields) { - this.supportedFields.add(supportedFields); - return this; - } - - @java.lang.Override - @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) - public _FinalStage supportedFields(List supportedFields) { - this.supportedFields.clear(); - this.supportedFields.addAll(supportedFields); - return this; - } - - @java.lang.Override - public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addRequiredPostParameters(String requiredPostParameters) { - this.requiredPostParameters.add(requiredPostParameters); - return this; - } - - @java.lang.Override - @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) - public _FinalStage requiredPostParameters(List requiredPostParameters) { - this.requiredPostParameters.clear(); - this.requiredPostParameters.addAll(requiredPostParameters); - return this; - } - - @java.lang.Override - public _FinalStage addAllAvailableOperations(List availableOperations) { - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public _FinalStage addAvailableOperations(String availableOperations) { - this.availableOperations.add(availableOperations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) - public _FinalStage availableOperations(List availableOperations) { - this.availableOperations.clear(); - this.availableOperations.addAll(availableOperations); - return this; - } - - @java.lang.Override - public ModelOperation build() { - return new ModelOperation( - modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/resources/ticketing/types/ModelPermissionDeserializer.java deleted file mode 100644 index 0dd3bf4f2..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ModelPermissionDeserializer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) -public final class ModelPermissionDeserializer { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializer other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializer other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializer build() { - return new ModelPermissionDeserializer(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/ModelPermissionDeserializerRequest.java deleted file mode 100644 index 779a0e8fa..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ModelPermissionDeserializerRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) -public final class ModelPermissionDeserializerRequest { - private final Optional isEnabled; - - private final Map additionalProperties; - - private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { - this.isEnabled = isEnabled; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("is_enabled") - public Optional getIsEnabled() { - return isEnabled; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ModelPermissionDeserializerRequest - && equalTo((ModelPermissionDeserializerRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ModelPermissionDeserializerRequest other) { - return isEnabled.equals(other.isEnabled); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.isEnabled); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional isEnabled = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ModelPermissionDeserializerRequest other) { - isEnabled(other.getIsEnabled()); - return this; - } - - @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) - public Builder isEnabled(Optional isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - public Builder isEnabled(Boolean isEnabled) { - this.isEnabled = Optional.ofNullable(isEnabled); - return this; - } - - public ModelPermissionDeserializerRequest build() { - return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/MultipartFormFieldRequest.java deleted file mode 100644 index 9ec4046cd..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/MultipartFormFieldRequest.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) -public final class MultipartFormFieldRequest { - private final String name; - - private final String data; - - private final Optional encoding; - - private final Optional fileName; - - private final Optional contentType; - - private final Map additionalProperties; - - private MultipartFormFieldRequest( - String name, - String data, - Optional encoding, - Optional fileName, - Optional contentType, - Map additionalProperties) { - this.name = name; - this.data = data; - this.encoding = encoding; - this.fileName = fileName; - this.contentType = contentType; - this.additionalProperties = additionalProperties; - } - - /** - * @return The name of the form field - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The data for the form field. - */ - @JsonProperty("data") - public String getData() { - return data; - } - - /** - * @return The encoding of the value of data. Defaults to RAW if not defined. - *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- */ - @JsonProperty("encoding") - public Optional getEncoding() { - return encoding; - } - - /** - * @return The file name of the form field, if the field is for a file. - */ - @JsonProperty("file_name") - public Optional getFileName() { - return fileName; - } - - /** - * @return The MIME type of the file, if the field is for a file. - */ - @JsonProperty("content_type") - public Optional getContentType() { - return contentType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(MultipartFormFieldRequest other) { - return name.equals(other.name) - && data.equals(other.data) - && encoding.equals(other.encoding) - && fileName.equals(other.fileName) - && contentType.equals(other.contentType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - DataStage name(@NotNull String name); - - Builder from(MultipartFormFieldRequest other); - } - - public interface DataStage { - _FinalStage data(@NotNull String data); - } - - public interface _FinalStage { - MultipartFormFieldRequest build(); - - _FinalStage encoding(Optional encoding); - - _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); - - _FinalStage fileName(Optional fileName); - - _FinalStage fileName(String fileName); - - _FinalStage contentType(Optional contentType); - - _FinalStage contentType(String contentType); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, DataStage, _FinalStage { - private String name; - - private String data; - - private Optional contentType = Optional.empty(); - - private Optional fileName = Optional.empty(); - - private Optional encoding = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(MultipartFormFieldRequest other) { - name(other.getName()); - data(other.getData()); - encoding(other.getEncoding()); - fileName(other.getFileName()); - contentType(other.getContentType()); - return this; - } - - /** - *

The name of the form field

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name") - public DataStage name(@NotNull String name) { - this.name = name; - return this; - } - - /** - *

The data for the form field.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull String data) { - this.data = data; - return this; - } - - /** - *

The MIME type of the file, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public _FinalStage contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - /** - *

The file name of the form field, if the field is for a file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage fileName(String fileName) { - this.fileName = Optional.ofNullable(fileName); - return this; - } - - @java.lang.Override - @JsonSetter(value = "file_name", nulls = Nulls.SKIP) - public _FinalStage fileName(Optional fileName) { - this.fileName = fileName; - return this; - } - - /** - *

The encoding of the value of data. Defaults to RAW if not defined.

- *
    - *
  • RAW - RAW
  • - *
  • BASE64 - BASE64
  • - *
  • GZIP_BASE64 - GZIP_BASE64
  • - *
- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { - this.encoding = Optional.ofNullable(encoding); - return this; - } - - @java.lang.Override - @JsonSetter(value = "encoding", nulls = Nulls.SKIP) - public _FinalStage encoding(Optional encoding) { - this.encoding = encoding; - return this; - } - - @java.lang.Override - public MultipartFormFieldRequest build() { - return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/resources/ticketing/types/MultipartFormFieldRequestEncoding.java deleted file mode 100644 index be3138383..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/MultipartFormFieldRequestEncoding.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) -public final class MultipartFormFieldRequestEncoding { - private final Object value; - - private final int type; - - private MultipartFormFieldRequestEncoding(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((EncodingEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); - } - - private boolean equalTo(MultipartFormFieldRequestEncoding other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { - return new MultipartFormFieldRequestEncoding(value, 0); - } - - public static MultipartFormFieldRequestEncoding of(String value) { - return new MultipartFormFieldRequestEncoding(value, 1); - } - - public interface Visitor { - T visit(EncodingEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(MultipartFormFieldRequestEncoding.class); - } - - @java.lang.Override - public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAccountDetailsAndActionsList.java deleted file mode 100644 index 4f2bfbf13..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAccountDetailsAndActionsList.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) -public final class PaginatedAccountDetailsAndActionsList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountDetailsAndActionsList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountDetailsAndActionsList - && equalTo((PaginatedAccountDetailsAndActionsList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountDetailsAndActionsList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountDetailsAndActionsList build() { - return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAccountList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAccountList.java deleted file mode 100644 index 1d514c1a6..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAccountList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAccountList.Builder.class) -public final class PaginatedAccountList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAccountList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAccountList && equalTo((PaginatedAccountList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAccountList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAccountList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAccountList build() { - return new PaginatedAccountList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAttachmentList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAttachmentList.java deleted file mode 100644 index 91cdf9eac..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAttachmentList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAttachmentList.Builder.class) -public final class PaginatedAttachmentList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAttachmentList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAttachmentList && equalTo((PaginatedAttachmentList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAttachmentList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAttachmentList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAttachmentList build() { - return new PaginatedAttachmentList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAuditLogEventList.java deleted file mode 100644 index 2239a0c7e..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedAuditLogEventList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) -public final class PaginatedAuditLogEventList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedAuditLogEventList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedAuditLogEventList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedAuditLogEventList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedAuditLogEventList build() { - return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedContactList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedContactList.java deleted file mode 100644 index 6c4edf6ec..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedContactList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedContactList.Builder.class) -public final class PaginatedContactList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedContactList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedContactList && equalTo((PaginatedContactList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedContactList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedContactList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedContactList build() { - return new PaginatedContactList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedIssueList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedIssueList.java deleted file mode 100644 index 127326d85..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedIssueList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedIssueList.Builder.class) -public final class PaginatedIssueList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedIssueList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedIssueList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedIssueList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedIssueList build() { - return new PaginatedIssueList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedRemoteFieldClassList.java deleted file mode 100644 index 17423cc62..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedRemoteFieldClassList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedRemoteFieldClassList.Builder.class) -public final class PaginatedRemoteFieldClassList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedRemoteFieldClassList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedRemoteFieldClassList && equalTo((PaginatedRemoteFieldClassList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedRemoteFieldClassList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedRemoteFieldClassList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedRemoteFieldClassList build() { - return new PaginatedRemoteFieldClassList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedSyncStatusList.java deleted file mode 100644 index 1adc8ee86..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedSyncStatusList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) -public final class PaginatedSyncStatusList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedSyncStatusList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedSyncStatusList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedSyncStatusList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedSyncStatusList build() { - return new PaginatedSyncStatusList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTagList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTagList.java deleted file mode 100644 index b28fb3301..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTagList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedTagList.Builder.class) -public final class PaginatedTagList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedTagList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedTagList && equalTo((PaginatedTagList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedTagList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedTagList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedTagList build() { - return new PaginatedTagList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTeamList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTeamList.java deleted file mode 100644 index 8837f0617..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTeamList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedTeamList.Builder.class) -public final class PaginatedTeamList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedTeamList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedTeamList && equalTo((PaginatedTeamList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedTeamList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedTeamList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedTeamList build() { - return new PaginatedTeamList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedUserList.java b/src/main/java/com/merge/api/resources/ticketing/types/PaginatedUserList.java deleted file mode 100644 index b28364e15..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedUserList.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PaginatedUserList.Builder.class) -public final class PaginatedUserList { - private final Optional next; - - private final Optional previous; - - private final Optional> results; - - private final Map additionalProperties; - - private PaginatedUserList( - Optional next, - Optional previous, - Optional> results, - Map additionalProperties) { - this.next = next; - this.previous = previous; - this.results = results; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("next") - public Optional getNext() { - return next; - } - - @JsonProperty("previous") - public Optional getPrevious() { - return previous; - } - - @JsonProperty("results") - public Optional> getResults() { - return results; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PaginatedUserList other) { - return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.next, this.previous, this.results); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional next = Optional.empty(); - - private Optional previous = Optional.empty(); - - private Optional> results = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PaginatedUserList other) { - next(other.getNext()); - previous(other.getPrevious()); - results(other.getResults()); - return this; - } - - @JsonSetter(value = "next", nulls = Nulls.SKIP) - public Builder next(Optional next) { - this.next = next; - return this; - } - - public Builder next(String next) { - this.next = Optional.ofNullable(next); - return this; - } - - @JsonSetter(value = "previous", nulls = Nulls.SKIP) - public Builder previous(Optional previous) { - this.previous = previous; - return this; - } - - public Builder previous(String previous) { - this.previous = Optional.ofNullable(previous); - return this; - } - - @JsonSetter(value = "results", nulls = Nulls.SKIP) - public Builder results(Optional> results) { - this.results = results; - return this; - } - - public Builder results(List results) { - this.results = Optional.ofNullable(results); - return this; - } - - public PaginatedUserList build() { - return new PaginatedUserList(next, previous, results, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequestPriority.java b/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequestPriority.java deleted file mode 100644 index 716e0ca18..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequestPriority.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PatchedTicketRequestPriority.Deserializer.class) -public final class PatchedTicketRequestPriority { - private final Object value; - - private final int type; - - private PatchedTicketRequestPriority(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PriorityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedTicketRequestPriority && equalTo((PatchedTicketRequestPriority) other); - } - - private boolean equalTo(PatchedTicketRequestPriority other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PatchedTicketRequestPriority of(PriorityEnum value) { - return new PatchedTicketRequestPriority(value, 0); - } - - public static PatchedTicketRequestPriority of(String value) { - return new PatchedTicketRequestPriority(value, 1); - } - - public interface Visitor { - T visit(PriorityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PatchedTicketRequestPriority.class); - } - - @java.lang.Override - public PatchedTicketRequestPriority deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PriorityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequestStatus.java b/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequestStatus.java deleted file mode 100644 index ed532e9f4..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = PatchedTicketRequestStatus.Deserializer.class) -public final class PatchedTicketRequestStatus { - private final Object value; - - private final int type; - - private PatchedTicketRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TicketStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PatchedTicketRequestStatus && equalTo((PatchedTicketRequestStatus) other); - } - - private boolean equalTo(PatchedTicketRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static PatchedTicketRequestStatus of(TicketStatusEnum value) { - return new PatchedTicketRequestStatus(value, 0); - } - - public static PatchedTicketRequestStatus of(String value) { - return new PatchedTicketRequestStatus(value, 1); - } - - public interface Visitor { - T visit(TicketStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(PatchedTicketRequestStatus.class); - } - - @java.lang.Override - public PatchedTicketRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TicketStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteData.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteData.java deleted file mode 100644 index 6e0b07910..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteData.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteData.Builder.class) -public final class RemoteData { - private final String path; - - private final Optional data; - - private final Map additionalProperties; - - private RemoteData(String path, Optional data, Map additionalProperties) { - this.path = path; - this.data = data; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API path that is being called. - */ - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("data") - public Optional getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteData && equalTo((RemoteData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteData other) { - return path.equals(other.path) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.path, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PathStage builder() { - return new Builder(); - } - - public interface PathStage { - _FinalStage path(@NotNull String path); - - Builder from(RemoteData other); - } - - public interface _FinalStage { - RemoteData build(); - - _FinalStage data(Optional data); - - _FinalStage data(JsonNode data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PathStage, _FinalStage { - private String path; - - private Optional data = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteData other) { - path(other.getPath()); - data(other.getData()); - return this; - } - - /** - *

The third-party API path that is being called.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("path") - public _FinalStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - public _FinalStage data(JsonNode data) { - this.data = Optional.ofNullable(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(Optional data) { - this.data = data; - return this; - } - - @java.lang.Override - public RemoteData build() { - return new RemoteData(path, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteEndpointInfo.java deleted file mode 100644 index 6039ca289..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteEndpointInfo.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) -public final class RemoteEndpointInfo { - private final String method; - - private final String urlPath; - - private final List fieldTraversalPath; - - private final Map additionalProperties; - - private RemoteEndpointInfo( - String method, - String urlPath, - List fieldTraversalPath, - Map additionalProperties) { - this.method = method; - this.urlPath = urlPath; - this.fieldTraversalPath = fieldTraversalPath; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("url_path") - public String getUrlPath() { - return urlPath; - } - - @JsonProperty("field_traversal_path") - public List getFieldTraversalPath() { - return fieldTraversalPath; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteEndpointInfo other) { - return method.equals(other.method) - && urlPath.equals(other.urlPath) - && fieldTraversalPath.equals(other.fieldTraversalPath); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - UrlPathStage method(@NotNull String method); - - Builder from(RemoteEndpointInfo other); - } - - public interface UrlPathStage { - _FinalStage urlPath(@NotNull String urlPath); - } - - public interface _FinalStage { - RemoteEndpointInfo build(); - - _FinalStage fieldTraversalPath(List fieldTraversalPath); - - _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); - - _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { - private String method; - - private String urlPath; - - private List fieldTraversalPath = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteEndpointInfo other) { - method(other.getMethod()); - urlPath(other.getUrlPath()); - fieldTraversalPath(other.getFieldTraversalPath()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public UrlPathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("url_path") - public _FinalStage urlPath(@NotNull String urlPath) { - this.urlPath = urlPath; - return this; - } - - @java.lang.Override - public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { - this.fieldTraversalPath.add(fieldTraversalPath); - return this; - } - - @java.lang.Override - @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) - public _FinalStage fieldTraversalPath(List fieldTraversalPath) { - this.fieldTraversalPath.clear(); - this.fieldTraversalPath.addAll(fieldTraversalPath); - return this; - } - - @java.lang.Override - public RemoteEndpointInfo build() { - return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteField.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteField.java deleted file mode 100644 index de378894f..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteField.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteField.Builder.class) -public final class RemoteField { - private final RemoteFieldRemoteFieldClass remoteFieldClass; - - private final Optional value; - - private final Map additionalProperties; - - private RemoteField( - RemoteFieldRemoteFieldClass remoteFieldClass, - Optional value, - Map additionalProperties) { - this.remoteFieldClass = remoteFieldClass; - this.value = value; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_field_class") - public RemoteFieldRemoteFieldClass getRemoteFieldClass() { - return remoteFieldClass; - } - - @JsonProperty("value") - public Optional getValue() { - return value; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteField && equalTo((RemoteField) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteField other) { - return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldClass, this.value); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteFieldClassStage builder() { - return new Builder(); - } - - public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass); - - Builder from(RemoteField other); - } - - public interface _FinalStage { - RemoteField build(); - - _FinalStage value(Optional value); - - _FinalStage value(JsonNode value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldRemoteFieldClass remoteFieldClass; - - private Optional value = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteField other) { - remoteFieldClass(other.getRemoteFieldClass()); - value(other.getValue()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { - this.remoteFieldClass = remoteFieldClass; - return this; - } - - @java.lang.Override - public _FinalStage value(JsonNode value) { - this.value = Optional.ofNullable(value); - return this; - } - - @java.lang.Override - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public _FinalStage value(Optional value) { - this.value = value; - return this; - } - - @java.lang.Override - public RemoteField build() { - return new RemoteField(remoteFieldClass, value, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApi.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApi.java deleted file mode 100644 index 024fef7e3..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApi.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApi.Builder.class) -public final class RemoteFieldApi { - private final Map schema; - - private final String remoteKeyName; - - private final RemoteEndpointInfo remoteEndpointInfo; - - private final Optional> exampleValues; - - private final Optional advancedMetadata; - - private final Optional coverage; - - private final Map additionalProperties; - - private RemoteFieldApi( - Map schema, - String remoteKeyName, - RemoteEndpointInfo remoteEndpointInfo, - Optional> exampleValues, - Optional advancedMetadata, - Optional coverage, - Map additionalProperties) { - this.schema = schema; - this.remoteKeyName = remoteKeyName; - this.remoteEndpointInfo = remoteEndpointInfo; - this.exampleValues = exampleValues; - this.advancedMetadata = advancedMetadata; - this.coverage = coverage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("schema") - public Map getSchema() { - return schema; - } - - @JsonProperty("remote_key_name") - public String getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("remote_endpoint_info") - public RemoteEndpointInfo getRemoteEndpointInfo() { - return remoteEndpointInfo; - } - - @JsonProperty("example_values") - public Optional> getExampleValues() { - return exampleValues; - } - - @JsonProperty("advanced_metadata") - public Optional getAdvancedMetadata() { - return advancedMetadata; - } - - @JsonProperty("coverage") - public Optional getCoverage() { - return coverage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApi other) { - return schema.equals(other.schema) - && remoteKeyName.equals(other.remoteKeyName) - && remoteEndpointInfo.equals(other.remoteEndpointInfo) - && exampleValues.equals(other.exampleValues) - && advancedMetadata.equals(other.advancedMetadata) - && coverage.equals(other.coverage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.schema, - this.remoteKeyName, - this.remoteEndpointInfo, - this.exampleValues, - this.advancedMetadata, - this.coverage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteKeyNameStage builder() { - return new Builder(); - } - - public interface RemoteKeyNameStage { - RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); - - Builder from(RemoteFieldApi other); - } - - public interface RemoteEndpointInfoStage { - _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); - } - - public interface _FinalStage { - RemoteFieldApi build(); - - _FinalStage schema(Map schema); - - _FinalStage putAllSchema(Map schema); - - _FinalStage schema(String key, JsonNode value); - - _FinalStage exampleValues(Optional> exampleValues); - - _FinalStage exampleValues(List exampleValues); - - _FinalStage advancedMetadata(Optional advancedMetadata); - - _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); - - _FinalStage coverage(Optional coverage); - - _FinalStage coverage(RemoteFieldApiCoverage coverage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { - private String remoteKeyName; - - private RemoteEndpointInfo remoteEndpointInfo; - - private Optional coverage = Optional.empty(); - - private Optional advancedMetadata = Optional.empty(); - - private Optional> exampleValues = Optional.empty(); - - private Map schema = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldApi other) { - schema(other.getSchema()); - remoteKeyName(other.getRemoteKeyName()); - remoteEndpointInfo(other.getRemoteEndpointInfo()); - exampleValues(other.getExampleValues()); - advancedMetadata(other.getAdvancedMetadata()); - coverage(other.getCoverage()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_key_name") - public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - @java.lang.Override - @JsonSetter("remote_endpoint_info") - public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { - this.remoteEndpointInfo = remoteEndpointInfo; - return this; - } - - @java.lang.Override - public _FinalStage coverage(RemoteFieldApiCoverage coverage) { - this.coverage = Optional.ofNullable(coverage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "coverage", nulls = Nulls.SKIP) - public _FinalStage coverage(Optional coverage) { - this.coverage = coverage; - return this; - } - - @java.lang.Override - public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { - this.advancedMetadata = Optional.ofNullable(advancedMetadata); - return this; - } - - @java.lang.Override - @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) - public _FinalStage advancedMetadata(Optional advancedMetadata) { - this.advancedMetadata = advancedMetadata; - return this; - } - - @java.lang.Override - public _FinalStage exampleValues(List exampleValues) { - this.exampleValues = Optional.ofNullable(exampleValues); - return this; - } - - @java.lang.Override - @JsonSetter(value = "example_values", nulls = Nulls.SKIP) - public _FinalStage exampleValues(Optional> exampleValues) { - this.exampleValues = exampleValues; - return this; - } - - @java.lang.Override - public _FinalStage schema(String key, JsonNode value) { - this.schema.put(key, value); - return this; - } - - @java.lang.Override - public _FinalStage putAllSchema(Map schema) { - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - @JsonSetter(value = "schema", nulls = Nulls.SKIP) - public _FinalStage schema(Map schema) { - this.schema.clear(); - this.schema.putAll(schema); - return this; - } - - @java.lang.Override - public RemoteFieldApi build() { - return new RemoteFieldApi( - schema, - remoteKeyName, - remoteEndpointInfo, - exampleValues, - advancedMetadata, - coverage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApiCoverage.java deleted file mode 100644 index 9c6a4546f..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApiCoverage.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) -public final class RemoteFieldApiCoverage { - private final Object value; - - private final int type; - - private RemoteFieldApiCoverage(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((int) this.value); - } else if (this.type == 1) { - return visitor.visit((double) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); - } - - private boolean equalTo(RemoteFieldApiCoverage other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldApiCoverage of(int value) { - return new RemoteFieldApiCoverage(value, 0); - } - - public static RemoteFieldApiCoverage of(double value) { - return new RemoteFieldApiCoverage(value, 1); - } - - public interface Visitor { - T visit(int value); - - T visit(double value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldApiCoverage.class); - } - - @java.lang.Override - public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - if (value instanceof Integer) { - return of((Integer) value); - } - if (value instanceof Double) { - return of((Double) value); - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApiResponse.java deleted file mode 100644 index b9cee4146..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldApiResponse.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) -public final class RemoteFieldApiResponse { - private final Optional> ticket; - - private final Optional> comment; - - private final Optional> project; - - private final Optional> collection; - - private final Optional> user; - - private final Optional> role; - - private final Optional> account; - - private final Optional> team; - - private final Optional> attachment; - - private final Optional> tag; - - private final Optional> contact; - - private final Map additionalProperties; - - private RemoteFieldApiResponse( - Optional> ticket, - Optional> comment, - Optional> project, - Optional> collection, - Optional> user, - Optional> role, - Optional> account, - Optional> team, - Optional> attachment, - Optional> tag, - Optional> contact, - Map additionalProperties) { - this.ticket = ticket; - this.comment = comment; - this.project = project; - this.collection = collection; - this.user = user; - this.role = role; - this.account = account; - this.team = team; - this.attachment = attachment; - this.tag = tag; - this.contact = contact; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("Ticket") - public Optional> getTicket() { - return ticket; - } - - @JsonProperty("Comment") - public Optional> getComment() { - return comment; - } - - @JsonProperty("Project") - public Optional> getProject() { - return project; - } - - @JsonProperty("Collection") - public Optional> getCollection() { - return collection; - } - - @JsonProperty("User") - public Optional> getUser() { - return user; - } - - @JsonProperty("Role") - public Optional> getRole() { - return role; - } - - @JsonProperty("Account") - public Optional> getAccount() { - return account; - } - - @JsonProperty("Team") - public Optional> getTeam() { - return team; - } - - @JsonProperty("Attachment") - public Optional> getAttachment() { - return attachment; - } - - @JsonProperty("Tag") - public Optional> getTag() { - return tag; - } - - @JsonProperty("Contact") - public Optional> getContact() { - return contact; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldApiResponse other) { - return ticket.equals(other.ticket) - && comment.equals(other.comment) - && project.equals(other.project) - && collection.equals(other.collection) - && user.equals(other.user) - && role.equals(other.role) - && account.equals(other.account) - && team.equals(other.team) - && attachment.equals(other.attachment) - && tag.equals(other.tag) - && contact.equals(other.contact); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.ticket, - this.comment, - this.project, - this.collection, - this.user, - this.role, - this.account, - this.team, - this.attachment, - this.tag, - this.contact); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional> ticket = Optional.empty(); - - private Optional> comment = Optional.empty(); - - private Optional> project = Optional.empty(); - - private Optional> collection = Optional.empty(); - - private Optional> user = Optional.empty(); - - private Optional> role = Optional.empty(); - - private Optional> account = Optional.empty(); - - private Optional> team = Optional.empty(); - - private Optional> attachment = Optional.empty(); - - private Optional> tag = Optional.empty(); - - private Optional> contact = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldApiResponse other) { - ticket(other.getTicket()); - comment(other.getComment()); - project(other.getProject()); - collection(other.getCollection()); - user(other.getUser()); - role(other.getRole()); - account(other.getAccount()); - team(other.getTeam()); - attachment(other.getAttachment()); - tag(other.getTag()); - contact(other.getContact()); - return this; - } - - @JsonSetter(value = "Ticket", nulls = Nulls.SKIP) - public Builder ticket(Optional> ticket) { - this.ticket = ticket; - return this; - } - - public Builder ticket(List ticket) { - this.ticket = Optional.ofNullable(ticket); - return this; - } - - @JsonSetter(value = "Comment", nulls = Nulls.SKIP) - public Builder comment(Optional> comment) { - this.comment = comment; - return this; - } - - public Builder comment(List comment) { - this.comment = Optional.ofNullable(comment); - return this; - } - - @JsonSetter(value = "Project", nulls = Nulls.SKIP) - public Builder project(Optional> project) { - this.project = project; - return this; - } - - public Builder project(List project) { - this.project = Optional.ofNullable(project); - return this; - } - - @JsonSetter(value = "Collection", nulls = Nulls.SKIP) - public Builder collection(Optional> collection) { - this.collection = collection; - return this; - } - - public Builder collection(List collection) { - this.collection = Optional.ofNullable(collection); - return this; - } - - @JsonSetter(value = "User", nulls = Nulls.SKIP) - public Builder user(Optional> user) { - this.user = user; - return this; - } - - public Builder user(List user) { - this.user = Optional.ofNullable(user); - return this; - } - - @JsonSetter(value = "Role", nulls = Nulls.SKIP) - public Builder role(Optional> role) { - this.role = role; - return this; - } - - public Builder role(List role) { - this.role = Optional.ofNullable(role); - return this; - } - - @JsonSetter(value = "Account", nulls = Nulls.SKIP) - public Builder account(Optional> account) { - this.account = account; - return this; - } - - public Builder account(List account) { - this.account = Optional.ofNullable(account); - return this; - } - - @JsonSetter(value = "Team", nulls = Nulls.SKIP) - public Builder team(Optional> team) { - this.team = team; - return this; - } - - public Builder team(List team) { - this.team = Optional.ofNullable(team); - return this; - } - - @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) - public Builder attachment(Optional> attachment) { - this.attachment = attachment; - return this; - } - - public Builder attachment(List attachment) { - this.attachment = Optional.ofNullable(attachment); - return this; - } - - @JsonSetter(value = "Tag", nulls = Nulls.SKIP) - public Builder tag(Optional> tag) { - this.tag = tag; - return this; - } - - public Builder tag(List tag) { - this.tag = Optional.ofNullable(tag); - return this; - } - - @JsonSetter(value = "Contact", nulls = Nulls.SKIP) - public Builder contact(Optional> contact) { - this.contact = contact; - return this; - } - - public Builder contact(List contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - public RemoteFieldApiResponse build() { - return new RemoteFieldApiResponse( - ticket, - comment, - project, - collection, - user, - role, - account, - team, - attachment, - tag, - contact, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClass.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClass.java deleted file mode 100644 index 207e7f3b8..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClass.java +++ /dev/null @@ -1,335 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldClass.Builder.class) -public final class RemoteFieldClass { - private final Optional id; - - private final Optional displayName; - - private final Optional remoteKeyName; - - private final Optional description; - - private final Optional isCustom; - - private final Optional isRequired; - - private final Optional fieldType; - - private final Optional fieldFormat; - - private final Optional> fieldChoices; - - private final Optional itemSchema; - - private final Map additionalProperties; - - private RemoteFieldClass( - Optional id, - Optional displayName, - Optional remoteKeyName, - Optional description, - Optional isCustom, - Optional isRequired, - Optional fieldType, - Optional fieldFormat, - Optional> fieldChoices, - Optional itemSchema, - Map additionalProperties) { - this.id = id; - this.displayName = displayName; - this.remoteKeyName = remoteKeyName; - this.description = description; - this.isCustom = isCustom; - this.isRequired = isRequired; - this.fieldType = fieldType; - this.fieldFormat = fieldFormat; - this.fieldChoices = fieldChoices; - this.itemSchema = itemSchema; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @JsonProperty("remote_key_name") - public Optional getRemoteKeyName() { - return remoteKeyName; - } - - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @JsonProperty("is_custom") - public Optional getIsCustom() { - return isCustom; - } - - @JsonProperty("is_required") - public Optional getIsRequired() { - return isRequired; - } - - @JsonProperty("field_type") - public Optional getFieldType() { - return fieldType; - } - - @JsonProperty("field_format") - public Optional getFieldFormat() { - return fieldFormat; - } - - @JsonProperty("field_choices") - public Optional> getFieldChoices() { - return fieldChoices; - } - - @JsonProperty("item_schema") - public Optional getItemSchema() { - return itemSchema; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClass && equalTo((RemoteFieldClass) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldClass other) { - return id.equals(other.id) - && displayName.equals(other.displayName) - && remoteKeyName.equals(other.remoteKeyName) - && description.equals(other.description) - && isCustom.equals(other.isCustom) - && isRequired.equals(other.isRequired) - && fieldType.equals(other.fieldType) - && fieldFormat.equals(other.fieldFormat) - && fieldChoices.equals(other.fieldChoices) - && itemSchema.equals(other.itemSchema); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.displayName, - this.remoteKeyName, - this.description, - this.isCustom, - this.isRequired, - this.fieldType, - this.fieldFormat, - this.fieldChoices, - this.itemSchema); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional displayName = Optional.empty(); - - private Optional remoteKeyName = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional isCustom = Optional.empty(); - - private Optional isRequired = Optional.empty(); - - private Optional fieldType = Optional.empty(); - - private Optional fieldFormat = Optional.empty(); - - private Optional> fieldChoices = Optional.empty(); - - private Optional itemSchema = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldClass other) { - id(other.getId()); - displayName(other.getDisplayName()); - remoteKeyName(other.getRemoteKeyName()); - description(other.getDescription()); - isCustom(other.getIsCustom()); - isRequired(other.getIsRequired()); - fieldType(other.getFieldType()); - fieldFormat(other.getFieldFormat()); - fieldChoices(other.getFieldChoices()); - itemSchema(other.getItemSchema()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public Builder displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - public Builder displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) - public Builder remoteKeyName(Optional remoteKeyName) { - this.remoteKeyName = remoteKeyName; - return this; - } - - public Builder remoteKeyName(String remoteKeyName) { - this.remoteKeyName = Optional.ofNullable(remoteKeyName); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) - public Builder isCustom(Optional isCustom) { - this.isCustom = isCustom; - return this; - } - - public Builder isCustom(Boolean isCustom) { - this.isCustom = Optional.ofNullable(isCustom); - return this; - } - - @JsonSetter(value = "is_required", nulls = Nulls.SKIP) - public Builder isRequired(Optional isRequired) { - this.isRequired = isRequired; - return this; - } - - public Builder isRequired(Boolean isRequired) { - this.isRequired = Optional.ofNullable(isRequired); - return this; - } - - @JsonSetter(value = "field_type", nulls = Nulls.SKIP) - public Builder fieldType(Optional fieldType) { - this.fieldType = fieldType; - return this; - } - - public Builder fieldType(RemoteFieldClassFieldType fieldType) { - this.fieldType = Optional.ofNullable(fieldType); - return this; - } - - @JsonSetter(value = "field_format", nulls = Nulls.SKIP) - public Builder fieldFormat(Optional fieldFormat) { - this.fieldFormat = fieldFormat; - return this; - } - - public Builder fieldFormat(RemoteFieldClassFieldFormat fieldFormat) { - this.fieldFormat = Optional.ofNullable(fieldFormat); - return this; - } - - @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) - public Builder fieldChoices(Optional> fieldChoices) { - this.fieldChoices = fieldChoices; - return this; - } - - public Builder fieldChoices(List fieldChoices) { - this.fieldChoices = Optional.ofNullable(fieldChoices); - return this; - } - - @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) - public Builder itemSchema(Optional itemSchema) { - this.itemSchema = itemSchema; - return this; - } - - public Builder itemSchema(ItemSchema itemSchema) { - this.itemSchema = Optional.ofNullable(itemSchema); - return this; - } - - public RemoteFieldClass build() { - return new RemoteFieldClass( - id, - displayName, - remoteKeyName, - description, - isCustom, - isRequired, - fieldType, - fieldFormat, - fieldChoices, - itemSchema, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldChoicesItem.java deleted file mode 100644 index f3fa93b72..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldChoicesItem.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldClassFieldChoicesItem.Builder.class) -public final class RemoteFieldClassFieldChoicesItem { - private final Optional value; - - private final Optional displayName; - - private final Map additionalProperties; - - private RemoteFieldClassFieldChoicesItem( - Optional value, Optional displayName, Map additionalProperties) { - this.value = value; - this.displayName = displayName; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("value") - public Optional getValue() { - return value; - } - - @JsonProperty("display_name") - public Optional getDisplayName() { - return displayName; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassFieldChoicesItem && equalTo((RemoteFieldClassFieldChoicesItem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldClassFieldChoicesItem other) { - return value.equals(other.value) && displayName.equals(other.displayName); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value, this.displayName); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional value = Optional.empty(); - - private Optional displayName = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RemoteFieldClassFieldChoicesItem other) { - value(other.getValue()); - displayName(other.getDisplayName()); - return this; - } - - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public Builder value(Optional value) { - this.value = value; - return this; - } - - public Builder value(JsonNode value) { - this.value = Optional.ofNullable(value); - return this; - } - - @JsonSetter(value = "display_name", nulls = Nulls.SKIP) - public Builder displayName(Optional displayName) { - this.displayName = displayName; - return this; - } - - public Builder displayName(String displayName) { - this.displayName = Optional.ofNullable(displayName); - return this; - } - - public RemoteFieldClassFieldChoicesItem build() { - return new RemoteFieldClassFieldChoicesItem(value, displayName, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldFormat.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldFormat.java deleted file mode 100644 index 144931887..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldFormat.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldClassFieldFormat.Deserializer.class) -public final class RemoteFieldClassFieldFormat { - private final Object value; - - private final int type; - - private RemoteFieldClassFieldFormat(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((FieldFormatEnum) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassFieldFormat && equalTo((RemoteFieldClassFieldFormat) other); - } - - private boolean equalTo(RemoteFieldClassFieldFormat other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldClassFieldFormat of(String value) { - return new RemoteFieldClassFieldFormat(value, 0); - } - - public static RemoteFieldClassFieldFormat of(FieldFormatEnum value) { - return new RemoteFieldClassFieldFormat(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(FieldFormatEnum value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldClassFieldFormat.class); - } - - @java.lang.Override - public RemoteFieldClassFieldFormat deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FieldFormatEnum.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldType.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldType.java deleted file mode 100644 index 0acdd7825..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldClassFieldType.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldClassFieldType.Deserializer.class) -public final class RemoteFieldClassFieldType { - private final Object value; - - private final int type; - - private RemoteFieldClassFieldType(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((FieldTypeEnum) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldClassFieldType && equalTo((RemoteFieldClassFieldType) other); - } - - private boolean equalTo(RemoteFieldClassFieldType other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldClassFieldType of(String value) { - return new RemoteFieldClassFieldType(value, 0); - } - - public static RemoteFieldClassFieldType of(FieldTypeEnum value) { - return new RemoteFieldClassFieldType(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(FieldTypeEnum value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldClassFieldType.class); - } - - @java.lang.Override - public RemoteFieldClassFieldType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, FieldTypeEnum.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRemoteFieldClass.java deleted file mode 100644 index f41cfe2ce..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRemoteFieldClass.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldRemoteFieldClass.Deserializer.class) -public final class RemoteFieldRemoteFieldClass { - private final Object value; - - private final int type; - - private RemoteFieldRemoteFieldClass(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((RemoteFieldClass) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRemoteFieldClass && equalTo((RemoteFieldRemoteFieldClass) other); - } - - private boolean equalTo(RemoteFieldRemoteFieldClass other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldRemoteFieldClass of(String value) { - return new RemoteFieldRemoteFieldClass(value, 0); - } - - public static RemoteFieldRemoteFieldClass of(RemoteFieldClass value) { - return new RemoteFieldRemoteFieldClass(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(RemoteFieldClass value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldRemoteFieldClass.class); - } - - @java.lang.Override - public RemoteFieldRemoteFieldClass deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRequest.java deleted file mode 100644 index 6e53411b6..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRequest.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteFieldRequest.Builder.class) -public final class RemoteFieldRequest { - private final RemoteFieldRequestRemoteFieldClass remoteFieldClass; - - private final Optional value; - - private final Map additionalProperties; - - private RemoteFieldRequest( - RemoteFieldRequestRemoteFieldClass remoteFieldClass, - Optional value, - Map additionalProperties) { - this.remoteFieldClass = remoteFieldClass; - this.value = value; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("remote_field_class") - public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { - return remoteFieldClass; - } - - @JsonProperty("value") - public Optional getValue() { - return value; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRequest && equalTo((RemoteFieldRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteFieldRequest other) { - return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.remoteFieldClass, this.value); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static RemoteFieldClassStage builder() { - return new Builder(); - } - - public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass); - - Builder from(RemoteFieldRequest other); - } - - public interface _FinalStage { - RemoteFieldRequest build(); - - _FinalStage value(Optional value); - - _FinalStage value(String value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldRequestRemoteFieldClass remoteFieldClass; - - private Optional value = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteFieldRequest other) { - remoteFieldClass(other.getRemoteFieldClass()); - value(other.getValue()); - return this; - } - - @java.lang.Override - @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { - this.remoteFieldClass = remoteFieldClass; - return this; - } - - @java.lang.Override - public _FinalStage value(String value) { - this.value = Optional.ofNullable(value); - return this; - } - - @java.lang.Override - @JsonSetter(value = "value", nulls = Nulls.SKIP) - public _FinalStage value(Optional value) { - this.value = value; - return this; - } - - @java.lang.Override - public RemoteFieldRequest build() { - return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRequestRemoteFieldClass.java deleted file mode 100644 index 167cd0de0..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteFieldRequestRemoteFieldClass.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RemoteFieldRequestRemoteFieldClass.Deserializer.class) -public final class RemoteFieldRequestRemoteFieldClass { - private final Object value; - - private final int type; - - private RemoteFieldRequestRemoteFieldClass(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((RemoteFieldClass) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteFieldRequestRemoteFieldClass - && equalTo((RemoteFieldRequestRemoteFieldClass) other); - } - - private boolean equalTo(RemoteFieldRequestRemoteFieldClass other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RemoteFieldRequestRemoteFieldClass of(String value) { - return new RemoteFieldRequestRemoteFieldClass(value, 0); - } - - public static RemoteFieldRequestRemoteFieldClass of(RemoteFieldClass value) { - return new RemoteFieldRequestRemoteFieldClass(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(RemoteFieldClass value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RemoteFieldRequestRemoteFieldClass.class); - } - - @java.lang.Override - public RemoteFieldRequestRemoteFieldClass deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteKey.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteKey.java deleted file mode 100644 index 5b40af562..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteKey.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteKey.Builder.class) -public final class RemoteKey { - private final String name; - - private final String key; - - private final Map additionalProperties; - - private RemoteKey(String name, String key, Map additionalProperties) { - this.name = name; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("key") - public String getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteKey && equalTo((RemoteKey) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteKey other) { - return name.equals(other.name) && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.name, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameStage builder() { - return new Builder(); - } - - public interface NameStage { - KeyStage name(@NotNull String name); - - Builder from(RemoteKey other); - } - - public interface KeyStage { - _FinalStage key(@NotNull String key); - } - - public interface _FinalStage { - RemoteKey build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameStage, KeyStage, _FinalStage { - private String name; - - private String key; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteKey other) { - name(other.getName()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("name") - public KeyStage name(@NotNull String name) { - this.name = name; - return this; - } - - @java.lang.Override - @JsonSetter("key") - public _FinalStage key(@NotNull String key) { - this.key = key; - return this; - } - - @java.lang.Override - public RemoteKey build() { - return new RemoteKey(name, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RemoteResponse.java b/src/main/java/com/merge/api/resources/ticketing/types/RemoteResponse.java deleted file mode 100644 index 9a19c5fe5..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RemoteResponse.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RemoteResponse.Builder.class) -public final class RemoteResponse { - private final String method; - - private final String path; - - private final int status; - - private final JsonNode response; - - private final Optional> responseHeaders; - - private final Optional responseType; - - private final Optional> headers; - - private final Map additionalProperties; - - private RemoteResponse( - String method, - String path, - int status, - JsonNode response, - Optional> responseHeaders, - Optional responseType, - Optional> headers, - Map additionalProperties) { - this.method = method; - this.path = path; - this.status = status; - this.response = response; - this.responseHeaders = responseHeaders; - this.responseType = responseType; - this.headers = headers; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("method") - public String getMethod() { - return method; - } - - @JsonProperty("path") - public String getPath() { - return path; - } - - @JsonProperty("status") - public int getStatus() { - return status; - } - - @JsonProperty("response") - public JsonNode getResponse() { - return response; - } - - @JsonProperty("response_headers") - public Optional> getResponseHeaders() { - return responseHeaders; - } - - @JsonProperty("response_type") - public Optional getResponseType() { - return responseType; - } - - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RemoteResponse && equalTo((RemoteResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RemoteResponse other) { - return method.equals(other.method) - && path.equals(other.path) - && status == other.status - && response.equals(other.response) - && responseHeaders.equals(other.responseHeaders) - && responseType.equals(other.responseType) - && headers.equals(other.headers); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.method, - this.path, - this.status, - this.response, - this.responseHeaders, - this.responseType, - this.headers); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static MethodStage builder() { - return new Builder(); - } - - public interface MethodStage { - PathStage method(@NotNull String method); - - Builder from(RemoteResponse other); - } - - public interface PathStage { - StatusStage path(@NotNull String path); - } - - public interface StatusStage { - ResponseStage status(int status); - } - - public interface ResponseStage { - _FinalStage response(@NotNull JsonNode response); - } - - public interface _FinalStage { - RemoteResponse build(); - - _FinalStage responseHeaders(Optional> responseHeaders); - - _FinalStage responseHeaders(Map responseHeaders); - - _FinalStage responseType(Optional responseType); - - _FinalStage responseType(ResponseTypeEnum responseType); - - _FinalStage headers(Optional> headers); - - _FinalStage headers(Map headers); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { - private String method; - - private String path; - - private int status; - - private JsonNode response; - - private Optional> headers = Optional.empty(); - - private Optional responseType = Optional.empty(); - - private Optional> responseHeaders = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RemoteResponse other) { - method(other.getMethod()); - path(other.getPath()); - status(other.getStatus()); - response(other.getResponse()); - responseHeaders(other.getResponseHeaders()); - responseType(other.getResponseType()); - headers(other.getHeaders()); - return this; - } - - @java.lang.Override - @JsonSetter("method") - public PathStage method(@NotNull String method) { - this.method = method; - return this; - } - - @java.lang.Override - @JsonSetter("path") - public StatusStage path(@NotNull String path) { - this.path = path; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public ResponseStage status(int status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("response") - public _FinalStage response(@NotNull JsonNode response) { - this.response = response; - return this; - } - - @java.lang.Override - public _FinalStage headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @java.lang.Override - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public _FinalStage headers(Optional> headers) { - this.headers = headers; - return this; - } - - @java.lang.Override - public _FinalStage responseType(ResponseTypeEnum responseType) { - this.responseType = Optional.ofNullable(responseType); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_type", nulls = Nulls.SKIP) - public _FinalStage responseType(Optional responseType) { - this.responseType = responseType; - return this; - } - - @java.lang.Override - public _FinalStage responseHeaders(Map responseHeaders) { - this.responseHeaders = Optional.ofNullable(responseHeaders); - return this; - } - - @java.lang.Override - @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) - public _FinalStage responseHeaders(Optional> responseHeaders) { - this.responseHeaders = responseHeaders; - return this; - } - - @java.lang.Override - public RemoteResponse build() { - return new RemoteResponse( - method, path, status, response, responseHeaders, responseType, headers, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RequestFormatEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/RequestFormatEnum.java deleted file mode 100644 index 40135784e..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RequestFormatEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RequestFormatEnum { - JSON("JSON"), - - XML("XML"), - - MULTIPART("MULTIPART"); - - private final String value; - - RequestFormatEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/ResponseTypeEnum.java deleted file mode 100644 index 384450787..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ResponseTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ResponseTypeEnum { - JSON("JSON"), - - BASE_64_GZIP("BASE64_GZIP"); - - private final String value; - - ResponseTypeEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RoleEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/RoleEnum.java deleted file mode 100644 index 708830b92..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RoleEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum RoleEnum { - ADMIN("ADMIN"), - - DEVELOPER("DEVELOPER"), - - MEMBER("MEMBER"), - - API("API"), - - SYSTEM("SYSTEM"), - - MERGE_TEAM("MERGE_TEAM"); - - private final String value; - - RoleEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RoleTicketAccess.java b/src/main/java/com/merge/api/resources/ticketing/types/RoleTicketAccess.java deleted file mode 100644 index f7516f158..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RoleTicketAccess.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RoleTicketAccess.Deserializer.class) -public final class RoleTicketAccess { - private final Object value; - - private final int type; - - private RoleTicketAccess(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((TicketAccessEnum) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RoleTicketAccess && equalTo((RoleTicketAccess) other); - } - - private boolean equalTo(RoleTicketAccess other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RoleTicketAccess of(String value) { - return new RoleTicketAccess(value, 0); - } - - public static RoleTicketAccess of(TicketAccessEnum value) { - return new RoleTicketAccess(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(TicketAccessEnum value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RoleTicketAccess.class); - } - - @java.lang.Override - public RoleTicketAccess deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TicketAccessEnum.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/RoleTicketActionsItem.java b/src/main/java/com/merge/api/resources/ticketing/types/RoleTicketActionsItem.java deleted file mode 100644 index 936aee845..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/RoleTicketActionsItem.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = RoleTicketActionsItem.Deserializer.class) -public final class RoleTicketActionsItem { - private final Object value; - - private final int type; - - private RoleTicketActionsItem(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((String) this.value); - } else if (this.type == 1) { - return visitor.visit((TicketActionsEnum) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RoleTicketActionsItem && equalTo((RoleTicketActionsItem) other); - } - - private boolean equalTo(RoleTicketActionsItem other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static RoleTicketActionsItem of(String value) { - return new RoleTicketActionsItem(value, 0); - } - - public static RoleTicketActionsItem of(TicketActionsEnum value) { - return new RoleTicketActionsItem(value, 1); - } - - public interface Visitor { - T visit(String value); - - T visit(TicketActionsEnum value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(RoleTicketActionsItem.class); - } - - @java.lang.Override - public RoleTicketActionsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TicketActionsEnum.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java deleted file mode 100644 index 7b0669c7a..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SelectiveSyncConfigurationsUsageEnum { - IN_NEXT_SYNC("IN_NEXT_SYNC"), - - IN_LAST_SYNC("IN_LAST_SYNC"); - - private final String value; - - SelectiveSyncConfigurationsUsageEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/SyncStatus.java b/src/main/java/com/merge/api/resources/ticketing/types/SyncStatus.java deleted file mode 100644 index 2d4470222..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/SyncStatus.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = SyncStatus.Builder.class) -public final class SyncStatus { - private final String modelName; - - private final String modelId; - - private final Optional lastSyncStart; - - private final Optional nextSyncStart; - - private final SyncStatusStatusEnum status; - - private final boolean isInitialSync; - - private final Optional selectiveSyncConfigurationsUsage; - - private final Map additionalProperties; - - private SyncStatus( - String modelName, - String modelId, - Optional lastSyncStart, - Optional nextSyncStart, - SyncStatusStatusEnum status, - boolean isInitialSync, - Optional selectiveSyncConfigurationsUsage, - Map additionalProperties) { - this.modelName = modelName; - this.modelId = modelId; - this.lastSyncStart = lastSyncStart; - this.nextSyncStart = nextSyncStart; - this.status = status; - this.isInitialSync = isInitialSync; - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("model_name") - public String getModelName() { - return modelName; - } - - @JsonProperty("model_id") - public String getModelId() { - return modelId; - } - - @JsonProperty("last_sync_start") - public Optional getLastSyncStart() { - return lastSyncStart; - } - - @JsonProperty("next_sync_start") - public Optional getNextSyncStart() { - return nextSyncStart; - } - - @JsonProperty("status") - public SyncStatusStatusEnum getStatus() { - return status; - } - - @JsonProperty("is_initial_sync") - public boolean getIsInitialSync() { - return isInitialSync; - } - - @JsonProperty("selective_sync_configurations_usage") - public Optional getSelectiveSyncConfigurationsUsage() { - return selectiveSyncConfigurationsUsage; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof SyncStatus && equalTo((SyncStatus) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(SyncStatus other) { - return modelName.equals(other.modelName) - && modelId.equals(other.modelId) - && lastSyncStart.equals(other.lastSyncStart) - && nextSyncStart.equals(other.nextSyncStart) - && status.equals(other.status) - && isInitialSync == other.isInitialSync - && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.modelName, - this.modelId, - this.lastSyncStart, - this.nextSyncStart, - this.status, - this.isInitialSync, - this.selectiveSyncConfigurationsUsage); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelNameStage builder() { - return new Builder(); - } - - public interface ModelNameStage { - ModelIdStage modelName(@NotNull String modelName); - - Builder from(SyncStatus other); - } - - public interface ModelIdStage { - StatusStage modelId(@NotNull String modelId); - } - - public interface StatusStage { - IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status); - } - - public interface IsInitialSyncStage { - _FinalStage isInitialSync(boolean isInitialSync); - } - - public interface _FinalStage { - SyncStatus build(); - - _FinalStage lastSyncStart(Optional lastSyncStart); - - _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); - - _FinalStage nextSyncStart(Optional nextSyncStart); - - _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); - - _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage); - - _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { - private String modelName; - - private String modelId; - - private SyncStatusStatusEnum status; - - private boolean isInitialSync; - - private Optional selectiveSyncConfigurationsUsage = Optional.empty(); - - private Optional nextSyncStart = Optional.empty(); - - private Optional lastSyncStart = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(SyncStatus other) { - modelName(other.getModelName()); - modelId(other.getModelId()); - lastSyncStart(other.getLastSyncStart()); - nextSyncStart(other.getNextSyncStart()); - status(other.getStatus()); - isInitialSync(other.getIsInitialSync()); - selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); - return this; - } - - @java.lang.Override - @JsonSetter("model_name") - public ModelIdStage modelName(@NotNull String modelName) { - this.modelName = modelName; - return this; - } - - @java.lang.Override - @JsonSetter("model_id") - public StatusStage modelId(@NotNull String modelId) { - this.modelId = modelId; - return this; - } - - @java.lang.Override - @JsonSetter("status") - public IsInitialSyncStage status(@NotNull SyncStatusStatusEnum status) { - this.status = status; - return this; - } - - @java.lang.Override - @JsonSetter("is_initial_sync") - public _FinalStage isInitialSync(boolean isInitialSync) { - this.isInitialSync = isInitialSync; - return this; - } - - @java.lang.Override - public _FinalStage selectiveSyncConfigurationsUsage( - SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); - return this; - } - - @java.lang.Override - @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) - public _FinalStage selectiveSyncConfigurationsUsage( - Optional selectiveSyncConfigurationsUsage) { - this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; - return this; - } - - @java.lang.Override - public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { - this.nextSyncStart = Optional.ofNullable(nextSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) - public _FinalStage nextSyncStart(Optional nextSyncStart) { - this.nextSyncStart = nextSyncStart; - return this; - } - - @java.lang.Override - public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { - this.lastSyncStart = Optional.ofNullable(lastSyncStart); - return this; - } - - @java.lang.Override - @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) - public _FinalStage lastSyncStart(Optional lastSyncStart) { - this.lastSyncStart = lastSyncStart; - return this; - } - - @java.lang.Override - public SyncStatus build() { - return new SyncStatus( - modelName, - modelId, - lastSyncStart, - nextSyncStart, - status, - isInitialSync, - selectiveSyncConfigurationsUsage, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/SyncStatusStatusEnum.java b/src/main/java/com/merge/api/resources/ticketing/types/SyncStatusStatusEnum.java deleted file mode 100644 index caf1b260f..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/SyncStatusStatusEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum SyncStatusStatusEnum { - SYNCING("SYNCING"), - - DONE("DONE"), - - FAILED("FAILED"), - - DISABLED("DISABLED"), - - PAUSED("PAUSED"), - - PARTIALLY_SYNCED("PARTIALLY_SYNCED"); - - private final String value; - - SyncStatusStatusEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Tag.java b/src/main/java/com/merge/api/resources/ticketing/types/Tag.java deleted file mode 100644 index 098475f76..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/Tag.java +++ /dev/null @@ -1,300 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Tag.Builder.class) -public final class Tag { - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional id; - - private final Optional name; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Tag( - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional id, - Optional name, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.id = id; - this.name = name; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The tag's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Tag && equalTo((Tag) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Tag other) { - return remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && id.equals(other.id) - && name.equals(other.name) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.remoteId, - this.createdAt, - this.modifiedAt, - this.id, - this.name, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional id = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Tag other) { - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - id(other.getId()); - name(other.getName()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Tag build() { - return new Tag( - remoteId, - createdAt, - modifiedAt, - id, - name, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Team.java b/src/main/java/com/merge/api/resources/ticketing/types/Team.java deleted file mode 100644 index 7f45a23a7..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/Team.java +++ /dev/null @@ -1,329 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Team.Builder.class) -public final class Team { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional description; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private Team( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional description, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.description = description; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The team's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The team's description. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Team && equalTo((Team) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Team other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && description.equals(other.description) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.description, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Team other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - description(other.getDescription()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public Team build() { - return new Team( - id, - remoteId, - createdAt, - modifiedAt, - name, - description, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketPriority.java b/src/main/java/com/merge/api/resources/ticketing/types/TicketPriority.java deleted file mode 100644 index 8f7ea3774..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketPriority.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TicketPriority.Deserializer.class) -public final class TicketPriority { - private final Object value; - - private final int type; - - private TicketPriority(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PriorityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TicketPriority && equalTo((TicketPriority) other); - } - - private boolean equalTo(TicketPriority other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TicketPriority of(PriorityEnum value) { - return new TicketPriority(value, 0); - } - - public static TicketPriority of(String value) { - return new TicketPriority(value, 1); - } - - public interface Visitor { - T visit(PriorityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TicketPriority.class); - } - - @java.lang.Override - public TicketPriority deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PriorityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestPriority.java b/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestPriority.java deleted file mode 100644 index f1110fa4b..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestPriority.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TicketRequestPriority.Deserializer.class) -public final class TicketRequestPriority { - private final Object value; - - private final int type; - - private TicketRequestPriority(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((PriorityEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TicketRequestPriority && equalTo((TicketRequestPriority) other); - } - - private boolean equalTo(TicketRequestPriority other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TicketRequestPriority of(PriorityEnum value) { - return new TicketRequestPriority(value, 0); - } - - public static TicketRequestPriority of(String value) { - return new TicketRequestPriority(value, 1); - } - - public interface Visitor { - T visit(PriorityEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TicketRequestPriority.class); - } - - @java.lang.Override - public TicketRequestPriority deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PriorityEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestStatus.java b/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestStatus.java deleted file mode 100644 index 603c91f71..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TicketRequestStatus.Deserializer.class) -public final class TicketRequestStatus { - private final Object value; - - private final int type; - - private TicketRequestStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TicketStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TicketRequestStatus && equalTo((TicketRequestStatus) other); - } - - private boolean equalTo(TicketRequestStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TicketRequestStatus of(TicketStatusEnum value) { - return new TicketRequestStatus(value, 0); - } - - public static TicketRequestStatus of(String value) { - return new TicketRequestStatus(value, 1); - } - - public interface Visitor { - T visit(TicketStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TicketRequestStatus.class); - } - - @java.lang.Override - public TicketRequestStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TicketStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketStatus.java b/src/main/java/com/merge/api/resources/ticketing/types/TicketStatus.java deleted file mode 100644 index 67bd18c24..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketStatus.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.merge.api.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TicketStatus.Deserializer.class) -public final class TicketStatus { - private final Object value; - - private final int type; - - private TicketStatus(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TicketStatusEnum) this.value); - } else if (this.type == 1) { - return visitor.visit((String) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TicketStatus && equalTo((TicketStatus) other); - } - - private boolean equalTo(TicketStatus other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TicketStatus of(TicketStatusEnum value) { - return new TicketStatus(value, 0); - } - - public static TicketStatus of(String value) { - return new TicketStatus(value, 1); - } - - public interface Visitor { - T visit(TicketStatusEnum value); - - T visit(String value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TicketStatus.class); - } - - @java.lang.Override - public TicketStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TicketStatusEnum.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/User.java b/src/main/java/com/merge/api/resources/ticketing/types/User.java deleted file mode 100644 index d8f1a4405..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/User.java +++ /dev/null @@ -1,439 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = User.Builder.class) -public final class User { - private final Optional id; - - private final Optional remoteId; - - private final Optional createdAt; - - private final Optional modifiedAt; - - private final Optional name; - - private final Optional emailAddress; - - private final Optional isActive; - - private final Optional>> teams; - - private final Optional>> roles; - - private final Optional avatar; - - private final Optional remoteWasDeleted; - - private final Optional> fieldMappings; - - private final Optional> remoteData; - - private final Map additionalProperties; - - private User( - Optional id, - Optional remoteId, - Optional createdAt, - Optional modifiedAt, - Optional name, - Optional emailAddress, - Optional isActive, - Optional>> teams, - Optional>> roles, - Optional avatar, - Optional remoteWasDeleted, - Optional> fieldMappings, - Optional> remoteData, - Map additionalProperties) { - this.id = id; - this.remoteId = remoteId; - this.createdAt = createdAt; - this.modifiedAt = modifiedAt; - this.name = name; - this.emailAddress = emailAddress; - this.isActive = isActive; - this.teams = teams; - this.roles = roles; - this.avatar = avatar; - this.remoteWasDeleted = remoteWasDeleted; - this.fieldMappings = fieldMappings; - this.remoteData = remoteData; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The third-party API ID of the matching object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - /** - * @return The datetime that this object was created by Merge. - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The datetime that this object was modified by Merge. - */ - @JsonProperty("modified_at") - public Optional getModifiedAt() { - return modifiedAt; - } - - /** - * @return The user's name. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The user's email address. - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return Whether or not the user is active. - */ - @JsonProperty("is_active") - public Optional getIsActive() { - return isActive; - } - - @JsonProperty("teams") - public Optional>> getTeams() { - return teams; - } - - @JsonProperty("roles") - public Optional>> getRoles() { - return roles; - } - - /** - * @return The user's avatar picture. - */ - @JsonProperty("avatar") - public Optional getAvatar() { - return avatar; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - - @JsonProperty("field_mappings") - public Optional> getFieldMappings() { - return fieldMappings; - } - - @JsonProperty("remote_data") - public Optional> getRemoteData() { - return remoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof User && equalTo((User) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(User other) { - return id.equals(other.id) - && remoteId.equals(other.remoteId) - && createdAt.equals(other.createdAt) - && modifiedAt.equals(other.modifiedAt) - && name.equals(other.name) - && emailAddress.equals(other.emailAddress) - && isActive.equals(other.isActive) - && teams.equals(other.teams) - && roles.equals(other.roles) - && avatar.equals(other.avatar) - && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.remoteId, - this.createdAt, - this.modifiedAt, - this.name, - this.emailAddress, - this.isActive, - this.teams, - this.roles, - this.avatar, - this.remoteWasDeleted, - this.fieldMappings, - this.remoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional id = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional modifiedAt = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional isActive = Optional.empty(); - - private Optional>> teams = Optional.empty(); - - private Optional>> roles = Optional.empty(); - - private Optional avatar = Optional.empty(); - - private Optional remoteWasDeleted = Optional.empty(); - - private Optional> fieldMappings = Optional.empty(); - - private Optional> remoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(User other) { - id(other.getId()); - remoteId(other.getRemoteId()); - createdAt(other.getCreatedAt()); - modifiedAt(other.getModifiedAt()); - name(other.getName()); - emailAddress(other.getEmailAddress()); - isActive(other.getIsActive()); - teams(other.getTeams()); - roles(other.getRoles()); - avatar(other.getAvatar()); - remoteWasDeleted(other.getRemoteWasDeleted()); - fieldMappings(other.getFieldMappings()); - remoteData(other.getRemoteData()); - return this; - } - - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public Builder id(Optional id) { - this.id = id; - return this; - } - - public Builder id(String id) { - this.id = Optional.ofNullable(id); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - @JsonSetter(value = "created_at", nulls = Nulls.SKIP) - public Builder createdAt(Optional createdAt) { - this.createdAt = createdAt; - return this; - } - - public Builder createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) - public Builder modifiedAt(Optional modifiedAt) { - this.modifiedAt = modifiedAt; - return this; - } - - public Builder modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = Optional.ofNullable(modifiedAt); - return this; - } - - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public Builder name(Optional name) { - this.name = name; - return this; - } - - public Builder name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "is_active", nulls = Nulls.SKIP) - public Builder isActive(Optional isActive) { - this.isActive = isActive; - return this; - } - - public Builder isActive(Boolean isActive) { - this.isActive = Optional.ofNullable(isActive); - return this; - } - - @JsonSetter(value = "teams", nulls = Nulls.SKIP) - public Builder teams(Optional>> teams) { - this.teams = teams; - return this; - } - - public Builder teams(List> teams) { - this.teams = Optional.ofNullable(teams); - return this; - } - - @JsonSetter(value = "roles", nulls = Nulls.SKIP) - public Builder roles(Optional>> roles) { - this.roles = roles; - return this; - } - - public Builder roles(List> roles) { - this.roles = Optional.ofNullable(roles); - return this; - } - - @JsonSetter(value = "avatar", nulls = Nulls.SKIP) - public Builder avatar(Optional avatar) { - this.avatar = avatar; - return this; - } - - public Builder avatar(String avatar) { - this.avatar = Optional.ofNullable(avatar); - return this; - } - - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; - return this; - } - - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); - return this; - } - - @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) - public Builder fieldMappings(Optional> fieldMappings) { - this.fieldMappings = fieldMappings; - return this; - } - - public Builder fieldMappings(Map fieldMappings) { - this.fieldMappings = Optional.ofNullable(fieldMappings); - return this; - } - - @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional> remoteData) { - this.remoteData = remoteData; - return this; - } - - public Builder remoteData(List remoteData) { - this.remoteData = Optional.ofNullable(remoteData); - return this; - } - - public User build() { - return new User( - id, - remoteId, - createdAt, - modifiedAt, - name, - emailAddress, - isActive, - teams, - roles, - avatar, - remoteWasDeleted, - fieldMappings, - remoteData, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ValidationProblemSource.java b/src/main/java/com/merge/api/resources/ticketing/types/ValidationProblemSource.java deleted file mode 100644 index a6476e550..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/ValidationProblemSource.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ValidationProblemSource.Builder.class) -public final class ValidationProblemSource { - private final String pointer; - - private final Map additionalProperties; - - private ValidationProblemSource(String pointer, Map additionalProperties) { - this.pointer = pointer; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("pointer") - public String getPointer() { - return pointer; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidationProblemSource other) { - return pointer.equals(other.pointer); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.pointer); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PointerStage builder() { - return new Builder(); - } - - public interface PointerStage { - _FinalStage pointer(@NotNull String pointer); - - Builder from(ValidationProblemSource other); - } - - public interface _FinalStage { - ValidationProblemSource build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PointerStage, _FinalStage { - private String pointer; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ValidationProblemSource other) { - pointer(other.getPointer()); - return this; - } - - @java.lang.Override - @JsonSetter("pointer") - public _FinalStage pointer(@NotNull String pointer) { - this.pointer = pointer; - return this; - } - - @java.lang.Override - public ValidationProblemSource build() { - return new ValidationProblemSource(pointer, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/WarningValidationProblem.java b/src/main/java/com/merge/api/resources/ticketing/types/WarningValidationProblem.java deleted file mode 100644 index 34b6b0325..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/WarningValidationProblem.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WarningValidationProblem.Builder.class) -public final class WarningValidationProblem { - private final Optional source; - - private final String title; - - private final String detail; - - private final String problemType; - - private final Map additionalProperties; - - private WarningValidationProblem( - Optional source, - String title, - String detail, - String problemType, - Map additionalProperties) { - this.source = source; - this.title = title; - this.detail = detail; - this.problemType = problemType; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("source") - public Optional getSource() { - return source; - } - - @JsonProperty("title") - public String getTitle() { - return title; - } - - @JsonProperty("detail") - public String getDetail() { - return detail; - } - - @JsonProperty("problem_type") - public String getProblemType() { - return problemType; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WarningValidationProblem other) { - return source.equals(other.source) - && title.equals(other.title) - && detail.equals(other.detail) - && problemType.equals(other.problemType); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static TitleStage builder() { - return new Builder(); - } - - public interface TitleStage { - DetailStage title(@NotNull String title); - - Builder from(WarningValidationProblem other); - } - - public interface DetailStage { - ProblemTypeStage detail(@NotNull String detail); - } - - public interface ProblemTypeStage { - _FinalStage problemType(@NotNull String problemType); - } - - public interface _FinalStage { - WarningValidationProblem build(); - - _FinalStage source(Optional source); - - _FinalStage source(ValidationProblemSource source); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { - private String title; - - private String detail; - - private String problemType; - - private Optional source = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WarningValidationProblem other) { - source(other.getSource()); - title(other.getTitle()); - detail(other.getDetail()); - problemType(other.getProblemType()); - return this; - } - - @java.lang.Override - @JsonSetter("title") - public DetailStage title(@NotNull String title) { - this.title = title; - return this; - } - - @java.lang.Override - @JsonSetter("detail") - public ProblemTypeStage detail(@NotNull String detail) { - this.detail = detail; - return this; - } - - @java.lang.Override - @JsonSetter("problem_type") - public _FinalStage problemType(@NotNull String problemType) { - this.problemType = problemType; - return this; - } - - @java.lang.Override - public _FinalStage source(ValidationProblemSource source) { - this.source = Optional.ofNullable(source); - return this; - } - - @java.lang.Override - @JsonSetter(value = "source", nulls = Nulls.SKIP) - public _FinalStage source(Optional source) { - this.source = source; - return this; - } - - @java.lang.Override - public WarningValidationProblem build() { - return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/WebhookReceiver.java b/src/main/java/com/merge/api/resources/ticketing/types/WebhookReceiver.java deleted file mode 100644 index f010160d9..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/types/WebhookReceiver.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiver.Builder.class) -public final class WebhookReceiver { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiver( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiver other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiver other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiver build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiver other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiver build() { - return new WebhookReceiver(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/users/UsersClient.java b/src/main/java/com/merge/api/resources/ticketing/users/UsersClient.java deleted file mode 100644 index d17ab700f..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/users/UsersClient.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.users; - -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.ticketing.types.PaginatedUserList; -import com.merge.api.resources.ticketing.types.User; -import com.merge.api.resources.ticketing.users.requests.UsersListRequest; -import com.merge.api.resources.ticketing.users.requests.UsersRetrieveRequest; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class UsersClient { - protected final ClientOptions clientOptions; - - public UsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list() { - return list(UsersListRequest.builder().build()); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list(UsersListRequest request) { - return list(request, null); - } - - /** - * Returns a list of User objects. - */ - public PaginatedUserList list(UsersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/users"); - if (request.getCreatedAfter().isPresent()) { - httpUrl.addQueryParameter( - "created_after", request.getCreatedAfter().get().toString()); - } - if (request.getCreatedBefore().isPresent()) { - httpUrl.addQueryParameter( - "created_before", request.getCreatedBefore().get().toString()); - } - if (request.getCursor().isPresent()) { - httpUrl.addQueryParameter("cursor", request.getCursor().get()); - } - if (request.getEmailAddress().isPresent()) { - httpUrl.addQueryParameter("email_address", request.getEmailAddress().get()); - } - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeDeletedData().isPresent()) { - httpUrl.addQueryParameter( - "include_deleted_data", - request.getIncludeDeletedData().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - if (request.getIncludeShellData().isPresent()) { - httpUrl.addQueryParameter( - "include_shell_data", request.getIncludeShellData().get().toString()); - } - if (request.getModifiedAfter().isPresent()) { - httpUrl.addQueryParameter( - "modified_after", request.getModifiedAfter().get().toString()); - } - if (request.getModifiedBefore().isPresent()) { - httpUrl.addQueryParameter( - "modified_before", request.getModifiedBefore().get().toString()); - } - if (request.getPageSize().isPresent()) { - httpUrl.addQueryParameter("page_size", request.getPageSize().get().toString()); - } - if (request.getRemoteId().isPresent()) { - httpUrl.addQueryParameter("remote_id", request.getRemoteId().get()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), PaginatedUserList.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); - } - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id) { - return retrieve(id, UsersRetrieveRequest.builder().build()); - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id, UsersRetrieveRequest request) { - return retrieve(id, request, null); - } - - /** - * Returns a User object with the given id. - */ - public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/users") - .addPathSegment(id); - if (request.getExpand().isPresent()) { - httpUrl.addQueryParameter("expand", request.getExpand().get().toString()); - } - if (request.getIncludeRemoteData().isPresent()) { - httpUrl.addQueryParameter( - "include_remote_data", request.getIncludeRemoteData().get().toString()); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.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(), User.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/users/requests/UsersListRequest.java b/src/main/java/com/merge/api/resources/ticketing/users/requests/UsersListRequest.java deleted file mode 100644 index cc151fad4..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/users/requests/UsersListRequest.java +++ /dev/null @@ -1,424 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.users.types.UsersListRequestExpand; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersListRequest.Builder.class) -public final class UsersListRequest { - private final Optional createdAfter; - - private final Optional createdBefore; - - private final Optional cursor; - - private final Optional emailAddress; - - private final Optional expand; - - private final Optional includeDeletedData; - - private final Optional includeRemoteData; - - private final Optional includeShellData; - - private final Optional modifiedAfter; - - private final Optional modifiedBefore; - - private final Optional pageSize; - - private final Optional remoteId; - - private final Map additionalProperties; - - private UsersListRequest( - Optional createdAfter, - Optional createdBefore, - Optional cursor, - Optional emailAddress, - Optional expand, - Optional includeDeletedData, - Optional includeRemoteData, - Optional includeShellData, - Optional modifiedAfter, - Optional modifiedBefore, - Optional pageSize, - Optional remoteId, - Map additionalProperties) { - this.createdAfter = createdAfter; - this.createdBefore = createdBefore; - this.cursor = cursor; - this.emailAddress = emailAddress; - this.expand = expand; - this.includeDeletedData = includeDeletedData; - this.includeRemoteData = includeRemoteData; - this.includeShellData = includeShellData; - this.modifiedAfter = modifiedAfter; - this.modifiedBefore = modifiedBefore; - this.pageSize = pageSize; - this.remoteId = remoteId; - this.additionalProperties = additionalProperties; - } - - /** - * @return If provided, will only return objects created after this datetime. - */ - @JsonProperty("created_after") - public Optional getCreatedAfter() { - return createdAfter; - } - - /** - * @return If provided, will only return objects created before this datetime. - */ - @JsonProperty("created_before") - public Optional getCreatedBefore() { - return createdBefore; - } - - /** - * @return The pagination cursor value. - */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; - } - - /** - * @return If provided, will only return users with emails equal to this value (case insensitive). - */ - @JsonProperty("email_address") - public Optional getEmailAddress() { - return emailAddress; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. - */ - @JsonProperty("include_deleted_data") - public Optional getIncludeDeletedData() { - return includeDeletedData; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - /** - * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). - */ - @JsonProperty("include_shell_data") - public Optional getIncludeShellData() { - return includeShellData; - } - - /** - * @return If provided, only objects synced by Merge after this date time will be returned. - */ - @JsonProperty("modified_after") - public Optional getModifiedAfter() { - return modifiedAfter; - } - - /** - * @return If provided, only objects synced by Merge before this date time will be returned. - */ - @JsonProperty("modified_before") - public Optional getModifiedBefore() { - return modifiedBefore; - } - - /** - * @return Number of results to return per page. - */ - @JsonProperty("page_size") - public Optional getPageSize() { - return pageSize; - } - - /** - * @return The API provider's ID for the given object. - */ - @JsonProperty("remote_id") - public Optional getRemoteId() { - return remoteId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersListRequest && equalTo((UsersListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersListRequest other) { - return createdAfter.equals(other.createdAfter) - && createdBefore.equals(other.createdBefore) - && cursor.equals(other.cursor) - && emailAddress.equals(other.emailAddress) - && expand.equals(other.expand) - && includeDeletedData.equals(other.includeDeletedData) - && includeRemoteData.equals(other.includeRemoteData) - && includeShellData.equals(other.includeShellData) - && modifiedAfter.equals(other.modifiedAfter) - && modifiedBefore.equals(other.modifiedBefore) - && pageSize.equals(other.pageSize) - && remoteId.equals(other.remoteId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.createdAfter, - this.createdBefore, - this.cursor, - this.emailAddress, - this.expand, - this.includeDeletedData, - this.includeRemoteData, - this.includeShellData, - this.modifiedAfter, - this.modifiedBefore, - this.pageSize, - this.remoteId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional createdAfter = Optional.empty(); - - private Optional createdBefore = Optional.empty(); - - private Optional cursor = Optional.empty(); - - private Optional emailAddress = Optional.empty(); - - private Optional expand = Optional.empty(); - - private Optional includeDeletedData = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - private Optional includeShellData = Optional.empty(); - - private Optional modifiedAfter = Optional.empty(); - - private Optional modifiedBefore = Optional.empty(); - - private Optional pageSize = Optional.empty(); - - private Optional remoteId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersListRequest other) { - createdAfter(other.getCreatedAfter()); - createdBefore(other.getCreatedBefore()); - cursor(other.getCursor()); - emailAddress(other.getEmailAddress()); - expand(other.getExpand()); - includeDeletedData(other.getIncludeDeletedData()); - includeRemoteData(other.getIncludeRemoteData()); - includeShellData(other.getIncludeShellData()); - modifiedAfter(other.getModifiedAfter()); - modifiedBefore(other.getModifiedBefore()); - pageSize(other.getPageSize()); - remoteId(other.getRemoteId()); - return this; - } - - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public Builder createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; - return this; - } - - public Builder createdAfter(OffsetDateTime createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); - return this; - } - - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public Builder createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; - return this; - } - - public Builder createdBefore(OffsetDateTime createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); - return this; - } - - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; - return this; - } - - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); - return this; - } - - @JsonSetter(value = "email_address", nulls = Nulls.SKIP) - public Builder emailAddress(Optional emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - public Builder emailAddress(String emailAddress) { - this.emailAddress = Optional.ofNullable(emailAddress); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(UsersListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) - public Builder includeDeletedData(Optional includeDeletedData) { - this.includeDeletedData = includeDeletedData; - return this; - } - - public Builder includeDeletedData(Boolean includeDeletedData) { - this.includeDeletedData = Optional.ofNullable(includeDeletedData); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) - public Builder includeShellData(Optional includeShellData) { - this.includeShellData = includeShellData; - return this; - } - - public Builder includeShellData(Boolean includeShellData) { - this.includeShellData = Optional.ofNullable(includeShellData); - return this; - } - - @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) - public Builder modifiedAfter(Optional modifiedAfter) { - this.modifiedAfter = modifiedAfter; - return this; - } - - public Builder modifiedAfter(OffsetDateTime modifiedAfter) { - this.modifiedAfter = Optional.ofNullable(modifiedAfter); - return this; - } - - @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) - public Builder modifiedBefore(Optional modifiedBefore) { - this.modifiedBefore = modifiedBefore; - return this; - } - - public Builder modifiedBefore(OffsetDateTime modifiedBefore) { - this.modifiedBefore = Optional.ofNullable(modifiedBefore); - return this; - } - - @JsonSetter(value = "page_size", nulls = Nulls.SKIP) - public Builder pageSize(Optional pageSize) { - this.pageSize = pageSize; - return this; - } - - public Builder pageSize(Integer pageSize) { - this.pageSize = Optional.ofNullable(pageSize); - return this; - } - - @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) - public Builder remoteId(Optional remoteId) { - this.remoteId = remoteId; - return this; - } - - public Builder remoteId(String remoteId) { - this.remoteId = Optional.ofNullable(remoteId); - return this; - } - - public UsersListRequest build() { - return new UsersListRequest( - createdAfter, - createdBefore, - cursor, - emailAddress, - expand, - includeDeletedData, - includeRemoteData, - includeShellData, - modifiedAfter, - modifiedBefore, - pageSize, - remoteId, - additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/users/requests/UsersRetrieveRequest.java b/src/main/java/com/merge/api/resources/ticketing/users/requests/UsersRetrieveRequest.java deleted file mode 100644 index 1d7296763..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/users/requests/UsersRetrieveRequest.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.users.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.users.types.UsersRetrieveRequestExpand; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) -public final class UsersRetrieveRequest { - private final Optional expand; - - private final Optional includeRemoteData; - - private final Map additionalProperties; - - private UsersRetrieveRequest( - Optional expand, - Optional includeRemoteData, - Map additionalProperties) { - this.expand = expand; - this.includeRemoteData = includeRemoteData; - this.additionalProperties = additionalProperties; - } - - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - - /** - * @return Whether to include the original data Merge fetched from the third-party to produce these models. - */ - @JsonProperty("include_remote_data") - public Optional getIncludeRemoteData() { - return includeRemoteData; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UsersRetrieveRequest other) { - return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional expand = Optional.empty(); - - private Optional includeRemoteData = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(UsersRetrieveRequest other) { - expand(other.getExpand()); - includeRemoteData(other.getIncludeRemoteData()); - return this; - } - - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(UsersRetrieveRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - - @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) - public Builder includeRemoteData(Optional includeRemoteData) { - this.includeRemoteData = includeRemoteData; - return this; - } - - public Builder includeRemoteData(Boolean includeRemoteData) { - this.includeRemoteData = Optional.ofNullable(includeRemoteData); - return this; - } - - public UsersRetrieveRequest build() { - return new UsersRetrieveRequest(expand, includeRemoteData, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/users/types/UsersListRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/users/types/UsersListRequestExpand.java deleted file mode 100644 index d4ee2c067..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/users/types/UsersListRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.users.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum UsersListRequestExpand { - ROLES("roles"), - - TEAMS("teams"), - - TEAMS_ROLES("teams,roles"); - - private final String value; - - UsersListRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/users/types/UsersRetrieveRequestExpand.java b/src/main/java/com/merge/api/resources/ticketing/users/types/UsersRetrieveRequestExpand.java deleted file mode 100644 index b3450de03..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/users/types/UsersRetrieveRequestExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.users.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum UsersRetrieveRequestExpand { - ROLES("roles"), - - TEAMS("teams"), - - TEAMS_ROLES("teams,roles"); - - private final String value; - - UsersRetrieveRequestExpand(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/webhookreceivers/WebhookReceiversClient.java b/src/main/java/com/merge/api/resources/ticketing/webhookreceivers/WebhookReceiversClient.java deleted file mode 100644 index 875ae6e08..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/webhookreceivers/WebhookReceiversClient.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.webhookreceivers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.merge.api.core.ApiError; -import com.merge.api.core.ClientOptions; -import com.merge.api.core.MediaTypes; -import com.merge.api.core.MergeException; -import com.merge.api.core.ObjectMappers; -import com.merge.api.core.RequestOptions; -import com.merge.api.resources.ticketing.types.WebhookReceiver; -import com.merge.api.resources.ticketing.webhookreceivers.requests.WebhookReceiverRequest; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class WebhookReceiversClient { - protected final ClientOptions clientOptions; - - public WebhookReceiversClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list() { - return list(null); - } - - /** - * Returns a list of WebhookReceiver objects. - */ - public List list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/webhook-receivers") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), new TypeReference>() {}); - } - 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); - } - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request) { - return create(request, null); - } - - /** - * Creates a WebhookReceiver object with the given values. - */ - public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("ticketing/v1/webhook-receivers") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "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(), WebhookReceiver.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); - } - } -} diff --git a/src/main/java/com/merge/api/resources/ticketing/webhookreceivers/requests/WebhookReceiverRequest.java b/src/main/java/com/merge/api/resources/ticketing/webhookreceivers/requests/WebhookReceiverRequest.java deleted file mode 100644 index c77117fdf..000000000 --- a/src/main/java/com/merge/api/resources/ticketing/webhookreceivers/requests/WebhookReceiverRequest.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.merge.api.resources.ticketing.webhookreceivers.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.merge.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) -public final class WebhookReceiverRequest { - private final String event; - - private final boolean isActive; - - private final Optional key; - - private final Map additionalProperties; - - private WebhookReceiverRequest( - String event, boolean isActive, Optional key, Map additionalProperties) { - this.event = event; - this.isActive = isActive; - this.key = key; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public String getEvent() { - return event; - } - - @JsonProperty("is_active") - public boolean getIsActive() { - return isActive; - } - - @JsonProperty("key") - public Optional getKey() { - return key; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(WebhookReceiverRequest other) { - return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.isActive, this.key); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - IsActiveStage event(@NotNull String event); - - Builder from(WebhookReceiverRequest other); - } - - public interface IsActiveStage { - _FinalStage isActive(boolean isActive); - } - - public interface _FinalStage { - WebhookReceiverRequest build(); - - _FinalStage key(Optional key); - - _FinalStage key(String key); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, IsActiveStage, _FinalStage { - private String event; - - private boolean isActive; - - private Optional key = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(WebhookReceiverRequest other) { - event(other.getEvent()); - isActive(other.getIsActive()); - key(other.getKey()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public IsActiveStage event(@NotNull String event) { - this.event = event; - return this; - } - - @java.lang.Override - @JsonSetter("is_active") - public _FinalStage isActive(boolean isActive) { - this.isActive = isActive; - return this; - } - - @java.lang.Override - public _FinalStage key(String key) { - this.key = Optional.ofNullable(key); - return this; - } - - @java.lang.Override - @JsonSetter(value = "key", nulls = Nulls.SKIP) - public _FinalStage key(Optional key) { - this.key = key; - return this; - } - - @java.lang.Override - public WebhookReceiverRequest build() { - return new WebhookReceiverRequest(event, isActive, key, additionalProperties); - } - } -} diff --git a/src/main/java/com/merge/api/ticketing/AccountDetailsClient.java b/src/main/java/com/merge/api/ticketing/AccountDetailsClient.java new file mode 100644 index 000000000..563469c28 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountDetails; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AccountTokenClient.java b/src/main/java/com/merge/api/ticketing/AccountTokenClient.java new file mode 100644 index 000000000..05b012dc0 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AccountTokenClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountToken; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AccountsClient.java b/src/main/java/com/merge/api/ticketing/AccountsClient.java new file mode 100644 index 000000000..89487a899 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AccountsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Account; +import com.merge.api.ticketing.types.AccountsListRequest; +import com.merge.api.ticketing.types.AccountsRetrieveRequest; + +public class AccountsClient { + protected final ClientOptions clientOptions; + + private final RawAccountsClient rawClient; + + public AccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list(AccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Account objects. + */ + public SyncPagingIterable list(AccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id, AccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Account object with the given id. + */ + public Account retrieve(String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/ticketing/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..a46c58baa --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountDetails; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncAccountTokenClient.java new file mode 100644 index 000000000..5ad1b4d10 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncAccountTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncAccountsClient.java b/src/main/java/com/merge/api/ticketing/AsyncAccountsClient.java new file mode 100644 index 000000000..7ac423ecc --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncAccountsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Account; +import com.merge.api.ticketing.types.AccountsListRequest; +import com.merge.api.ticketing.types.AccountsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountsClient rawClient; + + public AsyncAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list(AccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture> list( + AccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve(String id, AccountsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/ticketing/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..2672c20f5 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AsyncPassthroughReciept; +import com.merge.api.ticketing.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.ticketing.types.DataPassthroughRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncAttachmentsClient.java b/src/main/java/com/merge/api/ticketing/AsyncAttachmentsClient.java new file mode 100644 index 000000000..77a8e8358 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncAttachmentsClient.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Attachment; +import com.merge.api.ticketing.types.AttachmentsDownloadRetrieveRequest; +import com.merge.api.ticketing.types.AttachmentsListRequest; +import com.merge.api.ticketing.types.AttachmentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.TicketingAttachmentEndpointRequest; +import com.merge.api.ticketing.types.TicketingAttachmentResponse; +import java.io.InputStream; +import java.util.concurrent.CompletableFuture; + +public class AsyncAttachmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAttachmentsClient rawClient; + + public AsyncAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list(AttachmentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture create(TicketingAttachmentEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture create( + TicketingAttachmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture downloadRetrieve(String id) { + return this.rawClient.downloadRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture downloadRetrieve(String id, AttachmentsDownloadRetrieveRequest request) { + return this.rawClient.downloadRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture downloadRetrieve( + String id, AttachmentsDownloadRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.downloadRetrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/ticketing/AsyncAuditTrailClient.java new file mode 100644 index 000000000..69f1346e4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AuditLogEvent; +import com.merge.api.ticketing.types.AuditTrailListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/ticketing/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..a7b599a98 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AvailableActions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncCollectionsClient.java b/src/main/java/com/merge/api/ticketing/AsyncCollectionsClient.java new file mode 100644 index 000000000..4b4824470 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncCollectionsClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Collection; +import com.merge.api.ticketing.types.CollectionsListRequest; +import com.merge.api.ticketing.types.CollectionsRetrieveRequest; +import com.merge.api.ticketing.types.CollectionsViewersListRequest; +import com.merge.api.ticketing.types.Viewer; +import java.util.concurrent.CompletableFuture; + +public class AsyncCollectionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCollectionsClient rawClient; + + public AsyncCollectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCollectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCollectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Collection objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Collection objects. + */ + public CompletableFuture> list(CollectionsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Collection objects. + */ + public CompletableFuture> list( + CollectionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public CompletableFuture> viewersList(String collectionId) { + return this.rawClient.viewersList(collectionId).thenApply(response -> response.body()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public CompletableFuture> viewersList( + String collectionId, CollectionsViewersListRequest request) { + return this.rawClient.viewersList(collectionId, request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public CompletableFuture> viewersList( + String collectionId, CollectionsViewersListRequest request, RequestOptions requestOptions) { + return this.rawClient.viewersList(collectionId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Collection object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Collection object with the given id. + */ + public CompletableFuture retrieve(String id, CollectionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Collection object with the given id. + */ + public CompletableFuture retrieve( + String id, CollectionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncCommentsClient.java b/src/main/java/com/merge/api/ticketing/AsyncCommentsClient.java new file mode 100644 index 000000000..343e5f04f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncCommentsClient.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Comment; +import com.merge.api.ticketing.types.CommentEndpointRequest; +import com.merge.api.ticketing.types.CommentResponse; +import com.merge.api.ticketing.types.CommentsListRequest; +import com.merge.api.ticketing.types.CommentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncCommentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCommentsClient rawClient; + + public AsyncCommentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCommentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCommentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Comment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Comment objects. + */ + public CompletableFuture> list(CommentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Comment objects. + */ + public CompletableFuture> list( + CommentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Comment object with the given values. + */ + public CompletableFuture create(CommentEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Comment object with the given values. + */ + public CompletableFuture create(CommentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Comment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Comment object with the given id. + */ + public CompletableFuture retrieve(String id, CommentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Comment object with the given id. + */ + public CompletableFuture retrieve( + String id, CommentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Comment POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Comment POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncContactsClient.java b/src/main/java/com/merge/api/ticketing/AsyncContactsClient.java new file mode 100644 index 000000000..d453b5e84 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncContactsClient.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Contact; +import com.merge.api.ticketing.types.ContactsListRequest; +import com.merge.api.ticketing.types.ContactsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.TicketingContactEndpointRequest; +import com.merge.api.ticketing.types.TicketingContactResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncContactsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawContactsClient rawClient; + + public AsyncContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawContactsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawContactsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list(ContactsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture> list( + ContactsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture create(TicketingContactEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture create( + TicketingContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve(String id, ContactsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/ticketing/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..6d3084268 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/ticketing/AsyncFieldMappingClient.java new file mode 100644 index 000000000..91f35faaa --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncFieldMappingClient.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CreateFieldMappingRequest; +import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; +import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; +import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; +import com.merge.api.ticketing.types.RemoteFieldApiResponse; +import com.merge.api.ticketing.types.RemoteFieldsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncForceResyncClient.java b/src/main/java/com/merge/api/ticketing/AsyncForceResyncClient.java new file mode 100644 index 000000000..167250b1f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.SyncStatus; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..c6a85a432 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.GenerateRemoteKeyRequest; +import com.merge.api.ticketing.types.RemoteKey; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncIssuesClient.java b/src/main/java/com/merge/api/ticketing/AsyncIssuesClient.java new file mode 100644 index 000000000..ce384203c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Issue; +import com.merge.api.ticketing.types.IssuesListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncLinkTokenClient.java new file mode 100644 index 000000000..f360911c4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.EndUserDetailsRequest; +import com.merge.api.ticketing.types.LinkToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/ticketing/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..b5de58838 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AccountDetailsAndActions; +import com.merge.api.ticketing.types.LinkedAccountsListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncPassthroughClient.java b/src/main/java/com/merge/api/ticketing/AsyncPassthroughClient.java new file mode 100644 index 000000000..151e6fba7 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.DataPassthroughRequest; +import com.merge.api.ticketing.types.RemoteResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncProjectsClient.java b/src/main/java/com/merge/api/ticketing/AsyncProjectsClient.java new file mode 100644 index 000000000..5ebff6c1d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncProjectsClient.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Project; +import com.merge.api.ticketing.types.ProjectsListRequest; +import com.merge.api.ticketing.types.ProjectsRetrieveRequest; +import com.merge.api.ticketing.types.ProjectsUsersListRequest; +import com.merge.api.ticketing.types.User; +import java.util.concurrent.CompletableFuture; + +public class AsyncProjectsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawProjectsClient rawClient; + + public AsyncProjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawProjectsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawProjectsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Project objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Project objects. + */ + public CompletableFuture> list(ProjectsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Project objects. + */ + public CompletableFuture> list( + ProjectsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Project object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Project object with the given id. + */ + public CompletableFuture retrieve(String id, ProjectsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Project object with the given id. + */ + public CompletableFuture retrieve( + String id, ProjectsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> usersList(String parentId) { + return this.rawClient.usersList(parentId).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> usersList(String parentId, ProjectsUsersListRequest request) { + return this.rawClient.usersList(parentId, request).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> usersList( + String parentId, ProjectsUsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.usersList(parentId, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..109660a33 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAccountDetailsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountDetails; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..7122c3dd3 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAccountTokenClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java new file mode 100644 index 000000000..47dd2c7fd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Account; +import com.merge.api.ticketing.types.AccountsListRequest; +import com.merge.api.ticketing.types.AccountsRetrieveRequest; +import com.merge.api.ticketing.types.PaginatedAccountList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list() { + return list(AccountsListRequest.builder().build()); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list(AccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Account objects. + */ + public CompletableFuture>> list( + AccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/accounts"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsListRequest nextRequest = AccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AccountsRetrieveRequest.builder().build()); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve(String id, AccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Account object with the given id. + */ + public CompletableFuture> retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..fbb398570 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AsyncPassthroughReciept; +import com.merge.api.ticketing.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.ticketing.types.DataPassthroughRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughReciept.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java new file mode 100644 index 000000000..a51a5dd2c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java @@ -0,0 +1,490 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.ResponseBodyInputStream; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Attachment; +import com.merge.api.ticketing.types.AttachmentsDownloadRetrieveRequest; +import com.merge.api.ticketing.types.AttachmentsListRequest; +import com.merge.api.ticketing.types.AttachmentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedAttachmentList; +import com.merge.api.ticketing.types.TicketingAttachmentEndpointRequest; +import com.merge.api.ticketing.types.TicketingAttachmentResponse; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAttachmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTicketId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_id", request.getTicketId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAttachmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture> create( + TicketingAttachmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Attachment object with the given values. + */ + public CompletableFuture> create( + TicketingAttachmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), TicketingAttachmentResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve(String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture> downloadRetrieve(String id) { + return downloadRetrieve(id, AttachmentsDownloadRetrieveRequest.builder().build()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture> downloadRetrieve( + String id, AttachmentsDownloadRetrieveRequest request) { + return downloadRetrieve(id, request, null); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public CompletableFuture> downloadRetrieve( + String id, AttachmentsDownloadRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments") + .addPathSegment(id) + .addPathSegments("download"); + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..1115f0e71 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AuditLogEvent; +import com.merge.api.ticketing.types.AuditTrailListRequest; +import com.merge.api.ticketing.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..a4cce3e8a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAvailableActionsClient.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AvailableActions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java new file mode 100644 index 000000000..aa6eec90d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java @@ -0,0 +1,406 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Collection; +import com.merge.api.ticketing.types.CollectionsListRequest; +import com.merge.api.ticketing.types.CollectionsRetrieveRequest; +import com.merge.api.ticketing.types.CollectionsViewersListRequest; +import com.merge.api.ticketing.types.PaginatedCollectionList; +import com.merge.api.ticketing.types.PaginatedViewerList; +import com.merge.api.ticketing.types.Viewer; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCollectionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawCollectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Collection objects. + */ + public CompletableFuture>> list() { + return list(CollectionsListRequest.builder().build()); + } + + /** + * Returns a list of Collection objects. + */ + public CompletableFuture>> list( + CollectionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Collection objects. + */ + public CompletableFuture>> list( + CollectionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/collections"); + if (request.getCollectionType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collection_type", request.getCollectionType().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentCollectionId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "parent_collection_id", + request.getParentCollectionId().get(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCollectionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedCollectionList.class); + Optional startingAfter = parsedResponse.getNext(); + CollectionsListRequest nextRequest = CollectionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public CompletableFuture>> viewersList(String collectionId) { + return viewersList(collectionId, CollectionsViewersListRequest.builder().build()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public CompletableFuture>> viewersList( + String collectionId, CollectionsViewersListRequest request) { + return viewersList(collectionId, request, null); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public CompletableFuture>> viewersList( + String collectionId, CollectionsViewersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/collections") + .addPathSegment(collectionId) + .addPathSegments("viewers"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedViewerList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + Optional startingAfter = parsedResponse.getNext(); + CollectionsViewersListRequest nextRequest = CollectionsViewersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return viewersList(collectionId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Collection object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CollectionsRetrieveRequest.builder().build()); + } + + /** + * Returns a Collection object with the given id. + */ + public CompletableFuture> retrieve(String id, CollectionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Collection object with the given id. + */ + public CompletableFuture> retrieve( + String id, CollectionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/collections") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Collection.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java new file mode 100644 index 000000000..155783e8d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java @@ -0,0 +1,407 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Comment; +import com.merge.api.ticketing.types.CommentEndpointRequest; +import com.merge.api.ticketing.types.CommentResponse; +import com.merge.api.ticketing.types.CommentsListRequest; +import com.merge.api.ticketing.types.CommentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedCommentList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCommentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawCommentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Comment objects. + */ + public CompletableFuture>> list() { + return list(CommentsListRequest.builder().build()); + } + + /** + * Returns a list of Comment objects. + */ + public CompletableFuture>> list(CommentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Comment objects. + */ + public CompletableFuture>> list( + CommentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTicketId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_id", request.getTicketId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedCommentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCommentList.class); + Optional startingAfter = parsedResponse.getNext(); + CommentsListRequest nextRequest = CommentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Comment object with the given values. + */ + public CompletableFuture> create(CommentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Comment object with the given values. + */ + public CompletableFuture> create( + CommentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommentResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Comment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, CommentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Comment object with the given id. + */ + public CompletableFuture> retrieve(String id, CommentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Comment object with the given id. + */ + public CompletableFuture> retrieve( + String id, CommentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Comment.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Comment POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Comment POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java new file mode 100644 index 000000000..029420f9c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java @@ -0,0 +1,398 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Contact; +import com.merge.api.ticketing.types.ContactsListRequest; +import com.merge.api.ticketing.types.ContactsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedContactList; +import com.merge.api.ticketing.types.TicketingContactEndpointRequest; +import com.merge.api.ticketing.types.TicketingContactResponse; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawContactsClient { + protected final ClientOptions clientOptions; + + public AsyncRawContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list() { + return list(ContactsListRequest.builder().build()); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list(ContactsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Contact objects. + */ + public CompletableFuture>> list( + ContactsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedContactList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsListRequest nextRequest = ContactsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture> create( + TicketingContactEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Contact object with the given values. + */ + public CompletableFuture> create( + TicketingContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), TicketingContactResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ContactsRetrieveRequest.builder().build()); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve(String id, ContactsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Contact object with the given id. + */ + public CompletableFuture> retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..b288b8447 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawDeleteAccountClient.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..803f84107 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java @@ -0,0 +1,471 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CreateFieldMappingRequest; +import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; +import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; +import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; +import com.merge.api.ticketing.types.RemoteFieldApiResponse; +import com.merge.api.ticketing.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingInstanceResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), RemoteFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..283a71811 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawForceResyncClient.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..9bc456b05 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawGenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.GenerateRemoteKeyRequest; +import com.merge.api.ticketing.types.RemoteKey; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java new file mode 100644 index 000000000..0a391254e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java @@ -0,0 +1,247 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Issue; +import com.merge.api.ticketing.types.IssuesListRequest; +import com.merge.api.ticketing.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..5505c7533 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.EndUserDetailsRequest; +import com.merge.api.ticketing.types.LinkToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..a453eda27 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AccountDetailsAndActions; +import com.merge.api.ticketing.types.LinkedAccountsListRequest; +import com.merge.api.ticketing.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..267e629b0 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawPassthroughClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.DataPassthroughRequest; +import com.merge.api.ticketing.types.RemoteResponse; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java new file mode 100644 index 000000000..7a47b03b0 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java @@ -0,0 +1,369 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedProjectList; +import com.merge.api.ticketing.types.PaginatedUserList; +import com.merge.api.ticketing.types.Project; +import com.merge.api.ticketing.types.ProjectsListRequest; +import com.merge.api.ticketing.types.ProjectsRetrieveRequest; +import com.merge.api.ticketing.types.ProjectsUsersListRequest; +import com.merge.api.ticketing.types.User; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawProjectsClient { + protected final ClientOptions clientOptions; + + public AsyncRawProjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Project objects. + */ + public CompletableFuture>> list() { + return list(ProjectsListRequest.builder().build()); + } + + /** + * Returns a list of Project objects. + */ + public CompletableFuture>> list(ProjectsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Project objects. + */ + public CompletableFuture>> list( + ProjectsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/projects"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedProjectList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class); + Optional startingAfter = parsedResponse.getNext(); + ProjectsListRequest nextRequest = ProjectsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Project object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ProjectsRetrieveRequest.builder().build()); + } + + /** + * Returns a Project object with the given id. + */ + public CompletableFuture> retrieve(String id, ProjectsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Project object with the given id. + */ + public CompletableFuture> retrieve( + String id, ProjectsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/projects") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Project.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> usersList(String parentId) { + return usersList(parentId, ProjectsUsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> usersList( + String parentId, ProjectsUsersListRequest request) { + return usersList(parentId, request, null); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> usersList( + String parentId, ProjectsUsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/projects") + .addPathSegment(parentId) + .addPathSegments("users"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + ProjectsUsersListRequest nextRequest = ProjectsUsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return usersList(parentId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..c7aef7d48 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.RemoteKey; +import com.merge.api.ticketing.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java new file mode 100644 index 000000000..afdcd6132 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedRoleList; +import com.merge.api.ticketing.types.Role; +import com.merge.api.ticketing.types.RolesListRequest; +import com.merge.api.ticketing.types.RolesRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRolesClient { + protected final ClientOptions clientOptions; + + public AsyncRawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Role objects. + */ + public CompletableFuture>> list() { + return list(RolesListRequest.builder().build()); + } + + /** + * Returns a list of Role objects. + */ + public CompletableFuture>> list(RolesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Role objects. + */ + public CompletableFuture>> list( + RolesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/roles"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRoleList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRoleList.class); + Optional startingAfter = parsedResponse.getNext(); + RolesListRequest nextRequest = RolesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Role object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, RolesRetrieveRequest.builder().build()); + } + + /** + * Returns a Role object with the given id. + */ + public CompletableFuture> retrieve(String id, RolesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Role object with the given id. + */ + public CompletableFuture> retrieve( + String id, RolesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/roles") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Role.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawScopesClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawScopesClient.java new file mode 100644 index 000000000..1fdd8b34c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawScopesClient.java @@ -0,0 +1,217 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CommonModelScopeApi; +import com.merge.api.ticketing.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..b8ec11e7f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedSyncStatusList; +import com.merge.api.ticketing.types.SyncStatus; +import com.merge.api.ticketing.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java new file mode 100644 index 000000000..83fc1ae91 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedTagList; +import com.merge.api.ticketing.types.Tag; +import com.merge.api.ticketing.types.TagsListRequest; +import com.merge.api.ticketing.types.TagsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTagsClient { + protected final ClientOptions clientOptions; + + public AsyncRawTagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture>> list() { + return list(TagsListRequest.builder().build()); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture>> list(TagsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture>> list( + TagsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tags"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTagList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + Optional startingAfter = parsedResponse.getNext(); + TagsListRequest nextRequest = TagsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Tag object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TagsRetrieveRequest.builder().build()); + } + + /** + * Returns a Tag object with the given id. + */ + public CompletableFuture> retrieve(String id, TagsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Tag object with the given id. + */ + public CompletableFuture> retrieve( + String id, TagsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tags") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Tag.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java new file mode 100644 index 000000000..edc49894d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java @@ -0,0 +1,250 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedTeamList; +import com.merge.api.ticketing.types.Team; +import com.merge.api.ticketing.types.TeamsListRequest; +import com.merge.api.ticketing.types.TeamsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTeamsClient { + protected final ClientOptions clientOptions; + + public AsyncRawTeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture>> list() { + return list(TeamsListRequest.builder().build()); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture>> list(TeamsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture>> list( + TeamsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/teams"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTeamList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + Optional startingAfter = parsedResponse.getNext(); + TeamsListRequest nextRequest = TeamsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TeamsRetrieveRequest.builder().build()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture> retrieve(String id, TeamsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture> retrieve( + String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/teams") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java new file mode 100644 index 000000000..92d724741 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java @@ -0,0 +1,904 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedRemoteFieldClassList; +import com.merge.api.ticketing.types.PaginatedTicketList; +import com.merge.api.ticketing.types.PaginatedViewerList; +import com.merge.api.ticketing.types.PatchedTicketEndpointRequest; +import com.merge.api.ticketing.types.RemoteFieldClass; +import com.merge.api.ticketing.types.Ticket; +import com.merge.api.ticketing.types.TicketEndpointRequest; +import com.merge.api.ticketing.types.TicketResponse; +import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; +import com.merge.api.ticketing.types.TicketsRetrieveRequest; +import com.merge.api.ticketing.types.TicketsViewersListRequest; +import com.merge.api.ticketing.types.Viewer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawTicketsClient { + protected final ClientOptions clientOptions; + + public AsyncRawTicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture>> list() { + return list(TicketsListRequest.builder().build()); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture>> list(TicketsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture>> list( + TicketsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getAssigneeIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "assignee_ids", request.getAssigneeIds().get(), false); + } + if (request.getCollectionIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collection_ids", request.getCollectionIds().get(), false); + } + if (request.getCompletedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "completed_after", + request.getCompletedAfter().get().toString(), + false); + } + if (request.getCompletedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "completed_before", + request.getCompletedBefore().get().toString(), + false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDueAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "due_after", request.getDueAfter().get().toString(), false); + } + if (request.getDueBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "due_before", request.getDueBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentTicketId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_ticket_id", request.getParentTicketId().get(), false); + } + if (request.getPriority().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "priority", request.getPriority().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_before", + request.getRemoteCreatedBefore().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRemoteUpdatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_updated_after", + request.getRemoteUpdatedAfter().get().toString(), + false); + } + if (request.getRemoteUpdatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_updated_before", + request.getRemoteUpdatedBefore().get().toString(), + false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getTags().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "tags", request.getTags().get(), false); + } + if (request.getTicketType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_type", request.getTicketType().get(), false); + } + if (request.getTicketUrl().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_url", request.getTicketUrl().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedTicketList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTicketList.class); + Optional startingAfter = parsedResponse.getNext(); + TicketsListRequest nextRequest = TicketsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a Ticket object with the given values. + */ + public CompletableFuture> create(TicketEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Ticket object with the given values. + */ + public CompletableFuture> create( + TicketEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Ticket object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, TicketsRetrieveRequest.builder().build()); + } + + /** + * Returns a Ticket object with the given id. + */ + public CompletableFuture> retrieve(String id, TicketsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Ticket object with the given id. + */ + public CompletableFuture> retrieve( + String id, TicketsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Ticket.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a Ticket object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedTicketEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Ticket object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedTicketEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public CompletableFuture>> viewersList(String ticketId) { + return viewersList(ticketId, TicketsViewersListRequest.builder().build()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public CompletableFuture>> viewersList( + String ticketId, TicketsViewersListRequest request) { + return viewersList(ticketId, request, null); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public CompletableFuture>> viewersList( + String ticketId, TicketsViewersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets") + .addPathSegment(ticketId) + .addPathSegments("viewers"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedViewerList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + Optional startingAfter = parsedResponse.getNext(); + TicketsViewersListRequest nextRequest = TicketsViewersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return viewersList(ticketId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Ticket POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Ticket POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + TicketsRemoteFieldClassesListRequest nextRequest = + TicketsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java new file mode 100644 index 000000000..3e04ce081 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedUserList; +import com.merge.api.ticketing.types.User; +import com.merge.api.ticketing.types.UsersListRequest; +import com.merge.api.ticketing.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_address", request.getEmailAddress().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTeam().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "team", request.getTeam().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..87209fd20 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,160 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.WebhookReceiver; +import com.merge.api.ticketing.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..2ca044acc --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.RemoteKey; +import com.merge.api.ticketing.types.RemoteKeyForRegenerationRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncRolesClient.java b/src/main/java/com/merge/api/ticketing/AsyncRolesClient.java new file mode 100644 index 000000000..9cb5ef0cd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncRolesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Role; +import com.merge.api.ticketing.types.RolesListRequest; +import com.merge.api.ticketing.types.RolesRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncRolesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRolesClient rawClient; + + public AsyncRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Role objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Role objects. + */ + public CompletableFuture> list(RolesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Role objects. + */ + public CompletableFuture> list(RolesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Role object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Role object with the given id. + */ + public CompletableFuture retrieve(String id, RolesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Role object with the given id. + */ + public CompletableFuture retrieve(String id, RolesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncScopesClient.java b/src/main/java/com/merge/api/ticketing/AsyncScopesClient.java new file mode 100644 index 000000000..559609c4c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CommonModelScopeApi; +import com.merge.api.ticketing.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/ticketing/AsyncSyncStatusClient.java new file mode 100644 index 000000000..f02ea3615 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.SyncStatus; +import com.merge.api.ticketing.types.SyncStatusListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncTagsClient.java b/src/main/java/com/merge/api/ticketing/AsyncTagsClient.java new file mode 100644 index 000000000..924d729e2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncTagsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Tag; +import com.merge.api.ticketing.types.TagsListRequest; +import com.merge.api.ticketing.types.TagsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncTagsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTagsClient rawClient; + + public AsyncTagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTagsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTagsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture> list(TagsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Tag objects. + */ + public CompletableFuture> list(TagsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Tag object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Tag object with the given id. + */ + public CompletableFuture retrieve(String id, TagsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Tag object with the given id. + */ + public CompletableFuture retrieve(String id, TagsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncTeamsClient.java b/src/main/java/com/merge/api/ticketing/AsyncTeamsClient.java new file mode 100644 index 000000000..6a025d11b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncTeamsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Team; +import com.merge.api.ticketing.types.TeamsListRequest; +import com.merge.api.ticketing.types.TeamsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncTeamsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTeamsClient rawClient; + + public AsyncTeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTeamsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTeamsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture> list(TeamsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Team objects. + */ + public CompletableFuture> list(TeamsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture retrieve(String id, TeamsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Team object with the given id. + */ + public CompletableFuture retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncTicketingClient.java b/src/main/java/com/merge/api/ticketing/AsyncTicketingClient.java new file mode 100644 index 000000000..7c56fcab0 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncTicketingClient.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncTicketingClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier accountsClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier attachmentsClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier collectionsClient; + + protected final Supplier commentsClient; + + protected final Supplier contactsClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier passthroughClient; + + protected final Supplier projectsClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier rolesClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier tagsClient; + + protected final Supplier teamsClient; + + protected final Supplier ticketsClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public AsyncTicketingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.accountsClient = Suppliers.memoize(() -> new AsyncAccountsClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AsyncAttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.collectionsClient = Suppliers.memoize(() -> new AsyncCollectionsClient(clientOptions)); + this.commentsClient = Suppliers.memoize(() -> new AsyncCommentsClient(clientOptions)); + this.contactsClient = Suppliers.memoize(() -> new AsyncContactsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.projectsClient = Suppliers.memoize(() -> new AsyncProjectsClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.rolesClient = Suppliers.memoize(() -> new AsyncRolesClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.tagsClient = Suppliers.memoize(() -> new AsyncTagsClient(clientOptions)); + this.teamsClient = Suppliers.memoize(() -> new AsyncTeamsClient(clientOptions)); + this.ticketsClient = Suppliers.memoize(() -> new AsyncTicketsClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncAccountsClient accounts() { + return this.accountsClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncCollectionsClient collections() { + return this.collectionsClient.get(); + } + + public AsyncCommentsClient comments() { + return this.commentsClient.get(); + } + + public AsyncContactsClient contacts() { + return this.contactsClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncProjectsClient projects() { + return this.projectsClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncRolesClient roles() { + return this.rolesClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncTagsClient tags() { + return this.tagsClient.get(); + } + + public AsyncTeamsClient teams() { + return this.teamsClient.get(); + } + + public AsyncTicketsClient tickets() { + return this.ticketsClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java b/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java new file mode 100644 index 000000000..32cb0db2a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PatchedTicketEndpointRequest; +import com.merge.api.ticketing.types.RemoteFieldClass; +import com.merge.api.ticketing.types.Ticket; +import com.merge.api.ticketing.types.TicketEndpointRequest; +import com.merge.api.ticketing.types.TicketResponse; +import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; +import com.merge.api.ticketing.types.TicketsRetrieveRequest; +import com.merge.api.ticketing.types.TicketsViewersListRequest; +import com.merge.api.ticketing.types.Viewer; +import java.util.concurrent.CompletableFuture; + +public class AsyncTicketsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawTicketsClient rawClient; + + public AsyncTicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawTicketsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawTicketsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture> list(TicketsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture> list( + TicketsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a Ticket object with the given values. + */ + public CompletableFuture create(TicketEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a Ticket object with the given values. + */ + public CompletableFuture create(TicketEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Ticket object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Ticket object with the given id. + */ + public CompletableFuture retrieve(String id, TicketsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Ticket object with the given id. + */ + public CompletableFuture retrieve( + String id, TicketsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Updates a Ticket object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedTicketEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a Ticket object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedTicketEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public CompletableFuture> viewersList(String ticketId) { + return this.rawClient.viewersList(ticketId).thenApply(response -> response.body()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public CompletableFuture> viewersList( + String ticketId, TicketsViewersListRequest request) { + return this.rawClient.viewersList(ticketId, request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public CompletableFuture> viewersList( + String ticketId, TicketsViewersListRequest request, RequestOptions requestOptions) { + return this.rawClient.viewersList(ticketId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Ticket POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for Ticket POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncUsersClient.java b/src/main/java/com/merge/api/ticketing/AsyncUsersClient.java new file mode 100644 index 000000000..926bd5a20 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncUsersClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.User; +import com.merge.api.ticketing.types.UsersListRequest; +import com.merge.api.ticketing.types.UsersRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/ticketing/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..625ec5319 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.WebhookReceiver; +import com.merge.api.ticketing.types.WebhookReceiverRequest; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AttachmentsClient.java b/src/main/java/com/merge/api/ticketing/AttachmentsClient.java new file mode 100644 index 000000000..5ddce426c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AttachmentsClient.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Attachment; +import com.merge.api.ticketing.types.AttachmentsDownloadRetrieveRequest; +import com.merge.api.ticketing.types.AttachmentsListRequest; +import com.merge.api.ticketing.types.AttachmentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.TicketingAttachmentEndpointRequest; +import com.merge.api.ticketing.types.TicketingAttachmentResponse; +import java.io.InputStream; + +public class AttachmentsClient { + protected final ClientOptions clientOptions; + + private final RawAttachmentsClient rawClient; + + public AttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list(AttachmentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list(AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an Attachment object with the given values. + */ + public TicketingAttachmentResponse create(TicketingAttachmentEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an Attachment object with the given values. + */ + public TicketingAttachmentResponse create( + TicketingAttachmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public InputStream downloadRetrieve(String id) { + return this.rawClient.downloadRetrieve(id).body(); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public InputStream downloadRetrieve(String id, AttachmentsDownloadRetrieveRequest request) { + return this.rawClient.downloadRetrieve(id, request).body(); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public InputStream downloadRetrieve( + String id, AttachmentsDownloadRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.downloadRetrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AuditTrailClient.java b/src/main/java/com/merge/api/ticketing/AuditTrailClient.java new file mode 100644 index 000000000..0c62c07fc --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AuditLogEvent; +import com.merge.api.ticketing.types.AuditTrailListRequest; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/AvailableActionsClient.java b/src/main/java/com/merge/api/ticketing/AvailableActionsClient.java new file mode 100644 index 000000000..c8a9c6509 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AvailableActions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/CollectionsClient.java b/src/main/java/com/merge/api/ticketing/CollectionsClient.java new file mode 100644 index 000000000..a03e49fff --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/CollectionsClient.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Collection; +import com.merge.api.ticketing.types.CollectionsListRequest; +import com.merge.api.ticketing.types.CollectionsRetrieveRequest; +import com.merge.api.ticketing.types.CollectionsViewersListRequest; +import com.merge.api.ticketing.types.Viewer; + +public class CollectionsClient { + protected final ClientOptions clientOptions; + + private final RawCollectionsClient rawClient; + + public CollectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCollectionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCollectionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Collection objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Collection objects. + */ + public SyncPagingIterable list(CollectionsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Collection objects. + */ + public SyncPagingIterable list(CollectionsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public SyncPagingIterable viewersList(String collectionId) { + return this.rawClient.viewersList(collectionId).body(); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public SyncPagingIterable viewersList(String collectionId, CollectionsViewersListRequest request) { + return this.rawClient.viewersList(collectionId, request).body(); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public SyncPagingIterable viewersList( + String collectionId, CollectionsViewersListRequest request, RequestOptions requestOptions) { + return this.rawClient.viewersList(collectionId, request, requestOptions).body(); + } + + /** + * Returns a Collection object with the given id. + */ + public Collection retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Collection object with the given id. + */ + public Collection retrieve(String id, CollectionsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Collection object with the given id. + */ + public Collection retrieve(String id, CollectionsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/CommentsClient.java b/src/main/java/com/merge/api/ticketing/CommentsClient.java new file mode 100644 index 000000000..5f7c0644f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/CommentsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Comment; +import com.merge.api.ticketing.types.CommentEndpointRequest; +import com.merge.api.ticketing.types.CommentResponse; +import com.merge.api.ticketing.types.CommentsListRequest; +import com.merge.api.ticketing.types.CommentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; + +public class CommentsClient { + protected final ClientOptions clientOptions; + + private final RawCommentsClient rawClient; + + public CommentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCommentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCommentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Comment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Comment objects. + */ + public SyncPagingIterable list(CommentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Comment objects. + */ + public SyncPagingIterable list(CommentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Comment object with the given values. + */ + public CommentResponse create(CommentEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Comment object with the given values. + */ + public CommentResponse create(CommentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Comment object with the given id. + */ + public Comment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Comment object with the given id. + */ + public Comment retrieve(String id, CommentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Comment object with the given id. + */ + public Comment retrieve(String id, CommentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Comment POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Comment POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/ContactsClient.java b/src/main/java/com/merge/api/ticketing/ContactsClient.java new file mode 100644 index 000000000..2fb448e2c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/ContactsClient.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Contact; +import com.merge.api.ticketing.types.ContactsListRequest; +import com.merge.api.ticketing.types.ContactsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.TicketingContactEndpointRequest; +import com.merge.api.ticketing.types.TicketingContactResponse; + +public class ContactsClient { + protected final ClientOptions clientOptions; + + private final RawContactsClient rawClient; + + public ContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawContactsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawContactsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list(ContactsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Contact objects. + */ + public SyncPagingIterable list(ContactsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Contact object with the given values. + */ + public TicketingContactResponse create(TicketingContactEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Contact object with the given values. + */ + public TicketingContactResponse create(TicketingContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id, ContactsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Contact object with the given id. + */ + public Contact retrieve(String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/DeleteAccountClient.java b/src/main/java/com/merge/api/ticketing/DeleteAccountClient.java new file mode 100644 index 000000000..0e3654cdd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/FieldMappingClient.java b/src/main/java/com/merge/api/ticketing/FieldMappingClient.java new file mode 100644 index 000000000..38a8ea491 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/FieldMappingClient.java @@ -0,0 +1,149 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CreateFieldMappingRequest; +import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; +import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; +import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; +import com.merge.api.ticketing.types.RemoteFieldApiResponse; +import com.merge.api.ticketing.types.RemoteFieldsRetrieveRequest; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/ForceResyncClient.java b/src/main/java/com/merge/api/ticketing/ForceResyncClient.java new file mode 100644 index 000000000..4a45e2760 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.SyncStatus; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/GenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/GenerateKeyClient.java new file mode 100644 index 000000000..e37170366 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.GenerateRemoteKeyRequest; +import com.merge.api.ticketing.types.RemoteKey; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/IssuesClient.java b/src/main/java/com/merge/api/ticketing/IssuesClient.java new file mode 100644 index 000000000..e6dcf1db9 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Issue; +import com.merge.api.ticketing.types.IssuesListRequest; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/LinkTokenClient.java b/src/main/java/com/merge/api/ticketing/LinkTokenClient.java new file mode 100644 index 000000000..d9ad4b66a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.EndUserDetailsRequest; +import com.merge.api.ticketing.types.LinkToken; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/LinkedAccountsClient.java b/src/main/java/com/merge/api/ticketing/LinkedAccountsClient.java new file mode 100644 index 000000000..96e23a194 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AccountDetailsAndActions; +import com.merge.api.ticketing.types.LinkedAccountsListRequest; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/PassthroughClient.java b/src/main/java/com/merge/api/ticketing/PassthroughClient.java new file mode 100644 index 000000000..20f46228b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.DataPassthroughRequest; +import com.merge.api.ticketing.types.RemoteResponse; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/ProjectsClient.java b/src/main/java/com/merge/api/ticketing/ProjectsClient.java new file mode 100644 index 000000000..0238fc055 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/ProjectsClient.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Project; +import com.merge.api.ticketing.types.ProjectsListRequest; +import com.merge.api.ticketing.types.ProjectsRetrieveRequest; +import com.merge.api.ticketing.types.ProjectsUsersListRequest; +import com.merge.api.ticketing.types.User; + +public class ProjectsClient { + protected final ClientOptions clientOptions; + + private final RawProjectsClient rawClient; + + public ProjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawProjectsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawProjectsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Project objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Project objects. + */ + public SyncPagingIterable list(ProjectsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Project objects. + */ + public SyncPagingIterable list(ProjectsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Project object with the given id. + */ + public Project retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Project object with the given id. + */ + public Project retrieve(String id, ProjectsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Project object with the given id. + */ + public Project retrieve(String id, ProjectsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable usersList(String parentId) { + return this.rawClient.usersList(parentId).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable usersList(String parentId, ProjectsUsersListRequest request) { + return this.rawClient.usersList(parentId, request).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable usersList( + String parentId, ProjectsUsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.usersList(parentId, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawAccountDetailsClient.java b/src/main/java/com/merge/api/ticketing/RawAccountDetailsClient.java new file mode 100644 index 000000000..678dcdb56 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawAccountDetailsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountDetails; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java b/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java new file mode 100644 index 000000000..cdb22d382 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AccountToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawAccountsClient.java b/src/main/java/com/merge/api/ticketing/RawAccountsClient.java new file mode 100644 index 000000000..33d6a9daa --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawAccountsClient.java @@ -0,0 +1,213 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Account; +import com.merge.api.ticketing.types.AccountsListRequest; +import com.merge.api.ticketing.types.AccountsRetrieveRequest; +import com.merge.api.ticketing.types.PaginatedAccountList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountsClient { + protected final ClientOptions clientOptions; + + public RawAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list() { + return list(AccountsListRequest.builder().build()); + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list(AccountsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Account objects. + */ + public MergeApiHttpResponse> list( + AccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/accounts"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + Optional startingAfter = parsedResponse.getNext(); + AccountsListRequest nextRequest = AccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AccountsRetrieveRequest.builder().build()); + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AccountsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Account object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AccountsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/accounts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..c694cab8b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AsyncPassthroughReciept; +import com.merge.api.ticketing.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.ticketing.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), AsyncPassthroughRetrieveResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java b/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java new file mode 100644 index 000000000..6ed80fd35 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java @@ -0,0 +1,408 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.ResponseBodyInputStream; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Attachment; +import com.merge.api.ticketing.types.AttachmentsDownloadRetrieveRequest; +import com.merge.api.ticketing.types.AttachmentsListRequest; +import com.merge.api.ticketing.types.AttachmentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedAttachmentList; +import com.merge.api.ticketing.types.TicketingAttachmentEndpointRequest; +import com.merge.api.ticketing.types.TicketingAttachmentResponse; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAttachmentsClient { + protected final ClientOptions clientOptions; + + public RawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list(AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTicketId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_id", request.getTicketId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an Attachment object with the given values. + */ + public MergeApiHttpResponse create(TicketingAttachmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an Attachment object with the given values. + */ + public MergeApiHttpResponse create( + TicketingAttachmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketingAttachmentResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public MergeApiHttpResponse downloadRetrieve(String id) { + return downloadRetrieve(id, AttachmentsDownloadRetrieveRequest.builder().build()); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public MergeApiHttpResponse downloadRetrieve(String id, AttachmentsDownloadRetrieveRequest request) { + return downloadRetrieve(id, request, null); + } + + /** + * Returns the File content with the given id as a stream of bytes. + */ + public MergeApiHttpResponse downloadRetrieve( + String id, AttachmentsDownloadRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments") + .addPathSegment(id) + .addPathSegments("download"); + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getMimeType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "mime_type", request.getMimeType().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TicketingAttachment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/attachments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java b/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java new file mode 100644 index 000000000..e829d1fa1 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AuditLogEvent; +import com.merge.api.ticketing.types.AuditTrailListRequest; +import com.merge.api.ticketing.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawAvailableActionsClient.java b/src/main/java/com/merge/api/ticketing/RawAvailableActionsClient.java new file mode 100644 index 000000000..bc705b750 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawAvailableActionsClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.AvailableActions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java b/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java new file mode 100644 index 000000000..1cf1385ee --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Collection; +import com.merge.api.ticketing.types.CollectionsListRequest; +import com.merge.api.ticketing.types.CollectionsRetrieveRequest; +import com.merge.api.ticketing.types.CollectionsViewersListRequest; +import com.merge.api.ticketing.types.PaginatedCollectionList; +import com.merge.api.ticketing.types.PaginatedViewerList; +import com.merge.api.ticketing.types.Viewer; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCollectionsClient { + protected final ClientOptions clientOptions; + + public RawCollectionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Collection objects. + */ + public MergeApiHttpResponse> list() { + return list(CollectionsListRequest.builder().build()); + } + + /** + * Returns a list of Collection objects. + */ + public MergeApiHttpResponse> list(CollectionsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Collection objects. + */ + public MergeApiHttpResponse> list( + CollectionsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/collections"); + if (request.getCollectionType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collection_type", request.getCollectionType().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentCollectionId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "parent_collection_id", + request.getParentCollectionId().get(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCollectionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCollectionList.class); + Optional startingAfter = parsedResponse.getNext(); + CollectionsListRequest nextRequest = CollectionsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public MergeApiHttpResponse> viewersList(String collectionId) { + return viewersList(collectionId, CollectionsViewersListRequest.builder().build()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public MergeApiHttpResponse> viewersList( + String collectionId, CollectionsViewersListRequest request) { + return viewersList(collectionId, request, null); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Collection with the given id. Learn more. + */ + public MergeApiHttpResponse> viewersList( + String collectionId, CollectionsViewersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/collections") + .addPathSegment(collectionId) + .addPathSegments("viewers"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedViewerList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + Optional startingAfter = parsedResponse.getNext(); + CollectionsViewersListRequest nextRequest = CollectionsViewersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> viewersList( + collectionId, nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Collection object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CollectionsRetrieveRequest.builder().build()); + } + + /** + * Returns a Collection object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CollectionsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Collection object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CollectionsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/collections") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Collection.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawCommentsClient.java b/src/main/java/com/merge/api/ticketing/RawCommentsClient.java new file mode 100644 index 000000000..ae78cb99e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawCommentsClient.java @@ -0,0 +1,341 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Comment; +import com.merge.api.ticketing.types.CommentEndpointRequest; +import com.merge.api.ticketing.types.CommentResponse; +import com.merge.api.ticketing.types.CommentsListRequest; +import com.merge.api.ticketing.types.CommentsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedCommentList; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCommentsClient { + protected final ClientOptions clientOptions; + + public RawCommentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Comment objects. + */ + public MergeApiHttpResponse> list() { + return list(CommentsListRequest.builder().build()); + } + + /** + * Returns a list of Comment objects. + */ + public MergeApiHttpResponse> list(CommentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Comment objects. + */ + public MergeApiHttpResponse> list( + CommentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTicketId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_id", request.getTicketId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedCommentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCommentList.class); + Optional startingAfter = parsedResponse.getNext(); + CommentsListRequest nextRequest = CommentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Comment object with the given values. + */ + public MergeApiHttpResponse create(CommentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Comment object with the given values. + */ + public MergeApiHttpResponse create(CommentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommentResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Comment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, CommentsRetrieveRequest.builder().build()); + } + + /** + * Returns a Comment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, CommentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Comment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, CommentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Comment.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Comment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Comment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/comments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawContactsClient.java b/src/main/java/com/merge/api/ticketing/RawContactsClient.java new file mode 100644 index 000000000..30adce58c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawContactsClient.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Contact; +import com.merge.api.ticketing.types.ContactsListRequest; +import com.merge.api.ticketing.types.ContactsRetrieveRequest; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedContactList; +import com.merge.api.ticketing.types.TicketingContactEndpointRequest; +import com.merge.api.ticketing.types.TicketingContactResponse; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawContactsClient { + protected final ClientOptions clientOptions; + + public RawContactsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list() { + return list(ContactsListRequest.builder().build()); + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list(ContactsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Contact objects. + */ + public MergeApiHttpResponse> list( + ContactsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedContactList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + Optional startingAfter = parsedResponse.getNext(); + ContactsListRequest nextRequest = ContactsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Contact object with the given values. + */ + public MergeApiHttpResponse create(TicketingContactEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Contact object with the given values. + */ + public MergeApiHttpResponse create( + TicketingContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketingContactResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ContactsRetrieveRequest.builder().build()); + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ContactsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Contact object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ContactsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for TicketingContact POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/contacts/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawDeleteAccountClient.java b/src/main/java/com/merge/api/ticketing/RawDeleteAccountClient.java new file mode 100644 index 000000000..930ff6efd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawDeleteAccountClient.java @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .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 new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java b/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java new file mode 100644 index 000000000..87512a318 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java @@ -0,0 +1,380 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CreateFieldMappingRequest; +import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; +import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; +import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; +import com.merge.api.ticketing.types.RemoteFieldApiResponse; +import com.merge.api.ticketing.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), FieldMappingApiInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get().toString(), + false); + } + Map properties = new HashMap<>(); + properties.put("target_field_name", request.getTargetFieldName()); + properties.put("target_field_description", request.getTargetFieldDescription()); + properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); + properties.put("remote_method", request.getRemoteMethod()); + properties.put("remote_url_path", request.getRemoteUrlPath()); + properties.put("common_model_name", request.getCommonModelName()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync ALL data from start. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, null); + } + + /** + * Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. Learn more. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. Learn more. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), ExternalTargetFieldApiResponse.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawForceResyncClient.java b/src/main/java/com/merge/api/ticketing/RawForceResyncClient.java new file mode 100644 index 000000000..6ce953c80 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawForceResyncClient.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawGenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/RawGenerateKeyClient.java new file mode 100644 index 000000000..9db1d8dda --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawGenerateKeyClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.GenerateRemoteKeyRequest; +import com.merge.api.ticketing.types.RemoteKey; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawIssuesClient.java b/src/main/java/com/merge/api/ticketing/RawIssuesClient.java new file mode 100644 index 000000000..2da83e448 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawIssuesClient.java @@ -0,0 +1,210 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Issue; +import com.merge.api.ticketing.types.IssuesListRequest; +import com.merge.api.ticketing.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get().toString(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get().toString(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get().toString(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get().toString(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java b/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java new file mode 100644 index 000000000..8f7d7eb05 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.EndUserDetailsRequest; +import com.merge.api.ticketing.types.LinkToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java new file mode 100644 index 000000000..f4a4ccf69 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.AccountDetailsAndActions; +import com.merge.api.ticketing.types.LinkedAccountsListRequest; +import com.merge.api.ticketing.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get().toString(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawPassthroughClient.java b/src/main/java/com/merge/api/ticketing/RawPassthroughClient.java new file mode 100644 index 000000000..b43409476 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawPassthroughClient.java @@ -0,0 +1,81 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.DataPassthroughRequest; +import com.merge.api.ticketing.types.RemoteResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawProjectsClient.java b/src/main/java/com/merge/api/ticketing/RawProjectsClient.java new file mode 100644 index 000000000..7d7827d75 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawProjectsClient.java @@ -0,0 +1,312 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedProjectList; +import com.merge.api.ticketing.types.PaginatedUserList; +import com.merge.api.ticketing.types.Project; +import com.merge.api.ticketing.types.ProjectsListRequest; +import com.merge.api.ticketing.types.ProjectsRetrieveRequest; +import com.merge.api.ticketing.types.ProjectsUsersListRequest; +import com.merge.api.ticketing.types.User; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawProjectsClient { + protected final ClientOptions clientOptions; + + public RawProjectsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Project objects. + */ + public MergeApiHttpResponse> list() { + return list(ProjectsListRequest.builder().build()); + } + + /** + * Returns a list of Project objects. + */ + public MergeApiHttpResponse> list(ProjectsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Project objects. + */ + public MergeApiHttpResponse> list( + ProjectsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/projects"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedProjectList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class); + Optional startingAfter = parsedResponse.getNext(); + ProjectsListRequest nextRequest = ProjectsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Project object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ProjectsRetrieveRequest.builder().build()); + } + + /** + * Returns a Project object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ProjectsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Project object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ProjectsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/projects") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Project.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> usersList(String parentId) { + return usersList(parentId, ProjectsUsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> usersList(String parentId, ProjectsUsersListRequest request) { + return usersList(parentId, request, null); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> usersList( + String parentId, ProjectsUsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/projects") + .addPathSegment(parentId) + .addPathSegments("users"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + ProjectsUsersListRequest nextRequest = ProjectsUsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> usersList( + parentId, nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/RawRegenerateKeyClient.java new file mode 100644 index 000000000..3f058b9fd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawRegenerateKeyClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.RemoteKey; +import com.merge.api.ticketing.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawRolesClient.java b/src/main/java/com/merge/api/ticketing/RawRolesClient.java new file mode 100644 index 000000000..bb087dec1 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawRolesClient.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedRoleList; +import com.merge.api.ticketing.types.Role; +import com.merge.api.ticketing.types.RolesListRequest; +import com.merge.api.ticketing.types.RolesRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRolesClient { + protected final ClientOptions clientOptions; + + public RawRolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Role objects. + */ + public MergeApiHttpResponse> list() { + return list(RolesListRequest.builder().build()); + } + + /** + * Returns a list of Role objects. + */ + public MergeApiHttpResponse> list(RolesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Role objects. + */ + public MergeApiHttpResponse> list( + RolesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/roles"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRoleList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRoleList.class); + Optional startingAfter = parsedResponse.getNext(); + RolesListRequest nextRequest = RolesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Role object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, RolesRetrieveRequest.builder().build()); + } + + /** + * Returns a Role object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, RolesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Role object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, RolesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/roles") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Role.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawScopesClient.java b/src/main/java/com/merge/api/ticketing/RawScopesClient.java new file mode 100644 index 000000000..135e2336d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawScopesClient.java @@ -0,0 +1,172 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CommonModelScopeApi; +import com.merge.api.ticketing.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java b/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java new file mode 100644 index 000000000..b795ac69a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedSyncStatusList; +import com.merge.api.ticketing.types.SyncStatus; +import com.merge.api.ticketing.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawTagsClient.java b/src/main/java/com/merge/api/ticketing/RawTagsClient.java new file mode 100644 index 000000000..71cc8bc07 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawTagsClient.java @@ -0,0 +1,211 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedTagList; +import com.merge.api.ticketing.types.Tag; +import com.merge.api.ticketing.types.TagsListRequest; +import com.merge.api.ticketing.types.TagsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTagsClient { + protected final ClientOptions clientOptions; + + public RawTagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Tag objects. + */ + public MergeApiHttpResponse> list() { + return list(TagsListRequest.builder().build()); + } + + /** + * Returns a list of Tag objects. + */ + public MergeApiHttpResponse> list(TagsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Tag objects. + */ + public MergeApiHttpResponse> list(TagsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tags"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTagList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + Optional startingAfter = parsedResponse.getNext(); + TagsListRequest nextRequest = TagsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Tag object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TagsRetrieveRequest.builder().build()); + } + + /** + * Returns a Tag object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TagsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Tag object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TagsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tags") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Tag.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawTeamsClient.java b/src/main/java/com/merge/api/ticketing/RawTeamsClient.java new file mode 100644 index 000000000..b30600033 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawTeamsClient.java @@ -0,0 +1,212 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedTeamList; +import com.merge.api.ticketing.types.Team; +import com.merge.api.ticketing.types.TeamsListRequest; +import com.merge.api.ticketing.types.TeamsRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTeamsClient { + protected final ClientOptions clientOptions; + + public RawTeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Team objects. + */ + public MergeApiHttpResponse> list() { + return list(TeamsListRequest.builder().build()); + } + + /** + * Returns a list of Team objects. + */ + public MergeApiHttpResponse> list(TeamsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Team objects. + */ + public MergeApiHttpResponse> list( + TeamsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/teams"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTeamList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + Optional startingAfter = parsedResponse.getNext(); + TeamsListRequest nextRequest = TeamsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Team object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TeamsRetrieveRequest.builder().build()); + } + + /** + * Returns a Team object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Team object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/teams") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawTicketsClient.java b/src/main/java/com/merge/api/ticketing/RawTicketsClient.java new file mode 100644 index 000000000..0cef9d893 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawTicketsClient.java @@ -0,0 +1,768 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PaginatedRemoteFieldClassList; +import com.merge.api.ticketing.types.PaginatedTicketList; +import com.merge.api.ticketing.types.PaginatedViewerList; +import com.merge.api.ticketing.types.PatchedTicketEndpointRequest; +import com.merge.api.ticketing.types.RemoteFieldClass; +import com.merge.api.ticketing.types.Ticket; +import com.merge.api.ticketing.types.TicketEndpointRequest; +import com.merge.api.ticketing.types.TicketResponse; +import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; +import com.merge.api.ticketing.types.TicketsRetrieveRequest; +import com.merge.api.ticketing.types.TicketsViewersListRequest; +import com.merge.api.ticketing.types.Viewer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawTicketsClient { + protected final ClientOptions clientOptions; + + public RawTicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Ticket objects. + */ + public MergeApiHttpResponse> list() { + return list(TicketsListRequest.builder().build()); + } + + /** + * Returns a list of Ticket objects. + */ + public MergeApiHttpResponse> list(TicketsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Ticket objects. + */ + public MergeApiHttpResponse> list( + TicketsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets"); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getAssigneeIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "assignee_ids", request.getAssigneeIds().get(), false); + } + if (request.getCollectionIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collection_ids", request.getCollectionIds().get(), false); + } + if (request.getCompletedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "completed_after", + request.getCompletedAfter().get().toString(), + false); + } + if (request.getCompletedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "completed_before", + request.getCompletedBefore().get().toString(), + false); + } + if (request.getContactId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "contact_id", request.getContactId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getDueAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "due_after", request.getDueAfter().get().toString(), false); + } + if (request.getDueBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "due_before", request.getDueBefore().get().toString(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getParentTicketId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_ticket_id", request.getParentTicketId().get(), false); + } + if (request.getPriority().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "priority", request.getPriority().get().toString(), false); + } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get().toString(), + false); + } + if (request.getRemoteCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_before", + request.getRemoteCreatedBefore().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRemoteUpdatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_updated_after", + request.getRemoteUpdatedAfter().get().toString(), + false); + } + if (request.getRemoteUpdatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_updated_before", + request.getRemoteUpdatedBefore().get().toString(), + false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getTags().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "tags", request.getTags().get(), false); + } + if (request.getTicketType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_type", request.getTicketType().get(), false); + } + if (request.getTicketUrl().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_url", request.getTicketUrl().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedTicketList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTicketList.class); + Optional startingAfter = parsedResponse.getNext(); + TicketsListRequest nextRequest = TicketsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a Ticket object with the given values. + */ + public MergeApiHttpResponse create(TicketEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a Ticket object with the given values. + */ + public MergeApiHttpResponse create(TicketEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Ticket object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, TicketsRetrieveRequest.builder().build()); + } + + /** + * Returns a Ticket object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, TicketsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Ticket object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, TicketsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get().toString(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "show_enum_origins", + request.getShowEnumOrigins().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Ticket.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a Ticket object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedTicketEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Ticket object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedTicketEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get().toString(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get().toString(), false); + } + Map properties = new HashMap<>(); + properties.put("model", request.getModel()); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public MergeApiHttpResponse> viewersList(String ticketId) { + return viewersList(ticketId, TicketsViewersListRequest.builder().build()); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public MergeApiHttpResponse> viewersList( + String ticketId, TicketsViewersListRequest request) { + return viewersList(ticketId, request, null); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public MergeApiHttpResponse> viewersList( + String ticketId, TicketsViewersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets") + .addPathSegment(ticketId) + .addPathSegments("viewers"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedViewerList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + Optional startingAfter = parsedResponse.getNext(); + TicketsViewersListRequest nextRequest = TicketsViewersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, () -> viewersList( + ticketId, nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Ticket POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for Ticket POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + TicketsRemoteFieldClassesListRequest nextRequest = TicketsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawUsersClient.java b/src/main/java/com/merge/api/ticketing/RawUsersClient.java new file mode 100644 index 000000000..c74fdddb9 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawUsersClient.java @@ -0,0 +1,228 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.PaginatedUserList; +import com.merge.api.ticketing.types.User; +import com.merge.api.ticketing.types.UsersListRequest; +import com.merge.api.ticketing.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get().toString(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get().toString(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_address", request.getEmailAddress().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get().toString(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get().toString(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "modified_before", + request.getModifiedBefore().get().toString(), + false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get().toString(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getTeam().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "team", request.getTeam().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) + .body()), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get().toString(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_shell_data", + request.getIncludeShellData().get().toString(), + false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get().toString(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/ticketing/RawWebhookReceiversClient.java new file mode 100644 index 000000000..3856498d4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RawWebhookReceiversClient.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.WebhookReceiver; +import com.merge.api.ticketing.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBody.string(), new TypeReference>() {}), + response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getApiURL()) + .newBuilder() + .addPathSegments("ticketing/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "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 new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + throw new ApiError( + "Error with status code " + response.code(), + response.code(), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/RegenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/RegenerateKeyClient.java new file mode 100644 index 000000000..8dab98a56 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.RemoteKey; +import com.merge.api.ticketing.types.RemoteKeyForRegenerationRequest; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/RolesClient.java b/src/main/java/com/merge/api/ticketing/RolesClient.java new file mode 100644 index 000000000..1c475c74f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/RolesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Role; +import com.merge.api.ticketing.types.RolesListRequest; +import com.merge.api.ticketing.types.RolesRetrieveRequest; + +public class RolesClient { + protected final ClientOptions clientOptions; + + private final RawRolesClient rawClient; + + public RolesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRolesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRolesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Role objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Role objects. + */ + public SyncPagingIterable list(RolesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Role objects. + */ + public SyncPagingIterable list(RolesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Role object with the given id. + */ + public Role retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Role object with the given id. + */ + public Role retrieve(String id, RolesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Role object with the given id. + */ + public Role retrieve(String id, RolesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/ScopesClient.java b/src/main/java/com/merge/api/ticketing/ScopesClient.java new file mode 100644 index 000000000..f2043fef0 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.CommonModelScopeApi; +import com.merge.api.ticketing.types.LinkedAccountCommonModelScopeDeserializerRequest; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. Learn more + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/SyncStatusClient.java b/src/main/java/com/merge/api/ticketing/SyncStatusClient.java new file mode 100644 index 000000000..8df0cd2b2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.SyncStatus; +import com.merge.api.ticketing.types.SyncStatusListRequest; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Get sync status for the current sync and the most recently finished sync. last_sync_start represents the most recent time any sync began. last_sync_finished represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the last_sync_finished timestamp where last_sync_result is DONE. Possible values for status and last_sync_result are DISABLED, DONE, FAILED, PARTIALLY_SYNCED, PAUSED, SYNCING. Learn more about sync status in our Help Center. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/TagsClient.java b/src/main/java/com/merge/api/ticketing/TagsClient.java new file mode 100644 index 000000000..3e0418a50 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/TagsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Tag; +import com.merge.api.ticketing.types.TagsListRequest; +import com.merge.api.ticketing.types.TagsRetrieveRequest; + +public class TagsClient { + protected final ClientOptions clientOptions; + + private final RawTagsClient rawClient; + + public TagsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTagsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTagsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Tag objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Tag objects. + */ + public SyncPagingIterable list(TagsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Tag objects. + */ + public SyncPagingIterable list(TagsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Tag object with the given id. + */ + public Tag retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Tag object with the given id. + */ + public Tag retrieve(String id, TagsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Tag object with the given id. + */ + public Tag retrieve(String id, TagsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/TeamsClient.java b/src/main/java/com/merge/api/ticketing/TeamsClient.java new file mode 100644 index 000000000..695d0a521 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/TeamsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.Team; +import com.merge.api.ticketing.types.TeamsListRequest; +import com.merge.api.ticketing.types.TeamsRetrieveRequest; + +public class TeamsClient { + protected final ClientOptions clientOptions; + + private final RawTeamsClient rawClient; + + public TeamsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTeamsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTeamsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Team objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Team objects. + */ + public SyncPagingIterable list(TeamsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Team objects. + */ + public SyncPagingIterable list(TeamsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Team object with the given id. + */ + public Team retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Team object with the given id. + */ + public Team retrieve(String id, TeamsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Team object with the given id. + */ + public Team retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/TicketingClient.java b/src/main/java/com/merge/api/ticketing/TicketingClient.java similarity index 78% rename from src/main/java/com/merge/api/resources/ticketing/TicketingClient.java rename to src/main/java/com/merge/api/ticketing/TicketingClient.java index 98439ff53..bb64e8ff1 100644 --- a/src/main/java/com/merge/api/resources/ticketing/TicketingClient.java +++ b/src/main/java/com/merge/api/ticketing/TicketingClient.java @@ -1,38 +1,10 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing; +package com.merge.api.ticketing; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; -import com.merge.api.resources.ticketing.accountdetails.AccountDetailsClient; -import com.merge.api.resources.ticketing.accounts.AccountsClient; -import com.merge.api.resources.ticketing.accounttoken.AccountTokenClient; -import com.merge.api.resources.ticketing.asyncpassthrough.AsyncPassthroughClient; -import com.merge.api.resources.ticketing.attachments.AttachmentsClient; -import com.merge.api.resources.ticketing.audittrail.AuditTrailClient; -import com.merge.api.resources.ticketing.availableactions.AvailableActionsClient; -import com.merge.api.resources.ticketing.collections.CollectionsClient; -import com.merge.api.resources.ticketing.comments.CommentsClient; -import com.merge.api.resources.ticketing.contacts.ContactsClient; -import com.merge.api.resources.ticketing.deleteaccount.DeleteAccountClient; -import com.merge.api.resources.ticketing.fieldmapping.FieldMappingClient; -import com.merge.api.resources.ticketing.forceresync.ForceResyncClient; -import com.merge.api.resources.ticketing.generatekey.GenerateKeyClient; -import com.merge.api.resources.ticketing.issues.IssuesClient; -import com.merge.api.resources.ticketing.linkedaccounts.LinkedAccountsClient; -import com.merge.api.resources.ticketing.linktoken.LinkTokenClient; -import com.merge.api.resources.ticketing.passthrough.PassthroughClient; -import com.merge.api.resources.ticketing.projects.ProjectsClient; -import com.merge.api.resources.ticketing.regeneratekey.RegenerateKeyClient; -import com.merge.api.resources.ticketing.roles.RolesClient; -import com.merge.api.resources.ticketing.scopes.ScopesClient; -import com.merge.api.resources.ticketing.syncstatus.SyncStatusClient; -import com.merge.api.resources.ticketing.tags.TagsClient; -import com.merge.api.resources.ticketing.teams.TeamsClient; -import com.merge.api.resources.ticketing.tickets.TicketsClient; -import com.merge.api.resources.ticketing.users.UsersClient; -import com.merge.api.resources.ticketing.webhookreceivers.WebhookReceiversClient; import java.util.function.Supplier; public class TicketingClient { diff --git a/src/main/java/com/merge/api/ticketing/TicketsClient.java b/src/main/java/com/merge/api/ticketing/TicketsClient.java new file mode 100644 index 000000000..a73be89b2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/TicketsClient.java @@ -0,0 +1,180 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.MetaResponse; +import com.merge.api.ticketing.types.PatchedTicketEndpointRequest; +import com.merge.api.ticketing.types.RemoteFieldClass; +import com.merge.api.ticketing.types.Ticket; +import com.merge.api.ticketing.types.TicketEndpointRequest; +import com.merge.api.ticketing.types.TicketResponse; +import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; +import com.merge.api.ticketing.types.TicketsRetrieveRequest; +import com.merge.api.ticketing.types.TicketsViewersListRequest; +import com.merge.api.ticketing.types.Viewer; + +public class TicketsClient { + protected final ClientOptions clientOptions; + + private final RawTicketsClient rawClient; + + public TicketsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawTicketsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawTicketsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Ticket objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Ticket objects. + */ + public SyncPagingIterable list(TicketsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Ticket objects. + */ + public SyncPagingIterable list(TicketsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a Ticket object with the given values. + */ + public TicketResponse create(TicketEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a Ticket object with the given values. + */ + public TicketResponse create(TicketEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a Ticket object with the given id. + */ + public Ticket retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Ticket object with the given id. + */ + public Ticket retrieve(String id, TicketsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Ticket object with the given id. + */ + public Ticket retrieve(String id, TicketsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Updates a Ticket object with the given id. + */ + public TicketResponse partialUpdate(String id, PatchedTicketEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a Ticket object with the given id. + */ + public TicketResponse partialUpdate( + String id, PatchedTicketEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public SyncPagingIterable viewersList(String ticketId) { + return this.rawClient.viewersList(ticketId).body(); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public SyncPagingIterable viewersList(String ticketId, TicketsViewersListRequest request) { + return this.rawClient.viewersList(ticketId, request).body(); + } + + /** + * Returns a list of Viewer objects that point to a User id or Team id that is either an assignee or viewer on a Ticket with the given id. Learn more. + */ + public SyncPagingIterable viewersList( + String ticketId, TicketsViewersListRequest request, RequestOptions requestOptions) { + return this.rawClient.viewersList(ticketId, request, requestOptions).body(); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + + /** + * Returns metadata for Ticket POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for Ticket POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList(TicketsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + TicketsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/UsersClient.java b/src/main/java/com/merge/api/ticketing/UsersClient.java new file mode 100644 index 000000000..c0f014617 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/UsersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.ticketing.types.User; +import com.merge.api.ticketing.types.UsersListRequest; +import com.merge.api.ticketing.types.UsersRetrieveRequest; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/ticketing/WebhookReceiversClient.java b/src/main/java/com/merge/api/ticketing/WebhookReceiversClient.java new file mode 100644 index 000000000..43b020af2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.ticketing.types.WebhookReceiver; +import com.merge.api.ticketing.types.WebhookReceiverRequest; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AccessLevelEnum.java b/src/main/java/com/merge/api/ticketing/types/AccessLevelEnum.java similarity index 89% rename from src/main/java/com/merge/api/resources/ticketing/types/AccessLevelEnum.java rename to src/main/java/com/merge/api/ticketing/types/AccessLevelEnum.java index 73a62bbca..6917eb585 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/AccessLevelEnum.java +++ b/src/main/java/com/merge/api/ticketing/types/AccessLevelEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/ticketing/types/Account.java b/src/main/java/com/merge/api/ticketing/types/Account.java new file mode 100644 index 000000000..6bb4e8343 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/Account.java @@ -0,0 +1,329 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Account.Builder.class) +public final class Account { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional>> domains; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Account( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional>> domains, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.domains = domains; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The account's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The account's domain names. + */ + @JsonProperty("domains") + public Optional>> getDomains() { + return domains; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Account && equalTo((Account) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Account other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && domains.equals(other.domains) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.domains, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional>> domains = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Account other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + domains(other.getDomains()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "domains", nulls = Nulls.SKIP) + public Builder domains(Optional>> domains) { + this.domains = domains; + return this; + } + + public Builder domains(List> domains) { + this.domains = Optional.ofNullable(domains); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Account build() { + return new Account( + id, + remoteId, + createdAt, + modifiedAt, + name, + domains, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountDetails.java b/src/main/java/com/merge/api/ticketing/types/AccountDetails.java new file mode 100644 index 000000000..c86168303 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetails.java @@ -0,0 +1,393 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..55d24c730 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java @@ -0,0 +1,480 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatusEnum status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatusEnum status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatusEnum getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(CategoryEnum category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatusEnum status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatusEnum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is null for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

The tenant or domain the customer has provided access to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(CategoryEnum category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..6082cfd2a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..bc18fb04d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum AccountDetailsAndActionsStatusEnum { + COMPLETE("COMPLETE"), + + INCOMPLETE("INCOMPLETE"), + + RELINK_NEEDED("RELINK_NEEDED"), + + IDLE("IDLE"); + + private final String value; + + AccountDetailsAndActionsStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountIntegration.java b/src/main/java/com/merge/api/ticketing/types/AccountIntegration.java new file mode 100644 index 000000000..fcac5ceac --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountIntegration.java @@ -0,0 +1,463 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

Company name.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

Category or categories this integration is in beta status for.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

Setup guide URL for third party webhook creation. Exposed in Merge Docs.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []}

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

Company logo in square shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

Company logo in rectangular shape.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountToken.java b/src/main/java/com/merge/api/ticketing/types/AccountToken.java new file mode 100644 index 000000000..4b21769d2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java b/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java new file mode 100644 index 000000000..71ad8ba95 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountsListRequest.Builder.class) +public final class AccountsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private AccountsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public AccountsListRequest build() { + return new AccountsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/AccountsRetrieveRequest.java new file mode 100644 index 000000000..f56039274 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) +public final class AccountsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private AccountsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public AccountsRetrieveRequest build() { + return new AccountsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AdvancedMetadata.java b/src/main/java/com/merge/api/ticketing/types/AdvancedMetadata.java new file mode 100644 index 000000000..6527997a3 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..7d7a12210 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..310f7b1c2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Attachment.java b/src/main/java/com/merge/api/ticketing/types/Attachment.java new file mode 100644 index 000000000..eea8438b8 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/Attachment.java @@ -0,0 +1,445 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Attachment.Builder.class) +public final class Attachment { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional fileName; + + private final Optional ticket; + + private final Optional fileUrl; + + private final Optional contentType; + + private final Optional uploadedBy; + + private final Optional remoteCreatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Attachment( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional fileName, + Optional ticket, + Optional fileUrl, + Optional contentType, + Optional uploadedBy, + Optional remoteCreatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.fileName = fileName; + this.ticket = ticket; + this.fileUrl = fileUrl; + this.contentType = contentType; + this.uploadedBy = uploadedBy; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The attachment's name. It is required to include the file extension in the attachment's name. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The ticket associated with the attachment. + */ + @JsonProperty("ticket") + public Optional getTicket() { + return ticket; + } + + /** + * @return The attachment's url. It is required to include the file extension in the file's URL. + */ + @JsonProperty("file_url") + public Optional getFileUrl() { + return fileUrl; + } + + /** + * @return The attachment's file format. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + /** + * @return The user who uploaded the attachment. + */ + @JsonProperty("uploaded_by") + public Optional getUploadedBy() { + return uploadedBy; + } + + /** + * @return When the third party's attachment was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Attachment && equalTo((Attachment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Attachment other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && fileName.equals(other.fileName) + && ticket.equals(other.ticket) + && fileUrl.equals(other.fileUrl) + && contentType.equals(other.contentType) + && uploadedBy.equals(other.uploadedBy) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.fileName, + this.ticket, + this.fileUrl, + this.contentType, + this.uploadedBy, + this.remoteCreatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional ticket = Optional.empty(); + + private Optional fileUrl = Optional.empty(); + + private Optional contentType = Optional.empty(); + + private Optional uploadedBy = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Attachment other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + fileName(other.getFileName()); + ticket(other.getTicket()); + fileUrl(other.getFileUrl()); + contentType(other.getContentType()); + uploadedBy(other.getUploadedBy()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public Builder fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + public Builder fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @JsonSetter(value = "ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(AttachmentTicket ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + @JsonSetter(value = "file_url", nulls = Nulls.SKIP) + public Builder fileUrl(Optional fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + public Builder fileUrl(String fileUrl) { + this.fileUrl = Optional.ofNullable(fileUrl); + return this; + } + + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public Builder contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + public Builder contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @JsonSetter(value = "uploaded_by", nulls = Nulls.SKIP) + public Builder uploadedBy(Optional uploadedBy) { + this.uploadedBy = uploadedBy; + return this; + } + + public Builder uploadedBy(String uploadedBy) { + this.uploadedBy = Optional.ofNullable(uploadedBy); + return this; + } + + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Attachment build() { + return new Attachment( + id, + remoteId, + createdAt, + modifiedAt, + fileName, + ticket, + fileUrl, + contentType, + uploadedBy, + remoteCreatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentRequest.java b/src/main/java/com/merge/api/ticketing/types/AttachmentRequest.java new file mode 100644 index 000000000..b01a4a9d4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentRequest.Builder.class) +public final class AttachmentRequest { + private final Optional fileName; + + private final Optional ticket; + + private final Optional fileUrl; + + private final Optional contentType; + + private final Optional uploadedBy; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private AttachmentRequest( + Optional fileName, + Optional ticket, + Optional fileUrl, + Optional contentType, + Optional uploadedBy, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.fileName = fileName; + this.ticket = ticket; + this.fileUrl = fileUrl; + this.contentType = contentType; + this.uploadedBy = uploadedBy; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The attachment's name. It is required to include the file extension in the attachment's name. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The ticket associated with the attachment. + */ + @JsonProperty("ticket") + public Optional getTicket() { + return ticket; + } + + /** + * @return The attachment's url. It is required to include the file extension in the file's URL. + */ + @JsonProperty("file_url") + public Optional getFileUrl() { + return fileUrl; + } + + /** + * @return The attachment's file format. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + /** + * @return The user who uploaded the attachment. + */ + @JsonProperty("uploaded_by") + public Optional getUploadedBy() { + return uploadedBy; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentRequest && equalTo((AttachmentRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentRequest other) { + return fileName.equals(other.fileName) + && ticket.equals(other.ticket) + && fileUrl.equals(other.fileUrl) + && contentType.equals(other.contentType) + && uploadedBy.equals(other.uploadedBy) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.fileName, + this.ticket, + this.fileUrl, + this.contentType, + this.uploadedBy, + this.integrationParams, + this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional fileName = Optional.empty(); + + private Optional ticket = Optional.empty(); + + private Optional fileUrl = Optional.empty(); + + private Optional contentType = Optional.empty(); + + private Optional uploadedBy = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentRequest other) { + fileName(other.getFileName()); + ticket(other.getTicket()); + fileUrl(other.getFileUrl()); + contentType(other.getContentType()); + uploadedBy(other.getUploadedBy()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public Builder fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + public Builder fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @JsonSetter(value = "ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(AttachmentRequestTicket ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + @JsonSetter(value = "file_url", nulls = Nulls.SKIP) + public Builder fileUrl(Optional fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + public Builder fileUrl(String fileUrl) { + this.fileUrl = Optional.ofNullable(fileUrl); + return this; + } + + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public Builder contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + public Builder contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @JsonSetter(value = "uploaded_by", nulls = Nulls.SKIP) + public Builder uploadedBy(Optional uploadedBy) { + this.uploadedBy = uploadedBy; + return this; + } + + public Builder uploadedBy(String uploadedBy) { + this.uploadedBy = Optional.ofNullable(uploadedBy); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public AttachmentRequest build() { + return new AttachmentRequest( + fileName, + ticket, + fileUrl, + contentType, + uploadedBy, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AttachmentRequestTicket.java b/src/main/java/com/merge/api/ticketing/types/AttachmentRequestTicket.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/AttachmentRequestTicket.java rename to src/main/java/com/merge/api/ticketing/types/AttachmentRequestTicket.java index f520ac638..def62074c 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/AttachmentRequestTicket.java +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentRequestTicket.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public AttachmentRequestTicket deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public AttachmentRequestTicket deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/AttachmentTicket.java b/src/main/java/com/merge/api/ticketing/types/AttachmentTicket.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/AttachmentTicket.java rename to src/main/java/com/merge/api/ticketing/types/AttachmentTicket.java index 7ff0b726e..c36a7aa71 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/AttachmentTicket.java +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentTicket.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public AttachmentTicket deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public AttachmentTicket deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentsDownloadRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/AttachmentsDownloadRetrieveRequest.java new file mode 100644 index 000000000..772920ca5 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentsDownloadRetrieveRequest.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsDownloadRetrieveRequest.Builder.class) +public final class AttachmentsDownloadRetrieveRequest { + private final Optional includeShellData; + + private final Optional mimeType; + + private final Map additionalProperties; + + private AttachmentsDownloadRetrieveRequest( + Optional includeShellData, Optional mimeType, Map additionalProperties) { + this.includeShellData = includeShellData; + this.mimeType = mimeType; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. + */ + @JsonProperty("mime_type") + public Optional getMimeType() { + return mimeType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsDownloadRetrieveRequest + && equalTo((AttachmentsDownloadRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsDownloadRetrieveRequest other) { + return includeShellData.equals(other.includeShellData) && mimeType.equals(other.mimeType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeShellData, this.mimeType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeShellData = Optional.empty(); + + private Optional mimeType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsDownloadRetrieveRequest other) { + includeShellData(other.getIncludeShellData()); + mimeType(other.getMimeType()); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "mime_type", nulls = Nulls.SKIP) + public Builder mimeType(Optional mimeType) { + this.mimeType = mimeType; + return this; + } + + public Builder mimeType(String mimeType) { + this.mimeType = Optional.ofNullable(mimeType); + return this; + } + + public AttachmentsDownloadRetrieveRequest build() { + return new AttachmentsDownloadRetrieveRequest(includeShellData, mimeType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequest.java b/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequest.java new file mode 100644 index 000000000..9cbacb007 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequest.java @@ -0,0 +1,459 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsListRequest.Builder.class) +public final class AttachmentsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteCreatedAfter; + + private final Optional remoteId; + + private final Optional ticketId; + + private final Map additionalProperties; + + private AttachmentsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteCreatedAfter, + Optional remoteId, + Optional ticketId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteCreatedAfter = remoteCreatedAfter; + this.remoteId = remoteId; + this.ticketId = ticketId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If provided, will only return attachments created in the third party platform after this datetime. + */ + @JsonProperty("remote_created_after") + public Optional getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return comments for this ticket. + */ + @JsonProperty("ticket_id") + public Optional getTicketId() { + return ticketId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsListRequest && equalTo((AttachmentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteCreatedAfter.equals(other.remoteCreatedAfter) + && remoteId.equals(other.remoteId) + && ticketId.equals(other.ticketId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteCreatedAfter, + this.remoteId, + this.ticketId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteCreatedAfter = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional ticketId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteCreatedAfter(other.getRemoteCreatedAfter()); + remoteId(other.getRemoteId()); + ticketId(other.getTicketId()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_created_after", nulls = Nulls.SKIP) + public Builder remoteCreatedAfter(Optional remoteCreatedAfter) { + this.remoteCreatedAfter = remoteCreatedAfter; + return this; + } + + public Builder remoteCreatedAfter(OffsetDateTime remoteCreatedAfter) { + this.remoteCreatedAfter = Optional.ofNullable(remoteCreatedAfter); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "ticket_id", nulls = Nulls.SKIP) + public Builder ticketId(Optional ticketId) { + this.ticketId = ticketId; + return this; + } + + public Builder ticketId(String ticketId) { + this.ticketId = Optional.ofNullable(ticketId); + return this; + } + + public AttachmentsListRequest build() { + return new AttachmentsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteCreatedAfter, + remoteId, + ticketId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequest.java new file mode 100644 index 000000000..9388765b5 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) +public final class AttachmentsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private AttachmentsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsRetrieveRequest && equalTo((AttachmentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public AttachmentsRetrieveRequest build() { + return new AttachmentsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java b/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java new file mode 100644 index 000000000..3a02d03d8 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java @@ -0,0 +1,449 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final RoleEnum role; + + private final String ipAddress; + + private final EventTypeEnum eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + RoleEnum role, + String ipAddress, + EventTypeEnum eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ */ + @JsonProperty("role") + public RoleEnum getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ */ + @JsonProperty("event_type") + public EventTypeEnum getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + IpAddressStage role(@NotNull RoleEnum role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + EventDescriptionStage eventType(@NotNull EventTypeEnum eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private RoleEnum role; + + private String ipAddress; + + private EventTypeEnum eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

+ *
    + *
  • ADMIN - ADMIN
  • + *
  • DEVELOPER - DEVELOPER
  • + *
  • MEMBER - MEMBER
  • + *
  • API - API
  • + *
  • SYSTEM - SYSTEM
  • + *
  • MERGE_TEAM - MERGE_TEAM
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull RoleEnum role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

Designates the type of event that occurred.

+ *
    + *
  • CREATED_REMOTE_PRODUCTION_API_KEY - CREATED_REMOTE_PRODUCTION_API_KEY
  • + *
  • DELETED_REMOTE_PRODUCTION_API_KEY - DELETED_REMOTE_PRODUCTION_API_KEY
  • + *
  • CREATED_TEST_API_KEY - CREATED_TEST_API_KEY
  • + *
  • DELETED_TEST_API_KEY - DELETED_TEST_API_KEY
  • + *
  • REGENERATED_PRODUCTION_API_KEY - REGENERATED_PRODUCTION_API_KEY
  • + *
  • INVITED_USER - INVITED_USER
  • + *
  • TWO_FACTOR_AUTH_ENABLED - TWO_FACTOR_AUTH_ENABLED
  • + *
  • TWO_FACTOR_AUTH_DISABLED - TWO_FACTOR_AUTH_DISABLED
  • + *
  • DELETED_LINKED_ACCOUNT - DELETED_LINKED_ACCOUNT
  • + *
  • DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_DESTINATION - CREATED_DESTINATION
  • + *
  • DELETED_DESTINATION - DELETED_DESTINATION
  • + *
  • CHANGED_DESTINATION - CHANGED_DESTINATION
  • + *
  • CHANGED_SCOPES - CHANGED_SCOPES
  • + *
  • CHANGED_PERSONAL_INFORMATION - CHANGED_PERSONAL_INFORMATION
  • + *
  • CHANGED_ORGANIZATION_SETTINGS - CHANGED_ORGANIZATION_SETTINGS
  • + *
  • ENABLED_INTEGRATION - ENABLED_INTEGRATION
  • + *
  • DISABLED_INTEGRATION - DISABLED_INTEGRATION
  • + *
  • ENABLED_CATEGORY - ENABLED_CATEGORY
  • + *
  • DISABLED_CATEGORY - DISABLED_CATEGORY
  • + *
  • CHANGED_PASSWORD - CHANGED_PASSWORD
  • + *
  • RESET_PASSWORD - RESET_PASSWORD
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION
  • + *
  • DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT
  • + *
  • CREATED_INTEGRATION_WIDE_FIELD_MAPPING - CREATED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_FIELD_MAPPING - CREATED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CHANGED_INTEGRATION_WIDE_FIELD_MAPPING - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • CHANGED_LINKED_ACCOUNT_FIELD_MAPPING - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • DELETED_INTEGRATION_WIDE_FIELD_MAPPING - DELETED_INTEGRATION_WIDE_FIELD_MAPPING
  • + *
  • DELETED_LINKED_ACCOUNT_FIELD_MAPPING - DELETED_LINKED_ACCOUNT_FIELD_MAPPING
  • + *
  • CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE
  • + *
  • FORCED_LINKED_ACCOUNT_RESYNC - FORCED_LINKED_ACCOUNT_RESYNC
  • + *
  • MUTED_ISSUE - MUTED_ISSUE
  • + *
  • GENERATED_MAGIC_LINK - GENERATED_MAGIC_LINK
  • + *
  • ENABLED_MERGE_WEBHOOK - ENABLED_MERGE_WEBHOOK
  • + *
  • DISABLED_MERGE_WEBHOOK - DISABLED_MERGE_WEBHOOK
  • + *
  • MERGE_WEBHOOK_TARGET_CHANGED - MERGE_WEBHOOK_TARGET_CHANGED
  • + *
  • END_USER_CREDENTIALS_ACCESSED - END_USER_CREDENTIALS_ACCESSED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull EventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

The User's email at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

The User's full name at the time of this Event occurring.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/ticketing/types/AuditTrailListRequest.java new file mode 100644 index 000000000..3795fa8c2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AuditTrailListRequest.java @@ -0,0 +1,236 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return If included, will only include events with the given event type. Possible values include: CREATED_REMOTE_PRODUCTION_API_KEY, DELETED_REMOTE_PRODUCTION_API_KEY, CREATED_TEST_API_KEY, DELETED_TEST_API_KEY, REGENERATED_PRODUCTION_API_KEY, INVITED_USER, TWO_FACTOR_AUTH_ENABLED, TWO_FACTOR_AUTH_DISABLED, DELETED_LINKED_ACCOUNT, DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, CREATED_DESTINATION, DELETED_DESTINATION, CHANGED_DESTINATION, CHANGED_SCOPES, CHANGED_PERSONAL_INFORMATION, CHANGED_ORGANIZATION_SETTINGS, ENABLED_INTEGRATION, DISABLED_INTEGRATION, ENABLED_CATEGORY, DISABLED_CATEGORY, CHANGED_PASSWORD, RESET_PASSWORD, ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, CREATED_INTEGRATION_WIDE_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_FIELD_MAPPING, CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, DELETED_INTEGRATION_WIDE_FIELD_MAPPING, DELETED_LINKED_ACCOUNT_FIELD_MAPPING, CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, FORCED_LINKED_ACCOUNT_RESYNC, MUTED_ISSUE, GENERATED_MAGIC_LINK, ENABLED_MERGE_WEBHOOK, DISABLED_MERGE_WEBHOOK, MERGE_WEBHOOK_TARGET_CHANGED, END_USER_CREDENTIALS_ACCESSED + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AvailableActions.java b/src/main/java/com/merge/api/ticketing/types/AvailableActions.java new file mode 100644 index 000000000..964a19363 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CategoriesEnum.java b/src/main/java/com/merge/api/ticketing/types/CategoriesEnum.java new file mode 100644 index 000000000..016c96a92 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CategoriesEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoriesEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoriesEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CategoryEnum.java b/src/main/java/com/merge/api/ticketing/types/CategoryEnum.java new file mode 100644 index 000000000..7bc3d2288 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CategoryEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CategoryEnum { + HRIS("hris"), + + ATS("ats"), + + ACCOUNTING("accounting"), + + TICKETING("ticketing"), + + CRM("crm"), + + MKTG("mktg"), + + FILESTORAGE("filestorage"); + + private final String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Collection.java b/src/main/java/com/merge/api/ticketing/types/Collection.java similarity index 87% rename from src/main/java/com/merge/api/resources/ticketing/types/Collection.java rename to src/main/java/com/merge/api/ticketing/types/Collection.java index 49d64e0b0..ef054fdd7 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/Collection.java +++ b/src/main/java/com/merge/api/ticketing/types/Collection.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -35,15 +35,13 @@ public final class Collection { private final Optional description; - private final Optional collectionType; + private final Optional collectionType; private final Optional parentCollection; - private final Optional>> teams; - private final Optional remoteWasDeleted; - private final Optional accessLevel; + private final Optional accessLevel; private final Optional> fieldMappings; @@ -58,11 +56,10 @@ private Collection( Optional modifiedAt, Optional name, Optional description, - Optional collectionType, + Optional collectionType, Optional parentCollection, - Optional>> teams, Optional remoteWasDeleted, - Optional accessLevel, + Optional accessLevel, Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { @@ -74,7 +71,6 @@ private Collection( this.description = description; this.collectionType = collectionType; this.parentCollection = parentCollection; - this.teams = teams; this.remoteWasDeleted = remoteWasDeleted; this.accessLevel = accessLevel; this.fieldMappings = fieldMappings; @@ -135,7 +131,7 @@ public Optional getDescription() { * */ @JsonProperty("collection_type") - public Optional getCollectionType() { + public Optional getCollectionType() { return collectionType; } @@ -147,11 +143,6 @@ public Optional getParentCollection() { return parentCollection; } - @JsonProperty("teams") - public Optional>> getTeams() { - return teams; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -169,7 +160,7 @@ public Optional getRemoteWasDeleted() { * */ @JsonProperty("access_level") - public Optional getAccessLevel() { + public Optional getAccessLevel() { return accessLevel; } @@ -203,7 +194,6 @@ private boolean equalTo(Collection other) { && description.equals(other.description) && collectionType.equals(other.collectionType) && parentCollection.equals(other.parentCollection) - && teams.equals(other.teams) && remoteWasDeleted.equals(other.remoteWasDeleted) && accessLevel.equals(other.accessLevel) && fieldMappings.equals(other.fieldMappings) @@ -221,7 +211,6 @@ public int hashCode() { this.description, this.collectionType, this.parentCollection, - this.teams, this.remoteWasDeleted, this.accessLevel, this.fieldMappings, @@ -251,15 +240,13 @@ public static final class Builder { private Optional description = Optional.empty(); - private Optional collectionType = Optional.empty(); + private Optional collectionType = Optional.empty(); private Optional parentCollection = Optional.empty(); - private Optional>> teams = Optional.empty(); - private Optional remoteWasDeleted = Optional.empty(); - private Optional accessLevel = Optional.empty(); + private Optional accessLevel = Optional.empty(); private Optional> fieldMappings = Optional.empty(); @@ -279,7 +266,6 @@ public Builder from(Collection other) { description(other.getDescription()); collectionType(other.getCollectionType()); parentCollection(other.getParentCollection()); - teams(other.getTeams()); remoteWasDeleted(other.getRemoteWasDeleted()); accessLevel(other.getAccessLevel()); fieldMappings(other.getFieldMappings()); @@ -354,12 +340,12 @@ public Builder description(String description) { } @JsonSetter(value = "collection_type", nulls = Nulls.SKIP) - public Builder collectionType(Optional collectionType) { + public Builder collectionType(Optional collectionType) { this.collectionType = collectionType; return this; } - public Builder collectionType(CollectionCollectionType collectionType) { + public Builder collectionType(CollectionTypeEnum collectionType) { this.collectionType = Optional.ofNullable(collectionType); return this; } @@ -375,17 +361,6 @@ public Builder parentCollection(CollectionParentCollection parentCollection) { return this; } - @JsonSetter(value = "teams", nulls = Nulls.SKIP) - public Builder teams(Optional>> teams) { - this.teams = teams; - return this; - } - - public Builder teams(List> teams) { - this.teams = Optional.ofNullable(teams); - return this; - } - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) public Builder remoteWasDeleted(Optional remoteWasDeleted) { this.remoteWasDeleted = remoteWasDeleted; @@ -398,12 +373,12 @@ public Builder remoteWasDeleted(Boolean remoteWasDeleted) { } @JsonSetter(value = "access_level", nulls = Nulls.SKIP) - public Builder accessLevel(Optional accessLevel) { + public Builder accessLevel(Optional accessLevel) { this.accessLevel = accessLevel; return this; } - public Builder accessLevel(CollectionAccessLevel accessLevel) { + public Builder accessLevel(AccessLevelEnum accessLevel) { this.accessLevel = Optional.ofNullable(accessLevel); return this; } @@ -440,7 +415,6 @@ public Collection build() { description, collectionType, parentCollection, - teams, remoteWasDeleted, accessLevel, fieldMappings, diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CollectionParentCollection.java b/src/main/java/com/merge/api/ticketing/types/CollectionParentCollection.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/CollectionParentCollection.java rename to src/main/java/com/merge/api/ticketing/types/CollectionParentCollection.java index 7d203a2a0..955daefa1 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CollectionParentCollection.java +++ b/src/main/java/com/merge/api/ticketing/types/CollectionParentCollection.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional collectionType; private final Optional createdAfter; @@ -30,8 +33,6 @@ public final class CollectionsListRequest { private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -55,11 +56,11 @@ public final class CollectionsListRequest { private final Map additionalProperties; private CollectionsListRequest( + Optional> expand, Optional collectionType, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -71,11 +72,11 @@ private CollectionsListRequest( Optional remoteId, Optional showEnumOrigins, Map additionalProperties) { + this.expand = expand; this.collectionType = collectionType; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -89,6 +90,14 @@ private CollectionsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return collections of the given type. */ @@ -121,14 +130,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -221,11 +222,11 @@ public Map getAdditionalProperties() { } private boolean equalTo(CollectionsListRequest other) { - return collectionType.equals(other.collectionType) + return expand.equals(other.expand) + && collectionType.equals(other.collectionType) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -241,11 +242,11 @@ private boolean equalTo(CollectionsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.collectionType, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -269,6 +270,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional collectionType = Optional.empty(); private Optional createdAfter = Optional.empty(); @@ -277,8 +280,6 @@ public static final class Builder { private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -305,11 +306,11 @@ public static final class Builder { private Builder() {} public Builder from(CollectionsListRequest other) { + expand(other.getExpand()); collectionType(other.getCollectionType()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -323,6 +324,22 @@ public Builder from(CollectionsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "collection_type", nulls = Nulls.SKIP) public Builder collectionType(Optional collectionType) { this.collectionType = collectionType; @@ -367,17 +384,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CollectionsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -490,11 +496,11 @@ public Builder showEnumOrigins(String showEnumOrigins) { public CollectionsListRequest build() { return new CollectionsListRequest( + expand, collectionType, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/ticketing/collections/requests/CollectionsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java similarity index 75% rename from src/main/java/com/merge/api/resources/ticketing/collections/requests/CollectionsRetrieveRequest.java rename to src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java index d55afc21e..7efcfa59f 100644 --- a/src/main/java/com/merge/api/resources/ticketing/collections/requests/CollectionsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.collections.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.collections.types.CollectionsRetrieveRequestExpand; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,10 +22,12 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CollectionsRetrieveRequest.Builder.class) public final class CollectionsRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -32,13 +35,15 @@ public final class CollectionsRetrieveRequest { private final Map additionalProperties; private CollectionsRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -48,7 +53,7 @@ private CollectionsRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -60,6 +65,14 @@ public Optional getIncludeRemoteData() { return includeRemoteData; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -90,13 +103,15 @@ public Map getAdditionalProperties() { private boolean equalTo(CollectionsRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @java.lang.Override public int hashCode() { - return Objects.hash(this.expand, this.includeRemoteData, this.remoteFields, this.showEnumOrigins); + return Objects.hash( + this.expand, this.includeRemoteData, this.includeShellData, this.remoteFields, this.showEnumOrigins); } @java.lang.Override @@ -110,10 +125,12 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -126,22 +143,28 @@ private Builder() {} public Builder from(CollectionsRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(CollectionsRetrieveRequestExpand expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -153,6 +176,17 @@ public Builder includeRemoteData(Boolean includeRemoteData) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -177,7 +211,7 @@ public Builder showEnumOrigins(String showEnumOrigins) { public CollectionsRetrieveRequest build() { return new CollectionsRetrieveRequest( - expand, includeRemoteData, remoteFields, showEnumOrigins, additionalProperties); + expand, includeRemoteData, includeShellData, remoteFields, showEnumOrigins, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequest.java b/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequest.java new file mode 100644 index 000000000..bf3b9c8c4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequest.java @@ -0,0 +1,255 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CollectionsViewersListRequest.Builder.class) +public final class CollectionsViewersListRequest { + private final Optional> expand; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private CollectionsViewersListRequest( + Optional> expand, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional pageSize, + Map additionalProperties) { + this.expand = expand; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CollectionsViewersListRequest && equalTo((CollectionsViewersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CollectionsViewersListRequest other) { + return expand.equals(other.expand) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CollectionsViewersListRequest other) { + expand(other.getExpand()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CollectionsViewersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public CollectionsViewersListRequest build() { + return new CollectionsViewersListRequest( + expand, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequestExpandItem.java new file mode 100644 index 000000000..061e7c54c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CollectionsViewersListRequestExpandItem { + TEAM("team"), + + USER("user"); + + private final String value; + + CollectionsViewersListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Comment.java b/src/main/java/com/merge/api/ticketing/types/Comment.java similarity index 99% rename from src/main/java/com/merge/api/resources/ticketing/types/Comment.java rename to src/main/java/com/merge/api/ticketing/types/Comment.java index 503780bbd..1aa148c98 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/Comment.java +++ b/src/main/java/com/merge/api/ticketing/types/Comment.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentContact.java b/src/main/java/com/merge/api/ticketing/types/CommentContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentContact.java rename to src/main/java/com/merge/api/ticketing/types/CommentContact.java index 0c2f2b525..e90ea1090 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentContact.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CommentContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CommentContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentEndpointRequest.java b/src/main/java/com/merge/api/ticketing/types/CommentEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentEndpointRequest.java rename to src/main/java/com/merge/api/ticketing/types/CommentEndpointRequest.java index 60d1b498d..0abe00395 100644 --- a/src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentEndpointRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.comments.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.types.CommentRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequest.java b/src/main/java/com/merge/api/ticketing/types/CommentRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentRequest.java rename to src/main/java/com/merge/api/ticketing/types/CommentRequest.java index 50f7097d9..02e2bf2f1 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequestContact.java b/src/main/java/com/merge/api/ticketing/types/CommentRequestContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentRequestContact.java rename to src/main/java/com/merge/api/ticketing/types/CommentRequestContact.java index 7cb442d9c..3664fccaa 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequestContact.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentRequestContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CommentRequestContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CommentRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequestTicket.java b/src/main/java/com/merge/api/ticketing/types/CommentRequestTicket.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentRequestTicket.java rename to src/main/java/com/merge/api/ticketing/types/CommentRequestTicket.java index 45ead0263..fa361d4db 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequestTicket.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentRequestTicket.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CommentRequestTicket deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CommentRequestTicket deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequestUser.java b/src/main/java/com/merge/api/ticketing/types/CommentRequestUser.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentRequestUser.java rename to src/main/java/com/merge/api/ticketing/types/CommentRequestUser.java index a3b6fbe1e..51760f51d 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentRequestUser.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentRequestUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CommentRequestUser deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CommentRequestUser deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentResponse.java b/src/main/java/com/merge/api/ticketing/types/CommentResponse.java similarity index 99% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentResponse.java rename to src/main/java/com/merge/api/ticketing/types/CommentResponse.java index 22851e95c..3d31603c5 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentResponse.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentResponse.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentTicket.java b/src/main/java/com/merge/api/ticketing/types/CommentTicket.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentTicket.java rename to src/main/java/com/merge/api/ticketing/types/CommentTicket.java index 04c55f206..ae6809b33 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentTicket.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentTicket.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CommentTicket deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CommentTicket deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/CommentUser.java b/src/main/java/com/merge/api/ticketing/types/CommentUser.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/CommentUser.java rename to src/main/java/com/merge/api/ticketing/types/CommentUser.java index a96797f14..a61c197e8 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/CommentUser.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public CommentUser deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public CommentUser deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentsListRequest.java b/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentsListRequest.java rename to src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java index f6618f46c..9781112d9 100644 --- a/src/main/java/com/merge/api/resources/ticketing/comments/requests/CommentsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.comments.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,9 +12,10 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.comments.types.CommentsListRequestExpand; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,14 +23,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CommentsListRequest.Builder.class) public final class CommentsListRequest { + private final Optional> expand; + private final Optional createdAfter; private final Optional createdBefore; private final Optional cursor; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -51,10 +52,10 @@ public final class CommentsListRequest { private final Map additionalProperties; private CommentsListRequest( + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -65,10 +66,10 @@ private CommentsListRequest( Optional remoteId, Optional ticketId, Map additionalProperties) { + this.expand = expand; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -81,6 +82,14 @@ private CommentsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -105,14 +114,6 @@ public Optional getCursor() { return cursor; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -197,10 +198,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(CommentsListRequest other) { - return createdAfter.equals(other.createdAfter) + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -215,10 +216,10 @@ private boolean equalTo(CommentsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.createdAfter, this.createdBefore, this.cursor, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -241,14 +242,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); private Optional cursor = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -273,10 +274,10 @@ public static final class Builder { private Builder() {} public Builder from(CommentsListRequest other) { + expand(other.getExpand()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -289,6 +290,22 @@ public Builder from(CommentsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CommentsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) public Builder createdAfter(Optional createdAfter) { this.createdAfter = createdAfter; @@ -322,17 +339,6 @@ public Builder cursor(String cursor) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(CommentsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -434,10 +440,10 @@ public Builder ticketId(String ticketId) { public CommentsListRequest build() { return new CommentsListRequest( + expand, createdAfter, createdBefore, cursor, - expand, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ticketing/types/CommentsListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/CommentsListRequestExpandItem.java new file mode 100644 index 000000000..cf96718e9 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CommentsListRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CommentsListRequestExpandItem { + CONTACT("contact"), + + TICKET("ticket"), + + USER("user"); + + private final String value; + + CommentsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CommentsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/CommentsRetrieveRequest.java new file mode 100644 index 000000000..e4b819884 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CommentsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommentsRetrieveRequest.Builder.class) +public final class CommentsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private CommentsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommentsRetrieveRequest && equalTo((CommentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommentsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommentsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(CommentsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public CommentsRetrieveRequest build() { + return new CommentsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CommentsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/CommentsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..d9bb981fd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CommentsRetrieveRequestExpandItem.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CommentsRetrieveRequestExpandItem { + CONTACT("contact"), + + TICKET("ticket"), + + USER("user"); + + private final String value; + + CommentsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/ticketing/types/CommonModelScopeApi.java new file mode 100644 index 000000000..c40b3db83 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CommonModelScopeApi.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/ticketing/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..6e99b2bf9 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + this.disabledFields.addAll(disabledFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + this.enabledActions.addAll(enabledActions); + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Contact.java b/src/main/java/com/merge/api/ticketing/types/Contact.java new file mode 100644 index 000000000..50cc1f457 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/Contact.java @@ -0,0 +1,416 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Contact.Builder.class) +public final class Contact { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional emailAddress; + + private final Optional phoneNumber; + + private final Optional details; + + private final Optional account; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Contact( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional emailAddress, + Optional phoneNumber, + Optional details, + Optional account, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.details = details; + this.account = account; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The contact's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The contact's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The contact's phone number. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return The contact's details. + */ + @JsonProperty("details") + public Optional getDetails() { + return details; + } + + /** + * @return The contact's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Contact && equalTo((Contact) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Contact other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && emailAddress.equals(other.emailAddress) + && phoneNumber.equals(other.phoneNumber) + && details.equals(other.details) + && account.equals(other.account) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.emailAddress, + this.phoneNumber, + this.details, + this.account, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional details = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Contact other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + emailAddress(other.getEmailAddress()); + phoneNumber(other.getPhoneNumber()); + details(other.getDetails()); + account(other.getAccount()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public Builder details(Optional details) { + this.details = details; + return this; + } + + public Builder details(String details) { + this.details = Optional.ofNullable(details); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ContactAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Contact build() { + return new Contact( + id, + remoteId, + createdAt, + modifiedAt, + name, + emailAddress, + phoneNumber, + details, + account, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ContactAccount.java b/src/main/java/com/merge/api/ticketing/types/ContactAccount.java new file mode 100644 index 000000000..d7a2c500d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ContactAccount.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactAccount.Deserializer.class) +public final class ContactAccount { + private final Object value; + + private final int type; + + private ContactAccount(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Account) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactAccount && equalTo((ContactAccount) other); + } + + private boolean equalTo(ContactAccount other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactAccount of(String value) { + return new ContactAccount(value, 0); + } + + public static ContactAccount of(Account value) { + return new ContactAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactAccount.class); + } + + @java.lang.Override + public ContactAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ContactRequest.java b/src/main/java/com/merge/api/ticketing/types/ContactRequest.java new file mode 100644 index 000000000..9787a4bcf --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ContactRequest.java @@ -0,0 +1,272 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactRequest.Builder.class) +public final class ContactRequest { + private final Optional name; + + private final Optional emailAddress; + + private final Optional phoneNumber; + + private final Optional details; + + private final Optional account; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private ContactRequest( + Optional name, + Optional emailAddress, + Optional phoneNumber, + Optional details, + Optional account, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.name = name; + this.emailAddress = emailAddress; + this.phoneNumber = phoneNumber; + this.details = details; + this.account = account; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The contact's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The contact's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The contact's phone number. + */ + @JsonProperty("phone_number") + public Optional getPhoneNumber() { + return phoneNumber; + } + + /** + * @return The contact's details. + */ + @JsonProperty("details") + public Optional getDetails() { + return details; + } + + /** + * @return The contact's account. + */ + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequest && equalTo((ContactRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactRequest other) { + return name.equals(other.name) + && emailAddress.equals(other.emailAddress) + && phoneNumber.equals(other.phoneNumber) + && details.equals(other.details) + && account.equals(other.account) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.emailAddress, + this.phoneNumber, + this.details, + this.account, + this.integrationParams, + this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional details = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactRequest other) { + name(other.getName()); + emailAddress(other.getEmailAddress()); + phoneNumber(other.getPhoneNumber()); + details(other.getDetails()); + account(other.getAccount()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public Builder phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + public Builder phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public Builder details(Optional details) { + this.details = details; + return this; + } + + public Builder details(String details) { + this.details = Optional.ofNullable(details); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ContactRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public ContactRequest build() { + return new ContactRequest( + name, + emailAddress, + phoneNumber, + details, + account, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ContactRequestAccount.java b/src/main/java/com/merge/api/ticketing/types/ContactRequestAccount.java new file mode 100644 index 000000000..743344fd1 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ContactRequestAccount.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactRequestAccount.Deserializer.class) +public final class ContactRequestAccount { + private final Object value; + + private final int type; + + private ContactRequestAccount(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Account) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequestAccount && equalTo((ContactRequestAccount) other); + } + + private boolean equalTo(ContactRequestAccount other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactRequestAccount of(String value) { + return new ContactRequestAccount(value, 0); + } + + public static ContactRequestAccount of(Account value) { + return new ContactRequestAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactRequestAccount.class); + } + + @java.lang.Override + public ContactRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java b/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java new file mode 100644 index 000000000..9dc65f9c4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java @@ -0,0 +1,401 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsListRequest.Builder.class) +public final class ContactsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private ContactsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsListRequest && equalTo((ContactsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public ContactsListRequest build() { + return new ContactsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequest.java new file mode 100644 index 000000000..7b83f12e4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsRetrieveRequest.Builder.class) +public final class ContactsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ContactsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsRetrieveRequest && equalTo((ContactsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ContactsRetrieveRequest build() { + return new ContactsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/ticketing/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..f84de46ac --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CreateFieldMappingRequest.java @@ -0,0 +1,348 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final String targetFieldName; + + private final String targetFieldDescription; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + String targetFieldName, + String targetFieldDescription, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return The name of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_name") + public String getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. + */ + @JsonProperty("target_field_description") + public String getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.targetFieldName, + this.targetFieldDescription, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TargetFieldNameStage builder() { + return new Builder(); + } + + public interface TargetFieldNameStage { + TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName); + + Builder from(CreateFieldMappingRequest other); + } + + public interface TargetFieldDescriptionStage { + RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription); + } + + public interface RemoteMethodStage { + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + } + + public interface RemoteUrlPathStage { + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements TargetFieldNameStage, + TargetFieldDescriptionStage, + RemoteMethodStage, + RemoteUrlPathStage, + CommonModelNameStage, + _FinalStage { + private String targetFieldName; + + private String targetFieldDescription; + + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + return this; + } + + /** + *

The name of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_name") + public TargetFieldDescriptionStage targetFieldName(@NotNull String targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

The description of the target field you want this remote field to map to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("target_field_description") + public RemoteMethodStage targetFieldDescription(@NotNull String targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

The method of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

The path of the remote endpoint where the remote field is coming from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

The name of the Common Model that the remote field corresponds to in a given category.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + return this; + } + + /** + *

If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + targetFieldName, + targetFieldDescription, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/ticketing/types/DataPassthroughRequest.java new file mode 100644 index 000000000..99cf3172a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/DataPassthroughRequest.java @@ -0,0 +1,371 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final MethodEnum method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + MethodEnum method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public MethodEnum getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull MethodEnum method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + _FinalStage data(Optional data); + + _FinalStage data(String data); + + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(RequestFormatEnum requestFormat); + + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private MethodEnum method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull MethodEnum method) { + this.method = method; + return this; + } + + /** + *

The path of the request in the third party's platform.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

Optional. If true, the response will always be an object of the form {"type": T, "value": ...} where T will be one of string, boolean, number, null, array, object.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(RequestFormatEnum requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

The headers to use for the request (Merge will handle the account's authorization headers). Content-Type header is required for passthrough. Choose content type corresponding to expected format of receiving server.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

The data with the request. You must include a request_format parameter matching the data's format

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

An optional override of the third party's base url for the request.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/DebugModeLog.java b/src/main/java/com/merge/api/ticketing/types/DebugModeLog.java new file mode 100644 index 000000000..9fc124384 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/ticketing/types/DebugModelLogSummary.java new file mode 100644 index 000000000..ff095be29 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/ticketing/types/EnabledActionsEnum.java new file mode 100644 index 000000000..00191b8f5 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/EnabledActionsEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EnabledActionsEnum { + READ("READ"), + + WRITE("WRITE"); + + private final String value; + + EnabledActionsEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/EncodingEnum.java b/src/main/java/com/merge/api/ticketing/types/EncodingEnum.java new file mode 100644 index 000000000..599144d9d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/EncodingEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EncodingEnum { + RAW("RAW"), + + BASE_64("BASE64"), + + GZIP_BASE_64("GZIP_BASE64"); + + private final String value; + + EncodingEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/ticketing/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..2825849bb --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/EndUserDetailsRequest.java @@ -0,0 +1,607 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + _FinalStage language(Optional language); + + _FinalStage language(LanguageEnum language); + + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + return this; + } + + /** + *

Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

Your end user's organization.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

A JSON object containing integration-specific configuration options.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

The boolean that indicates whether initial, periodic, and force syncs will be disabled.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

The following subset of IETF language tags can be used to configure localization.

+ *
    + *
  • en - en
  • + *
  • de - de
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(LanguageEnum language) { + this.language = Optional.ofNullable(language); + return this; + } + + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + this.categories.addAll(categories); + return this; + } + + /** + *

The integration categories to show in Merge Link.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + this.categories.addAll(categories); + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/ticketing/types/ErrorValidationProblem.java new file mode 100644 index 000000000..adf75cf04 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ErrorValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/EventTypeEnum.java b/src/main/java/com/merge/api/ticketing/types/EventTypeEnum.java new file mode 100644 index 000000000..c9b6cf826 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/EventTypeEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum EventTypeEnum { + CREATED_REMOTE_PRODUCTION_API_KEY("CREATED_REMOTE_PRODUCTION_API_KEY"), + + DELETED_REMOTE_PRODUCTION_API_KEY("DELETED_REMOTE_PRODUCTION_API_KEY"), + + CREATED_TEST_API_KEY("CREATED_TEST_API_KEY"), + + DELETED_TEST_API_KEY("DELETED_TEST_API_KEY"), + + REGENERATED_PRODUCTION_API_KEY("REGENERATED_PRODUCTION_API_KEY"), + + INVITED_USER("INVITED_USER"), + + TWO_FACTOR_AUTH_ENABLED("TWO_FACTOR_AUTH_ENABLED"), + + TWO_FACTOR_AUTH_DISABLED("TWO_FACTOR_AUTH_DISABLED"), + + DELETED_LINKED_ACCOUNT("DELETED_LINKED_ACCOUNT"), + + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT("DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"), + + CREATED_DESTINATION("CREATED_DESTINATION"), + + DELETED_DESTINATION("DELETED_DESTINATION"), + + CHANGED_DESTINATION("CHANGED_DESTINATION"), + + CHANGED_SCOPES("CHANGED_SCOPES"), + + CHANGED_PERSONAL_INFORMATION("CHANGED_PERSONAL_INFORMATION"), + + CHANGED_ORGANIZATION_SETTINGS("CHANGED_ORGANIZATION_SETTINGS"), + + ENABLED_INTEGRATION("ENABLED_INTEGRATION"), + + DISABLED_INTEGRATION("DISABLED_INTEGRATION"), + + ENABLED_CATEGORY("ENABLED_CATEGORY"), + + DISABLED_CATEGORY("DISABLED_CATEGORY"), + + CHANGED_PASSWORD("CHANGED_PASSWORD"), + + RESET_PASSWORD("RESET_PASSWORD"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION("DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"), + + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT("DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"), + + CREATED_INTEGRATION_WIDE_FIELD_MAPPING("CREATED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_FIELD_MAPPING("CREATED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING("CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"), + + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING("CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"), + + DELETED_INTEGRATION_WIDE_FIELD_MAPPING("DELETED_INTEGRATION_WIDE_FIELD_MAPPING"), + + DELETED_LINKED_ACCOUNT_FIELD_MAPPING("DELETED_LINKED_ACCOUNT_FIELD_MAPPING"), + + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE("DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"), + + FORCED_LINKED_ACCOUNT_RESYNC("FORCED_LINKED_ACCOUNT_RESYNC"), + + MUTED_ISSUE("MUTED_ISSUE"), + + GENERATED_MAGIC_LINK("GENERATED_MAGIC_LINK"), + + ENABLED_MERGE_WEBHOOK("ENABLED_MERGE_WEBHOOK"), + + DISABLED_MERGE_WEBHOOK("DISABLED_MERGE_WEBHOOK"), + + MERGE_WEBHOOK_TARGET_CHANGED("MERGE_WEBHOOK_TARGET_CHANGED"), + + END_USER_CREDENTIALS_ACCESSED("END_USER_CREDENTIALS_ACCESSED"); + + private final String value; + + EventTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..ddb62b833 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..e34ae9a56 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> ticket; + + private final Optional> comment; + + private final Optional> project; + + private final Optional> collection; + + private final Optional> user; + + private final Optional> role; + + private final Optional> account; + + private final Optional> team; + + private final Optional> attachment; + + private final Optional> tag; + + private final Optional> contact; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> ticket, + Optional> comment, + Optional> project, + Optional> collection, + Optional> user, + Optional> role, + Optional> account, + Optional> team, + Optional> attachment, + Optional> tag, + Optional> contact, + Map additionalProperties) { + this.ticket = ticket; + this.comment = comment; + this.project = project; + this.collection = collection; + this.user = user; + this.role = role; + this.account = account; + this.team = team; + this.attachment = attachment; + this.tag = tag; + this.contact = contact; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Ticket") + public Optional> getTicket() { + return ticket; + } + + @JsonProperty("Comment") + public Optional> getComment() { + return comment; + } + + @JsonProperty("Project") + public Optional> getProject() { + return project; + } + + @JsonProperty("Collection") + public Optional> getCollection() { + return collection; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Role") + public Optional> getRole() { + return role; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("Team") + public Optional> getTeam() { + return team; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("Tag") + public Optional> getTag() { + return tag; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return ticket.equals(other.ticket) + && comment.equals(other.comment) + && project.equals(other.project) + && collection.equals(other.collection) + && user.equals(other.user) + && role.equals(other.role) + && account.equals(other.account) + && team.equals(other.team) + && attachment.equals(other.attachment) + && tag.equals(other.tag) + && contact.equals(other.contact); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.ticket, + this.comment, + this.project, + this.collection, + this.user, + this.role, + this.account, + this.team, + this.attachment, + this.tag, + this.contact); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> ticket = Optional.empty(); + + private Optional> comment = Optional.empty(); + + private Optional> project = Optional.empty(); + + private Optional> collection = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> role = Optional.empty(); + + private Optional> account = Optional.empty(); + + private Optional> team = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> tag = Optional.empty(); + + private Optional> contact = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + ticket(other.getTicket()); + comment(other.getComment()); + project(other.getProject()); + collection(other.getCollection()); + user(other.getUser()); + role(other.getRole()); + account(other.getAccount()); + team(other.getTeam()); + attachment(other.getAttachment()); + tag(other.getTag()); + contact(other.getContact()); + return this; + } + + @JsonSetter(value = "Ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional> ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(List ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + @JsonSetter(value = "Comment", nulls = Nulls.SKIP) + public Builder comment(Optional> comment) { + this.comment = comment; + return this; + } + + public Builder comment(List comment) { + this.comment = Optional.ofNullable(comment); + return this; + } + + @JsonSetter(value = "Project", nulls = Nulls.SKIP) + public Builder project(Optional> project) { + this.project = project; + return this; + } + + public Builder project(List project) { + this.project = Optional.ofNullable(project); + return this; + } + + @JsonSetter(value = "Collection", nulls = Nulls.SKIP) + public Builder collection(Optional> collection) { + this.collection = collection; + return this; + } + + public Builder collection(List collection) { + this.collection = Optional.ofNullable(collection); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Role", nulls = Nulls.SKIP) + public Builder role(Optional> role) { + this.role = role; + return this; + } + + public Builder role(List role) { + this.role = Optional.ofNullable(role); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "Team", nulls = Nulls.SKIP) + public Builder team(Optional> team) { + this.team = team; + return this; + } + + public Builder team(List team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "Tag", nulls = Nulls.SKIP) + public Builder tag(Optional> tag) { + this.tag = tag; + return this; + } + + public Builder tag(List tag) { + this.tag = Optional.ofNullable(tag); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse( + ticket, + comment, + project, + collection, + user, + role, + account, + team, + attachment, + tag, + contact, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldFormatEnum.java b/src/main/java/com/merge/api/ticketing/types/FieldFormatEnum.java new file mode 100644 index 000000000..8b1fc1471 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FieldFormatEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + FieldFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..825fd55bc --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..72437f505 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..dbb8a2329 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..8c4f04689 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> ticket; + + private final Optional> comment; + + private final Optional> project; + + private final Optional> collection; + + private final Optional> user; + + private final Optional> role; + + private final Optional> account; + + private final Optional> team; + + private final Optional> attachment; + + private final Optional> tag; + + private final Optional> contact; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> ticket, + Optional> comment, + Optional> project, + Optional> collection, + Optional> user, + Optional> role, + Optional> account, + Optional> team, + Optional> attachment, + Optional> tag, + Optional> contact, + Map additionalProperties) { + this.ticket = ticket; + this.comment = comment; + this.project = project; + this.collection = collection; + this.user = user; + this.role = role; + this.account = account; + this.team = team; + this.attachment = attachment; + this.tag = tag; + this.contact = contact; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Ticket") + public Optional> getTicket() { + return ticket; + } + + @JsonProperty("Comment") + public Optional> getComment() { + return comment; + } + + @JsonProperty("Project") + public Optional> getProject() { + return project; + } + + @JsonProperty("Collection") + public Optional> getCollection() { + return collection; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Role") + public Optional> getRole() { + return role; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("Team") + public Optional> getTeam() { + return team; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("Tag") + public Optional> getTag() { + return tag; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return ticket.equals(other.ticket) + && comment.equals(other.comment) + && project.equals(other.project) + && collection.equals(other.collection) + && user.equals(other.user) + && role.equals(other.role) + && account.equals(other.account) + && team.equals(other.team) + && attachment.equals(other.attachment) + && tag.equals(other.tag) + && contact.equals(other.contact); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.ticket, + this.comment, + this.project, + this.collection, + this.user, + this.role, + this.account, + this.team, + this.attachment, + this.tag, + this.contact); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> ticket = Optional.empty(); + + private Optional> comment = Optional.empty(); + + private Optional> project = Optional.empty(); + + private Optional> collection = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> role = Optional.empty(); + + private Optional> account = Optional.empty(); + + private Optional> team = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> tag = Optional.empty(); + + private Optional> contact = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + ticket(other.getTicket()); + comment(other.getComment()); + project(other.getProject()); + collection(other.getCollection()); + user(other.getUser()); + role(other.getRole()); + account(other.getAccount()); + team(other.getTeam()); + attachment(other.getAttachment()); + tag(other.getTag()); + contact(other.getContact()); + return this; + } + + @JsonSetter(value = "Ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional> ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(List ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + @JsonSetter(value = "Comment", nulls = Nulls.SKIP) + public Builder comment(Optional> comment) { + this.comment = comment; + return this; + } + + public Builder comment(List comment) { + this.comment = Optional.ofNullable(comment); + return this; + } + + @JsonSetter(value = "Project", nulls = Nulls.SKIP) + public Builder project(Optional> project) { + this.project = project; + return this; + } + + public Builder project(List project) { + this.project = Optional.ofNullable(project); + return this; + } + + @JsonSetter(value = "Collection", nulls = Nulls.SKIP) + public Builder collection(Optional> collection) { + this.collection = collection; + return this; + } + + public Builder collection(List collection) { + this.collection = Optional.ofNullable(collection); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Role", nulls = Nulls.SKIP) + public Builder role(Optional> role) { + this.role = role; + return this; + } + + public Builder role(List role) { + this.role = Optional.ofNullable(role); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "Team", nulls = Nulls.SKIP) + public Builder team(Optional> team) { + this.team = team; + return this; + } + + public Builder team(List team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "Tag", nulls = Nulls.SKIP) + public Builder tag(Optional> tag) { + this.tag = tag; + return this; + } + + public Builder tag(List tag) { + this.tag = Optional.ofNullable(tag); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse( + ticket, + comment, + project, + collection, + user, + role, + account, + team, + attachment, + tag, + contact, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..8468a7c97 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..e0a3d2cd7 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingInstanceResponse.java @@ -0,0 +1,216 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + this.errors.addAll(errors); + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + this.warnings.addAll(warnings); + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..acb167de6 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return If true, remote fields metadata is excluded from each field mapping instance (i.e. remote_fields.remote_key_name and remote_fields.schema will be null). This will increase the speed of the request since these fields require some calculations. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/ticketing/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..129e71422 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/ticketing/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..a0c57dc8f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldTypeEnum.java b/src/main/java/com/merge/api/ticketing/types/FieldTypeEnum.java new file mode 100644 index 000000000..98f475a38 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum FieldTypeEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + FieldTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/ticketing/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..ce9c93510 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/ticketing/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..891f5a3df --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..632fb6b8e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Issue.java b/src/main/java/com/merge/api/ticketing/types/Issue.java new file mode 100644 index 000000000..3d62cc513 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/Issue.java @@ -0,0 +1,351 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + _FinalStage status(Optional status); + + _FinalStage status(IssueStatusEnum status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

Status of the issue. Options: ('ONGOING', 'RESOLVED')

+ *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatusEnum status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/IssueStatusEnum.java b/src/main/java/com/merge/api/ticketing/types/IssueStatusEnum.java new file mode 100644 index 000000000..14ffba2bd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/IssueStatusEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssueStatusEnum { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssueStatusEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java b/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java new file mode 100644 index 000000000..01195a24a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java @@ -0,0 +1,476 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. Options: ('ONGOING', 'RESOLVED') + *
    + *
  • ONGOING - ONGOING
  • + *
  • RESOLVED - RESOLVED
  • + *
+ */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/ticketing/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..6a6838821 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/IssuesListRequestStatus.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum IssuesListRequestStatus { + ONGOING("ONGOING"), + + RESOLVED("RESOLVED"); + + private final String value; + + IssuesListRequestStatus(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ItemFormatEnum.java b/src/main/java/com/merge/api/ticketing/types/ItemFormatEnum.java new file mode 100644 index 000000000..cb6dc1f59 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ItemFormatEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemFormatEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + ItemFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ItemSchema.java b/src/main/java/com/merge/api/ticketing/types/ItemSchema.java new file mode 100644 index 000000000..0b83f41e5 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ItemSchema.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemSchema.Builder.class) +public final class ItemSchema { + private final Optional itemType; + + private final Optional itemFormat; + + private final Optional> itemChoices; + + private final Map additionalProperties; + + private ItemSchema( + Optional itemType, + Optional itemFormat, + Optional> itemChoices, + Map additionalProperties) { + this.itemType = itemType; + this.itemFormat = itemFormat; + this.itemChoices = itemChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("item_type") + public Optional getItemType() { + return itemType; + } + + @JsonProperty("item_format") + public Optional getItemFormat() { + return itemFormat; + } + + @JsonProperty("item_choices") + public Optional> getItemChoices() { + return itemChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemSchema && equalTo((ItemSchema) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemSchema other) { + return itemType.equals(other.itemType) + && itemFormat.equals(other.itemFormat) + && itemChoices.equals(other.itemChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemType, this.itemFormat, this.itemChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional itemType = Optional.empty(); + + private Optional itemFormat = Optional.empty(); + + private Optional> itemChoices = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemSchema other) { + itemType(other.getItemType()); + itemFormat(other.getItemFormat()); + itemChoices(other.getItemChoices()); + return this; + } + + @JsonSetter(value = "item_type", nulls = Nulls.SKIP) + public Builder itemType(Optional itemType) { + this.itemType = itemType; + return this; + } + + public Builder itemType(ItemTypeEnum itemType) { + this.itemType = Optional.ofNullable(itemType); + return this; + } + + @JsonSetter(value = "item_format", nulls = Nulls.SKIP) + public Builder itemFormat(Optional itemFormat) { + this.itemFormat = itemFormat; + return this; + } + + public Builder itemFormat(ItemFormatEnum itemFormat) { + this.itemFormat = Optional.ofNullable(itemFormat); + return this; + } + + @JsonSetter(value = "item_choices", nulls = Nulls.SKIP) + public Builder itemChoices(Optional> itemChoices) { + this.itemChoices = itemChoices; + return this; + } + + public Builder itemChoices(List itemChoices) { + this.itemChoices = Optional.ofNullable(itemChoices); + return this; + } + + public ItemSchema build() { + return new ItemSchema(itemType, itemFormat, itemChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ItemTypeEnum.java b/src/main/java/com/merge/api/ticketing/types/ItemTypeEnum.java new file mode 100644 index 000000000..e618ed5b3 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ItemTypeEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ItemTypeEnum { + STRING("string"), + + NUMBER("number"), + + DATE("date"), + + DATETIME("datetime"), + + BOOL("bool"), + + LIST("list"); + + private final String value; + + ItemTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/LanguageEnum.java b/src/main/java/com/merge/api/ticketing/types/LanguageEnum.java new file mode 100644 index 000000000..f78055ff2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/LanguageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LanguageEnum { + EN("en"), + + DE("de"); + + private final String value; + + LanguageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/LastSyncResultEnum.java b/src/main/java/com/merge/api/ticketing/types/LastSyncResultEnum.java new file mode 100644 index 000000000..066c9067e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/LastSyncResultEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LastSyncResultEnum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + LastSyncResultEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/LinkToken.java b/src/main/java/com/merge/api/ticketing/types/LinkToken.java new file mode 100644 index 000000000..af893fcf4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/LinkToken.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkToken.Builder.class) +public final class LinkToken { + private final String linkToken; + + private final Optional integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/ticketing/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..0b609d9a7 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + this.commonModels.addAll(commonModels); + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + this.commonModels.addAll(commonModels); + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/LinkedAccountStatus.java b/src/main/java/com/merge/api/ticketing/types/LinkedAccountStatus.java new file mode 100644 index 000000000..bacbbf2e9 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/LinkedAccountStatus.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountStatus.Builder.class) +public final class LinkedAccountStatus { + private final String linkedAccountStatus; + + private final boolean canMakeRequest; + + private final Map additionalProperties; + + private LinkedAccountStatus( + String linkedAccountStatus, boolean canMakeRequest, Map additionalProperties) { + this.linkedAccountStatus = linkedAccountStatus; + this.canMakeRequest = canMakeRequest; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_status") + public String getLinkedAccountStatus() { + return linkedAccountStatus; + } + + @JsonProperty("can_make_request") + public boolean getCanMakeRequest() { + return canMakeRequest; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountStatus && equalTo((LinkedAccountStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountStatus other) { + return linkedAccountStatus.equals(other.linkedAccountStatus) && canMakeRequest == other.canMakeRequest; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountStatus, this.canMakeRequest); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountStatusStage builder() { + return new Builder(); + } + + public interface LinkedAccountStatusStage { + CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus); + + Builder from(LinkedAccountStatus other); + } + + public interface CanMakeRequestStage { + _FinalStage canMakeRequest(boolean canMakeRequest); + } + + public interface _FinalStage { + LinkedAccountStatus build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountStatusStage, CanMakeRequestStage, _FinalStage { + private String linkedAccountStatus; + + private boolean canMakeRequest; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkedAccountStatus other) { + linkedAccountStatus(other.getLinkedAccountStatus()); + canMakeRequest(other.getCanMakeRequest()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_status") + public CanMakeRequestStage linkedAccountStatus(@NotNull String linkedAccountStatus) { + this.linkedAccountStatus = linkedAccountStatus; + return this; + } + + @java.lang.Override + @JsonSetter("can_make_request") + public _FinalStage canMakeRequest(boolean canMakeRequest) { + this.canMakeRequest = canMakeRequest; + return this; + } + + @java.lang.Override + public LinkedAccountStatus build() { + return new LinkedAccountStatus(linkedAccountStatus, canMakeRequest, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..b9cc20139 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java @@ -0,0 +1,457 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing + *
    + *
  • hris - hris
  • + *
  • ats - ats
  • + *
  • accounting - accounting
  • + *
  • ticketing - ticketing
  • + *
  • crm - crm
  • + *
  • mktg - mktg
  • + *
  • filestorage - filestorage
  • + *
+ */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return If true, will include complete production duplicates of the account specified by the id query parameter in the response. id must be for a complete production linked account. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..088ff407d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum LinkedAccountsListRequestCategory { + ACCOUNTING("accounting"), + + ATS("ats"), + + CRM("crm"), + + FILESTORAGE("filestorage"), + + HRIS("hris"), + + MKTG("mktg"), + + TICKETING("ticketing"); + + private final String value; + + LinkedAccountsListRequestCategory(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/MetaResponse.java b/src/main/java/com/merge/api/ticketing/types/MetaResponse.java new file mode 100644 index 000000000..70da0ec5e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/MetaResponse.java @@ -0,0 +1,242 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MetaResponse.Builder.class) +public final class MetaResponse { + private final Map requestSchema; + + private final Optional> remoteFieldClasses; + + private final Optional status; + + private final boolean hasConditionalParams; + + private final boolean hasRequiredLinkedAccountParams; + + private final Map additionalProperties; + + private MetaResponse( + Map requestSchema, + Optional> remoteFieldClasses, + Optional status, + boolean hasConditionalParams, + boolean hasRequiredLinkedAccountParams, + Map additionalProperties) { + this.requestSchema = requestSchema; + this.remoteFieldClasses = remoteFieldClasses; + this.status = status; + this.hasConditionalParams = hasConditionalParams; + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("request_schema") + public Map getRequestSchema() { + return requestSchema; + } + + @JsonProperty("remote_field_classes") + public Optional> getRemoteFieldClasses() { + return remoteFieldClasses; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("has_conditional_params") + public boolean getHasConditionalParams() { + return hasConditionalParams; + } + + @JsonProperty("has_required_linked_account_params") + public boolean getHasRequiredLinkedAccountParams() { + return hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MetaResponse && equalTo((MetaResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MetaResponse other) { + return requestSchema.equals(other.requestSchema) + && remoteFieldClasses.equals(other.remoteFieldClasses) + && status.equals(other.status) + && hasConditionalParams == other.hasConditionalParams + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.requestSchema, + this.remoteFieldClasses, + this.status, + this.hasConditionalParams, + this.hasRequiredLinkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasConditionalParamsStage builder() { + return new Builder(); + } + + public interface HasConditionalParamsStage { + HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams); + + Builder from(MetaResponse other); + } + + public interface HasRequiredLinkedAccountParamsStage { + _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams); + } + + public interface _FinalStage { + MetaResponse build(); + + _FinalStage requestSchema(Map requestSchema); + + _FinalStage putAllRequestSchema(Map requestSchema); + + _FinalStage requestSchema(String key, JsonNode value); + + _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); + + _FinalStage remoteFieldClasses(Map remoteFieldClasses); + + _FinalStage status(Optional status); + + _FinalStage status(LinkedAccountStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements HasConditionalParamsStage, HasRequiredLinkedAccountParamsStage, _FinalStage { + private boolean hasConditionalParams; + + private boolean hasRequiredLinkedAccountParams; + + private Optional status = Optional.empty(); + + private Optional> remoteFieldClasses = Optional.empty(); + + private Map requestSchema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MetaResponse other) { + requestSchema(other.getRequestSchema()); + remoteFieldClasses(other.getRemoteFieldClasses()); + status(other.getStatus()); + hasConditionalParams(other.getHasConditionalParams()); + hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + return this; + } + + @java.lang.Override + @JsonSetter("has_conditional_params") + public HasRequiredLinkedAccountParamsStage hasConditionalParams(boolean hasConditionalParams) { + this.hasConditionalParams = hasConditionalParams; + return this; + } + + @java.lang.Override + @JsonSetter("has_required_linked_account_params") + public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccountParams) { + this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + return this; + } + + @java.lang.Override + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { + this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) + public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { + this.remoteFieldClasses = remoteFieldClasses; + return this; + } + + @java.lang.Override + public _FinalStage requestSchema(String key, JsonNode value) { + this.requestSchema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllRequestSchema(Map requestSchema) { + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_schema", nulls = Nulls.SKIP) + public _FinalStage requestSchema(Map requestSchema) { + this.requestSchema.clear(); + this.requestSchema.putAll(requestSchema); + return this; + } + + @java.lang.Override + public MetaResponse build() { + return new MetaResponse( + requestSchema, + remoteFieldClasses, + status, + hasConditionalParams, + hasRequiredLinkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/MethodEnum.java b/src/main/java/com/merge/api/ticketing/types/MethodEnum.java new file mode 100644 index 000000000..dc751174f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/MethodEnum.java @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum MethodEnum { + GET("GET"), + + OPTIONS("OPTIONS"), + + HEAD("HEAD"), + + POST("POST"), + + PUT("PUT"), + + PATCH("PATCH"), + + DELETE("DELETE"); + + private final String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ModelOperation.java b/src/main/java/com/merge/api/ticketing/types/ModelOperation.java new file mode 100644 index 000000000..b7ec6f42e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ModelOperation.java @@ -0,0 +1,226 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + this.supportedFields.addAll(supportedFields); + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + this.requiredPostParameters.addAll(requiredPostParameters); + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + this.availableOperations.addAll(availableOperations); + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/ticketing/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..c2364faf2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/ticketing/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..55b0dc4ce --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/ticketing/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..d614dbb05 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/MultipartFormFieldRequest.java @@ -0,0 +1,265 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(EncodingEnum encoding); + + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

The name of the form field

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

The data for the form field.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

The MIME type of the file, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

The file name of the form field, if the field is for a file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

The encoding of the value of data. Defaults to RAW if not defined.

+ *
    + *
  • RAW - RAW
  • + *
  • BASE64 - BASE64
  • + *
  • GZIP_BASE64 - GZIP_BASE64
  • + *
+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(EncodingEnum encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..9180b252b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAccountList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountList.java new file mode 100644 index 000000000..e6ba43a4c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountList.Builder.class) +public final class PaginatedAccountList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountList && equalTo((PaginatedAccountList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountList build() { + return new PaginatedAccountList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAttachmentList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAttachmentList.java new file mode 100644 index 000000000..bfe038945 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAttachmentList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAttachmentList.Builder.class) +public final class PaginatedAttachmentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAttachmentList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAttachmentList && equalTo((PaginatedAttachmentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAttachmentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAttachmentList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAttachmentList build() { + return new PaginatedAttachmentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..aaab1bf15 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedCollectionList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedCollectionList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ticketing/types/PaginatedCollectionList.java rename to src/main/java/com/merge/api/ticketing/types/PaginatedCollectionList.java index f4508bdfa..ada40624f 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedCollectionList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedCollectionList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedCommentList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedCommentList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ticketing/types/PaginatedCommentList.java rename to src/main/java/com/merge/api/ticketing/types/PaginatedCommentList.java index d2aceba41..b3c662074 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedCommentList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedCommentList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedContactList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedContactList.java new file mode 100644 index 000000000..89905d6e8 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedContactList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedContactList.Builder.class) +public final class PaginatedContactList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedContactList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedContactList && equalTo((PaginatedContactList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedContactList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedContactList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedContactList build() { + return new PaginatedContactList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedIssueList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedIssueList.java new file mode 100644 index 000000000..854ea2aa2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedProjectList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedProjectList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ticketing/types/PaginatedProjectList.java rename to src/main/java/com/merge/api/ticketing/types/PaginatedProjectList.java index c8eda362e..93796a637 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedProjectList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedProjectList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedRemoteFieldClassList.java new file mode 100644 index 000000000..f7263883e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedRemoteFieldClassList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedRemoteFieldClassList.Builder.class) +public final class PaginatedRemoteFieldClassList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedRemoteFieldClassList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedRemoteFieldClassList && equalTo((PaginatedRemoteFieldClassList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedRemoteFieldClassList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedRemoteFieldClassList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedRemoteFieldClassList build() { + return new PaginatedRemoteFieldClassList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedRoleList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedRoleList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ticketing/types/PaginatedRoleList.java rename to src/main/java/com/merge/api/ticketing/types/PaginatedRoleList.java index 6d7afb396..8687b3868 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedRoleList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedRoleList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..9576b2625 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedTagList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedTagList.java new file mode 100644 index 000000000..9844ecc97 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedTagList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTagList.Builder.class) +public final class PaginatedTagList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTagList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTagList && equalTo((PaginatedTagList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTagList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedTagList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedTagList build() { + return new PaginatedTagList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedTeamList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedTeamList.java new file mode 100644 index 000000000..524c048bc --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedTeamList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedTeamList.Builder.class) +public final class PaginatedTeamList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedTeamList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedTeamList && equalTo((PaginatedTeamList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedTeamList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedTeamList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedTeamList build() { + return new PaginatedTeamList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTicketList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedTicketList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ticketing/types/PaginatedTicketList.java rename to src/main/java/com/merge/api/ticketing/types/PaginatedTicketList.java index 30691dd60..c73631887 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedTicketList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedTicketList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedUserList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedUserList.java new file mode 100644 index 000000000..8d677e8bf --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedUserList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedUserList.Builder.class) +public final class PaginatedUserList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedUserList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedUserList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedUserList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedUserList build() { + return new PaginatedUserList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedViewerList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedViewerList.java similarity index 98% rename from src/main/java/com/merge/api/resources/ticketing/types/PaginatedViewerList.java rename to src/main/java/com/merge/api/ticketing/types/PaginatedViewerList.java index 3f9f719ec..c3abc5e0d 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PaginatedViewerList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedViewerList.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ticketing/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/ticketing/types/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..92df80c23 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PatchedEditFieldMappingRequest.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) +public final class PatchedEditFieldMappingRequest { + private final Optional> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Map additionalProperties) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.additionalProperties = additionalProperties; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + return this; + } + + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/PatchedTicketEndpointRequest.java b/src/main/java/com/merge/api/ticketing/types/PatchedTicketEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/ticketing/tickets/requests/PatchedTicketEndpointRequest.java rename to src/main/java/com/merge/api/ticketing/types/PatchedTicketEndpointRequest.java index df7fa2a06..14659a290 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/PatchedTicketEndpointRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/PatchedTicketEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.types.PatchedTicketRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequest.java b/src/main/java/com/merge/api/ticketing/types/PatchedTicketRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequest.java rename to src/main/java/com/merge/api/ticketing/types/PatchedTicketRequest.java index 048a5ea7d..1ef72f1d3 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PatchedTicketRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/PatchedTicketRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class PatchedTicketRequest { private final Optional dueDate; - private final Optional status; + private final Optional status; private final Optional description; @@ -55,7 +55,7 @@ public final class PatchedTicketRequest { private final Optional ticketUrl; - private final Optional priority; + private final Optional priority; private final Optional> integrationParams; @@ -71,7 +71,7 @@ private PatchedTicketRequest( Optional>> assignedTeams, Optional creator, Optional dueDate, - Optional status, + Optional status, Optional description, Optional>> collections, Optional ticketType, @@ -82,7 +82,7 @@ private PatchedTicketRequest( Optional>> roles, Optional completedAt, Optional ticketUrl, - Optional priority, + Optional priority, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -119,7 +119,7 @@ public Optional getName() { } /** - * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. + * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. To fetch all Users and Teams that can access the ticket, use the GET /tickets/{ticket_id}/viewers endpoint. */ @JsonProperty("assignees") public Optional>> getAssignees() { @@ -127,7 +127,7 @@ public Optional>> getAssignees() { } /** - * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. + * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. To fetch all Users and Teams that can access this ticket, use the GET /tickets/{ticket_id}/viewers endpoint. */ @JsonProperty("assigned_teams") public Optional>> getAssignedTeams() { @@ -160,7 +160,7 @@ public Optional getDueDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -248,7 +248,7 @@ public Optional getTicketUrl() { * */ @JsonProperty("priority") - public Optional getPriority() { + public Optional getPriority() { return priority; } @@ -347,7 +347,7 @@ public static final class Builder { private Optional dueDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional description = Optional.empty(); @@ -369,7 +369,7 @@ public static final class Builder { private Optional ticketUrl = Optional.empty(); - private Optional priority = Optional.empty(); + private Optional priority = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -462,12 +462,12 @@ public Builder dueDate(OffsetDateTime dueDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(PatchedTicketRequestStatus status) { + public Builder status(TicketStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -583,12 +583,12 @@ public Builder ticketUrl(String ticketUrl) { } @JsonSetter(value = "priority", nulls = Nulls.SKIP) - public Builder priority(Optional priority) { + public Builder priority(Optional priority) { this.priority = priority; return this; } - public Builder priority(PatchedTicketRequestPriority priority) { + public Builder priority(PriorityEnum priority) { this.priority = Optional.ofNullable(priority); return this; } diff --git a/src/main/java/com/merge/api/resources/ticketing/types/PriorityEnum.java b/src/main/java/com/merge/api/ticketing/types/PriorityEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/ticketing/types/PriorityEnum.java rename to src/main/java/com/merge/api/ticketing/types/PriorityEnum.java index cc44cab8b..a50eedec2 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/PriorityEnum.java +++ b/src/main/java/com/merge/api/ticketing/types/PriorityEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Project.java b/src/main/java/com/merge/api/ticketing/types/Project.java similarity index 99% rename from src/main/java/com/merge/api/resources/ticketing/types/Project.java rename to src/main/java/com/merge/api/ticketing/types/Project.java index b7db013e6..7addef518 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/Project.java +++ b/src/main/java/com/merge/api/ticketing/types/Project.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsListRequest.java b/src/main/java/com/merge/api/ticketing/types/ProjectsListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsListRequest.java rename to src/main/java/com/merge/api/ticketing/types/ProjectsListRequest.java index 8a1adb53d..f2ac16fc2 100644 --- a/src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ProjectsListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.projects.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ticketing/types/ProjectsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/ProjectsRetrieveRequest.java new file mode 100644 index 000000000..cfc19bed9 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ProjectsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ProjectsRetrieveRequest.Builder.class) +public final class ProjectsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ProjectsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ProjectsRetrieveRequest && equalTo((ProjectsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ProjectsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ProjectsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ProjectsRetrieveRequest build() { + return new ProjectsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsUsersListRequest.java b/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequest.java similarity index 90% rename from src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsUsersListRequest.java rename to src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequest.java index 5e9a433e7..ee1bf3ed3 100644 --- a/src/main/java/com/merge/api/resources/ticketing/projects/requests/ProjectsUsersListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.projects.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.projects.types.ProjectsUsersListRequestExpand; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,9 +22,9 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProjectsUsersListRequest.Builder.class) public final class ProjectsUsersListRequest { - private final Optional cursor; + private final Optional> expand; - private final Optional expand; + private final Optional cursor; private final Optional includeDeletedData; @@ -36,15 +37,15 @@ public final class ProjectsUsersListRequest { private final Map additionalProperties; private ProjectsUsersListRequest( + Optional> expand, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; this.expand = expand; + this.cursor = cursor; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -53,19 +54,19 @@ private ProjectsUsersListRequest( } /** - * @return The pagination cursor value. + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; + @JsonProperty("expand") + public Optional> getExpand() { + return expand; } /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + * @return The pagination cursor value. */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; } /** @@ -112,8 +113,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(ProjectsUsersListRequest other) { - return cursor.equals(other.cursor) - && expand.equals(other.expand) + return expand.equals(other.expand) + && cursor.equals(other.cursor) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -123,8 +124,8 @@ private boolean equalTo(ProjectsUsersListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.cursor, this.expand, + this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -142,9 +143,9 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional cursor = Optional.empty(); + private Optional> expand = Optional.empty(); - private Optional expand = Optional.empty(); + private Optional cursor = Optional.empty(); private Optional includeDeletedData = Optional.empty(); @@ -160,8 +161,8 @@ public static final class Builder { private Builder() {} public Builder from(ProjectsUsersListRequest other) { - cursor(other.getCursor()); expand(other.getExpand()); + cursor(other.getCursor()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -169,25 +170,30 @@ public Builder from(ProjectsUsersListRequest other) { return this; } - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; return this; } - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; + public Builder expand(ProjectsUsersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); return this; } - public Builder expand(ProjectsUsersListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); return this; } @@ -237,8 +243,8 @@ public Builder pageSize(Integer pageSize) { public ProjectsUsersListRequest build() { return new ProjectsUsersListRequest( - cursor, expand, + cursor, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequestExpandItem.java new file mode 100644 index 000000000..3561ea796 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ProjectsUsersListRequestExpandItem { + ROLES("roles"), + + TEAMS("teams"); + + private final String value; + + ProjectsUsersListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteData.java b/src/main/java/com/merge/api/ticketing/types/RemoteData.java new file mode 100644 index 000000000..92e2f4a42 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteData.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

The third-party API path that is being called.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/ticketing/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..86c36e6f4 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteEndpointInfo.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + this.fieldTraversalPath.addAll(fieldTraversalPath); + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteField.java b/src/main/java/com/merge/api/ticketing/types/RemoteField.java new file mode 100644 index 000000000..7202b7c57 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteField.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteField.Builder.class) +public final class RemoteField { + private final RemoteFieldRemoteFieldClass remoteFieldClass; + + private final Optional value; + + private final Map additionalProperties; + + private RemoteField( + RemoteFieldRemoteFieldClass remoteFieldClass, + Optional value, + Map additionalProperties) { + this.remoteFieldClass = remoteFieldClass; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_field_class") + public RemoteFieldRemoteFieldClass getRemoteFieldClass() { + return remoteFieldClass; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteField && equalTo((RemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteField other) { + return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteFieldClassStage builder() { + return new Builder(); + } + + public interface RemoteFieldClassStage { + _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass); + + Builder from(RemoteField other); + } + + public interface _FinalStage { + RemoteField build(); + + _FinalStage value(Optional value); + + _FinalStage value(JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteFieldClassStage, _FinalStage { + private RemoteFieldRemoteFieldClass remoteFieldClass; + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteField other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @java.lang.Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public RemoteField build() { + return new RemoteField(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldApi.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApi.java new file mode 100644 index 000000000..d2cbe6b71 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApi.java @@ -0,0 +1,275 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + this.schema.putAll(schema); + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..70979dea2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..cceb33f81 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApiResponse.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> ticket; + + private final Optional> comment; + + private final Optional> project; + + private final Optional> collection; + + private final Optional> user; + + private final Optional> role; + + private final Optional> account; + + private final Optional> team; + + private final Optional> attachment; + + private final Optional> tag; + + private final Optional> contact; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> ticket, + Optional> comment, + Optional> project, + Optional> collection, + Optional> user, + Optional> role, + Optional> account, + Optional> team, + Optional> attachment, + Optional> tag, + Optional> contact, + Map additionalProperties) { + this.ticket = ticket; + this.comment = comment; + this.project = project; + this.collection = collection; + this.user = user; + this.role = role; + this.account = account; + this.team = team; + this.attachment = attachment; + this.tag = tag; + this.contact = contact; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Ticket") + public Optional> getTicket() { + return ticket; + } + + @JsonProperty("Comment") + public Optional> getComment() { + return comment; + } + + @JsonProperty("Project") + public Optional> getProject() { + return project; + } + + @JsonProperty("Collection") + public Optional> getCollection() { + return collection; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Role") + public Optional> getRole() { + return role; + } + + @JsonProperty("Account") + public Optional> getAccount() { + return account; + } + + @JsonProperty("Team") + public Optional> getTeam() { + return team; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("Tag") + public Optional> getTag() { + return tag; + } + + @JsonProperty("Contact") + public Optional> getContact() { + return contact; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return ticket.equals(other.ticket) + && comment.equals(other.comment) + && project.equals(other.project) + && collection.equals(other.collection) + && user.equals(other.user) + && role.equals(other.role) + && account.equals(other.account) + && team.equals(other.team) + && attachment.equals(other.attachment) + && tag.equals(other.tag) + && contact.equals(other.contact); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.ticket, + this.comment, + this.project, + this.collection, + this.user, + this.role, + this.account, + this.team, + this.attachment, + this.tag, + this.contact); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> ticket = Optional.empty(); + + private Optional> comment = Optional.empty(); + + private Optional> project = Optional.empty(); + + private Optional> collection = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> role = Optional.empty(); + + private Optional> account = Optional.empty(); + + private Optional> team = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> tag = Optional.empty(); + + private Optional> contact = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + ticket(other.getTicket()); + comment(other.getComment()); + project(other.getProject()); + collection(other.getCollection()); + user(other.getUser()); + role(other.getRole()); + account(other.getAccount()); + team(other.getTeam()); + attachment(other.getAttachment()); + tag(other.getTag()); + contact(other.getContact()); + return this; + } + + @JsonSetter(value = "Ticket", nulls = Nulls.SKIP) + public Builder ticket(Optional> ticket) { + this.ticket = ticket; + return this; + } + + public Builder ticket(List ticket) { + this.ticket = Optional.ofNullable(ticket); + return this; + } + + @JsonSetter(value = "Comment", nulls = Nulls.SKIP) + public Builder comment(Optional> comment) { + this.comment = comment; + return this; + } + + public Builder comment(List comment) { + this.comment = Optional.ofNullable(comment); + return this; + } + + @JsonSetter(value = "Project", nulls = Nulls.SKIP) + public Builder project(Optional> project) { + this.project = project; + return this; + } + + public Builder project(List project) { + this.project = Optional.ofNullable(project); + return this; + } + + @JsonSetter(value = "Collection", nulls = Nulls.SKIP) + public Builder collection(Optional> collection) { + this.collection = collection; + return this; + } + + public Builder collection(List collection) { + this.collection = Optional.ofNullable(collection); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Role", nulls = Nulls.SKIP) + public Builder role(Optional> role) { + this.role = role; + return this; + } + + public Builder role(List role) { + this.role = Optional.ofNullable(role); + return this; + } + + @JsonSetter(value = "Account", nulls = Nulls.SKIP) + public Builder account(Optional> account) { + this.account = account; + return this; + } + + public Builder account(List account) { + this.account = Optional.ofNullable(account); + return this; + } + + @JsonSetter(value = "Team", nulls = Nulls.SKIP) + public Builder team(Optional> team) { + this.team = team; + return this; + } + + public Builder team(List team) { + this.team = Optional.ofNullable(team); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "Tag", nulls = Nulls.SKIP) + public Builder tag(Optional> tag) { + this.tag = tag; + return this; + } + + public Builder tag(List tag) { + this.tag = Optional.ofNullable(tag); + return this; + } + + @JsonSetter(value = "Contact", nulls = Nulls.SKIP) + public Builder contact(Optional> contact) { + this.contact = contact; + return this; + } + + public Builder contact(List contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse( + ticket, + comment, + project, + collection, + user, + role, + account, + team, + attachment, + tag, + contact, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldClass.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClass.java new file mode 100644 index 000000000..109c72c67 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClass.java @@ -0,0 +1,335 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldClass.Builder.class) +public final class RemoteFieldClass { + private final Optional id; + + private final Optional displayName; + + private final Optional remoteKeyName; + + private final Optional description; + + private final Optional isCustom; + + private final Optional isRequired; + + private final Optional fieldType; + + private final Optional fieldFormat; + + private final Optional> fieldChoices; + + private final Optional itemSchema; + + private final Map additionalProperties; + + private RemoteFieldClass( + Optional id, + Optional displayName, + Optional remoteKeyName, + Optional description, + Optional isCustom, + Optional isRequired, + Optional fieldType, + Optional fieldFormat, + Optional> fieldChoices, + Optional itemSchema, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.remoteKeyName = remoteKeyName; + this.description = description; + this.isCustom = isCustom; + this.isRequired = isRequired; + this.fieldType = fieldType; + this.fieldFormat = fieldFormat; + this.fieldChoices = fieldChoices; + this.itemSchema = itemSchema; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("field_type") + public Optional getFieldType() { + return fieldType; + } + + @JsonProperty("field_format") + public Optional getFieldFormat() { + return fieldFormat; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @JsonProperty("item_schema") + public Optional getItemSchema() { + return itemSchema; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClass && equalTo((RemoteFieldClass) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClass other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && remoteKeyName.equals(other.remoteKeyName) + && description.equals(other.description) + && isCustom.equals(other.isCustom) + && isRequired.equals(other.isRequired) + && fieldType.equals(other.fieldType) + && fieldFormat.equals(other.fieldFormat) + && fieldChoices.equals(other.fieldChoices) + && itemSchema.equals(other.itemSchema); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.displayName, + this.remoteKeyName, + this.description, + this.isCustom, + this.isRequired, + this.fieldType, + this.fieldFormat, + this.fieldChoices, + this.itemSchema); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional fieldType = Optional.empty(); + + private Optional fieldFormat = Optional.empty(); + + private Optional> fieldChoices = Optional.empty(); + + private Optional itemSchema = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldClass other) { + id(other.getId()); + displayName(other.getDisplayName()); + remoteKeyName(other.getRemoteKeyName()); + description(other.getDescription()); + isCustom(other.getIsCustom()); + isRequired(other.getIsRequired()); + fieldType(other.getFieldType()); + fieldFormat(other.getFieldFormat()); + fieldChoices(other.getFieldChoices()); + itemSchema(other.getItemSchema()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public Builder remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + public Builder remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public Builder isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + public Builder isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @JsonSetter(value = "field_type", nulls = Nulls.SKIP) + public Builder fieldType(Optional fieldType) { + this.fieldType = fieldType; + return this; + } + + public Builder fieldType(FieldTypeEnum fieldType) { + this.fieldType = Optional.ofNullable(fieldType); + return this; + } + + @JsonSetter(value = "field_format", nulls = Nulls.SKIP) + public Builder fieldFormat(Optional fieldFormat) { + this.fieldFormat = fieldFormat; + return this; + } + + public Builder fieldFormat(FieldFormatEnum fieldFormat) { + this.fieldFormat = Optional.ofNullable(fieldFormat); + return this; + } + + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public Builder fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + public Builder fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) + public Builder itemSchema(Optional itemSchema) { + this.itemSchema = itemSchema; + return this; + } + + public Builder itemSchema(ItemSchema itemSchema) { + this.itemSchema = Optional.ofNullable(itemSchema); + return this; + } + + public RemoteFieldClass build() { + return new RemoteFieldClass( + id, + displayName, + remoteKeyName, + description, + isCustom, + isRequired, + fieldType, + fieldFormat, + fieldChoices, + itemSchema, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClassFieldChoicesItem.java new file mode 100644 index 000000000..a32632a2c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClassFieldChoicesItem.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldClassFieldChoicesItem.Builder.class) +public final class RemoteFieldClassFieldChoicesItem { + private final Optional value; + + private final Optional displayName; + + private final Map additionalProperties; + + private RemoteFieldClassFieldChoicesItem( + Optional value, Optional displayName, Map additionalProperties) { + this.value = value; + this.displayName = displayName; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldClassFieldChoicesItem && equalTo((RemoteFieldClassFieldChoicesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldClassFieldChoicesItem other) { + return value.equals(other.value) && displayName.equals(other.displayName); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value, this.displayName); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional value = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldClassFieldChoicesItem other) { + value(other.getValue()); + displayName(other.getDisplayName()); + return this; + } + + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public Builder value(Optional value) { + this.value = value; + return this; + } + + public Builder value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + public RemoteFieldClassFieldChoicesItem build() { + return new RemoteFieldClassFieldChoicesItem(value, displayName, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRemoteFieldClass.java new file mode 100644 index 000000000..d1a9d487d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRemoteFieldClass.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldRemoteFieldClass.Deserializer.class) +public final class RemoteFieldRemoteFieldClass { + private final Object value; + + private final int type; + + private RemoteFieldRemoteFieldClass(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((RemoteFieldClass) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRemoteFieldClass && equalTo((RemoteFieldRemoteFieldClass) other); + } + + private boolean equalTo(RemoteFieldRemoteFieldClass other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldRemoteFieldClass of(String value) { + return new RemoteFieldRemoteFieldClass(value, 0); + } + + public static RemoteFieldRemoteFieldClass of(RemoteFieldClass value) { + return new RemoteFieldRemoteFieldClass(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteFieldClass value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldRemoteFieldClass.class); + } + + @java.lang.Override + public RemoteFieldRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequest.java new file mode 100644 index 000000000..8e7a697ea --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequest.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldRequest.Builder.class) +public final class RemoteFieldRequest { + private final RemoteFieldRequestRemoteFieldClass remoteFieldClass; + + private final Optional value; + + private final Map additionalProperties; + + private RemoteFieldRequest( + RemoteFieldRequestRemoteFieldClass remoteFieldClass, + Optional value, + Map additionalProperties) { + this.remoteFieldClass = remoteFieldClass; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_field_class") + public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { + return remoteFieldClass; + } + + @JsonProperty("value") + public Optional getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRequest && equalTo((RemoteFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldRequest other) { + return remoteFieldClass.equals(other.remoteFieldClass) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteFieldClass, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteFieldClassStage builder() { + return new Builder(); + } + + public interface RemoteFieldClassStage { + _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass); + + Builder from(RemoteFieldRequest other); + } + + public interface _FinalStage { + RemoteFieldRequest build(); + + _FinalStage value(Optional value); + + _FinalStage value(JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteFieldClassStage, _FinalStage { + private RemoteFieldRequestRemoteFieldClass remoteFieldClass; + + private Optional value = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldRequest other) { + remoteFieldClass(other.getRemoteFieldClass()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_field_class") + public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { + this.remoteFieldClass = remoteFieldClass; + return this; + } + + @java.lang.Override + public _FinalStage value(JsonNode value) { + this.value = Optional.ofNullable(value); + return this; + } + + @java.lang.Override + @JsonSetter(value = "value", nulls = Nulls.SKIP) + public _FinalStage value(Optional value) { + this.value = value; + return this; + } + + @java.lang.Override + public RemoteFieldRequest build() { + return new RemoteFieldRequest(remoteFieldClass, value, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequestRemoteFieldClass.java new file mode 100644 index 000000000..a98e45d65 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequestRemoteFieldClass.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldRequestRemoteFieldClass.Deserializer.class) +public final class RemoteFieldRequestRemoteFieldClass { + private final Object value; + + private final int type; + + private RemoteFieldRequestRemoteFieldClass(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((RemoteFieldClass) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldRequestRemoteFieldClass + && equalTo((RemoteFieldRequestRemoteFieldClass) other); + } + + private boolean equalTo(RemoteFieldRequestRemoteFieldClass other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldRequestRemoteFieldClass of(String value) { + return new RemoteFieldRequestRemoteFieldClass(value, 0); + } + + public static RemoteFieldRequestRemoteFieldClass of(RemoteFieldClass value) { + return new RemoteFieldRequestRemoteFieldClass(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(RemoteFieldClass value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldRequestRemoteFieldClass.class); + } + + @java.lang.Override + public RemoteFieldRequestRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + } catch (IllegalArgumentException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..a9049d17b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteKey.java b/src/main/java/com/merge/api/ticketing/types/RemoteKey.java new file mode 100644 index 000000000..bbce4cc19 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/ticketing/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..13f05201b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

The name of the remote key

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteResponse.java b/src/main/java/com/merge/api/ticketing/types/RemoteResponse.java new file mode 100644 index 000000000..67abce896 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(ResponseTypeEnum responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(ResponseTypeEnum responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RequestFormatEnum.java b/src/main/java/com/merge/api/ticketing/types/RequestFormatEnum.java new file mode 100644 index 000000000..4fc60f413 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RequestFormatEnum.java @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RequestFormatEnum { + JSON("JSON"), + + XML("XML"), + + MULTIPART("MULTIPART"); + + private final String value; + + RequestFormatEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/ticketing/types/ResponseTypeEnum.java new file mode 100644 index 000000000..537ffb204 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ResponseTypeEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ResponseTypeEnum { + JSON("JSON"), + + BASE_64_GZIP("BASE64_GZIP"); + + private final String value; + + ResponseTypeEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Role.java b/src/main/java/com/merge/api/ticketing/types/Role.java similarity index 92% rename from src/main/java/com/merge/api/resources/ticketing/types/Role.java rename to src/main/java/com/merge/api/ticketing/types/Role.java index 6af4320c4..f95e2d44f 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/Role.java +++ b/src/main/java/com/merge/api/ticketing/types/Role.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,9 +33,9 @@ public final class Role { private final Optional name; - private final Optional>> ticketActions; + private final Optional> ticketActions; - private final Optional ticketAccess; + private final Optional ticketAccess; private final Optional remoteWasDeleted; @@ -51,8 +51,8 @@ private Role( Optional createdAt, Optional modifiedAt, Optional name, - Optional>> ticketActions, - Optional ticketAccess, + Optional> ticketActions, + Optional ticketAccess, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -111,7 +111,7 @@ public Optional getName() { * @return The set of actions that a User with this Role can perform. Possible enum values include: VIEW, CREATE, EDIT, DELETE, CLOSE, and ASSIGN. */ @JsonProperty("ticket_actions") - public Optional>> getTicketActions() { + public Optional> getTicketActions() { return ticketActions; } @@ -124,7 +124,7 @@ public Optional>> getTicketActions() { * */ @JsonProperty("ticket_access") - public Optional getTicketAccess() { + public Optional getTicketAccess() { return ticketAccess; } @@ -206,9 +206,9 @@ public static final class Builder { private Optional name = Optional.empty(); - private Optional>> ticketActions = Optional.empty(); + private Optional> ticketActions = Optional.empty(); - private Optional ticketAccess = Optional.empty(); + private Optional ticketAccess = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -291,23 +291,23 @@ public Builder name(String name) { } @JsonSetter(value = "ticket_actions", nulls = Nulls.SKIP) - public Builder ticketActions(Optional>> ticketActions) { + public Builder ticketActions(Optional> ticketActions) { this.ticketActions = ticketActions; return this; } - public Builder ticketActions(List> ticketActions) { + public Builder ticketActions(List ticketActions) { this.ticketActions = Optional.ofNullable(ticketActions); return this; } @JsonSetter(value = "ticket_access", nulls = Nulls.SKIP) - public Builder ticketAccess(Optional ticketAccess) { + public Builder ticketAccess(Optional ticketAccess) { this.ticketAccess = ticketAccess; return this; } - public Builder ticketAccess(RoleTicketAccess ticketAccess) { + public Builder ticketAccess(TicketAccessEnum ticketAccess) { this.ticketAccess = Optional.ofNullable(ticketAccess); return this; } diff --git a/src/main/java/com/merge/api/ticketing/types/RoleEnum.java b/src/main/java/com/merge/api/ticketing/types/RoleEnum.java new file mode 100644 index 000000000..0f8f8f66d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RoleEnum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum RoleEnum { + ADMIN("ADMIN"), + + DEVELOPER("DEVELOPER"), + + MEMBER("MEMBER"), + + API("API"), + + SYSTEM("SYSTEM"), + + MERGE_TEAM("MERGE_TEAM"); + + private final String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/roles/requests/RolesListRequest.java b/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java similarity index 99% rename from src/main/java/com/merge/api/resources/ticketing/roles/requests/RolesListRequest.java rename to src/main/java/com/merge/api/ticketing/types/RolesListRequest.java index 39ac7f035..ed9c345bb 100644 --- a/src/main/java/com/merge/api/resources/ticketing/roles/requests/RolesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.roles.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/ticketing/types/RolesRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/RolesRetrieveRequest.java new file mode 100644 index 000000000..2f73ccadd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RolesRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RolesRetrieveRequest.Builder.class) +public final class RolesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private RolesRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RolesRetrieveRequest && equalTo((RolesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RolesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RolesRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public RolesRetrieveRequest build() { + return new RolesRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..ee224d603 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum SelectiveSyncConfigurationsUsageEnum { + IN_NEXT_SYNC("IN_NEXT_SYNC"), + + IN_LAST_SYNC("IN_LAST_SYNC"); + + private final String value; + + SelectiveSyncConfigurationsUsageEnum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/StatusFd5Enum.java b/src/main/java/com/merge/api/ticketing/types/StatusFd5Enum.java new file mode 100644 index 000000000..bbffad9f3 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/StatusFd5Enum.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum StatusFd5Enum { + SYNCING("SYNCING"), + + DONE("DONE"), + + FAILED("FAILED"), + + DISABLED("DISABLED"), + + PAUSED("PAUSED"), + + PARTIALLY_SYNCED("PARTIALLY_SYNCED"); + + private final String value; + + StatusFd5Enum(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/SyncStatus.java b/src/main/java/com/merge/api/ticketing/types/SyncStatus.java new file mode 100644 index 000000000..eac22113e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final StatusFd5Enum status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + StatusFd5Enum status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public StatusFd5Enum getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull StatusFd5Enum status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private StatusFd5Enum status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull StatusFd5Enum status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(LastSyncResultEnum lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/ticketing/types/SyncStatusListRequest.java new file mode 100644 index 000000000..898bfb96c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/SyncStatusListRequest.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Tag.java b/src/main/java/com/merge/api/ticketing/types/Tag.java new file mode 100644 index 000000000..8b2b4c4e2 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/Tag.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Tag.Builder.class) +public final class Tag { + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional id; + + private final Optional name; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Tag( + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional id, + Optional name, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.id = id; + this.name = name; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The tag's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Tag && equalTo((Tag) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Tag other) { + return remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && id.equals(other.id) + && name.equals(other.name) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.createdAt, + this.modifiedAt, + this.id, + this.name, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Tag other) { + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + id(other.getId()); + name(other.getName()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Tag build() { + return new Tag( + remoteId, + createdAt, + modifiedAt, + id, + name, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java b/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java new file mode 100644 index 000000000..27503859b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TagsListRequest.Builder.class) +public final class TagsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private TagsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TagsListRequest && equalTo((TagsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TagsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TagsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public TagsListRequest build() { + return new TagsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/TagsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/TagsRetrieveRequest.java new file mode 100644 index 000000000..3395138bf --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TagsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TagsRetrieveRequest.Builder.class) +public final class TagsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private TagsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TagsRetrieveRequest && equalTo((TagsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TagsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TagsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public TagsRetrieveRequest build() { + return new TagsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Team.java b/src/main/java/com/merge/api/ticketing/types/Team.java new file mode 100644 index 000000000..dd05e6944 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/Team.java @@ -0,0 +1,329 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Team.Builder.class) +public final class Team { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional description; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Team( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.description = description; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The team's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The team's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Team && equalTo((Team) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Team other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && description.equals(other.description) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Team other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Team build() { + return new Team( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java b/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java new file mode 100644 index 000000000..3b282004b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TeamsListRequest.Builder.class) +public final class TeamsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private TeamsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TeamsListRequest && equalTo((TeamsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TeamsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TeamsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public TeamsListRequest build() { + return new TeamsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/TeamsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/TeamsRetrieveRequest.java new file mode 100644 index 000000000..130491c4b --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TeamsRetrieveRequest.java @@ -0,0 +1,126 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TeamsRetrieveRequest.Builder.class) +public final class TeamsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private TeamsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TeamsRetrieveRequest && equalTo((TeamsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TeamsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TeamsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public TeamsRetrieveRequest build() { + return new TeamsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Ticket.java b/src/main/java/com/merge/api/ticketing/types/Ticket.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/Ticket.java rename to src/main/java/com/merge/api/ticketing/types/Ticket.java index 561dee691..4880ee8f0 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/Ticket.java +++ b/src/main/java/com/merge/api/ticketing/types/Ticket.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -41,7 +41,7 @@ public final class Ticket { private final Optional dueDate; - private final Optional status; + private final Optional status; private final Optional description; @@ -71,7 +71,7 @@ public final class Ticket { private final Optional ticketUrl; - private final Optional priority; + private final Optional priority; private final Optional> fieldMappings; @@ -91,7 +91,7 @@ private Ticket( Optional>> assignedTeams, Optional creator, Optional dueDate, - Optional status, + Optional status, Optional description, Optional>> collections, Optional ticketType, @@ -106,7 +106,7 @@ private Ticket( Optional completedAt, Optional remoteWasDeleted, Optional ticketUrl, - Optional priority, + Optional priority, Optional> fieldMappings, Optional> remoteData, Optional> remoteFields, @@ -180,7 +180,7 @@ public Optional getName() { } /** - * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. + * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. To fetch all Users and Teams that can access the ticket, use the GET /tickets/{ticket_id}/viewers endpoint. */ @JsonProperty("assignees") public Optional>> getAssignees() { @@ -188,7 +188,7 @@ public Optional>> getAssignees() { } /** - * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. + * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. To fetch all Users and Teams that can access this ticket, use the GET /tickets/{ticket_id}/viewers endpoint. */ @JsonProperty("assigned_teams") public Optional>> getAssignedTeams() { @@ -221,7 +221,7 @@ public Optional getDueDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -338,7 +338,7 @@ public Optional getTicketUrl() { * */ @JsonProperty("priority") - public Optional getPriority() { + public Optional getPriority() { return priority; } @@ -461,7 +461,7 @@ public static final class Builder { private Optional dueDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional description = Optional.empty(); @@ -491,7 +491,7 @@ public static final class Builder { private Optional ticketUrl = Optional.empty(); - private Optional priority = Optional.empty(); + private Optional priority = Optional.empty(); private Optional> fieldMappings = Optional.empty(); @@ -636,12 +636,12 @@ public Builder dueDate(OffsetDateTime dueDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TicketStatus status) { + public Builder status(TicketStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -801,12 +801,12 @@ public Builder ticketUrl(String ticketUrl) { } @JsonSetter(value = "priority", nulls = Nulls.SKIP) - public Builder priority(Optional priority) { + public Builder priority(Optional priority) { this.priority = priority; return this; } - public Builder priority(TicketPriority priority) { + public Builder priority(PriorityEnum priority) { this.priority = Optional.ofNullable(priority); return this; } diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketAccessEnum.java b/src/main/java/com/merge/api/ticketing/types/TicketAccessEnum.java similarity index 90% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketAccessEnum.java rename to src/main/java/com/merge/api/ticketing/types/TicketAccessEnum.java index 7e5b7d7a1..d3f45bd93 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketAccessEnum.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketAccessEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketAccount.java b/src/main/java/com/merge/api/ticketing/types/TicketAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketAccount.java rename to src/main/java/com/merge/api/ticketing/types/TicketAccount.java index b8de9868d..e2be7798e 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketAccount.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketActionsEnum.java b/src/main/java/com/merge/api/ticketing/types/TicketActionsEnum.java similarity index 91% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketActionsEnum.java rename to src/main/java/com/merge/api/ticketing/types/TicketActionsEnum.java index 988a9e374..838053804 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketActionsEnum.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketActionsEnum.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketAssignedTeamsItem.java b/src/main/java/com/merge/api/ticketing/types/TicketAssignedTeamsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketAssignedTeamsItem.java rename to src/main/java/com/merge/api/ticketing/types/TicketAssignedTeamsItem.java index f86af12c0..4f2bbcd06 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketAssignedTeamsItem.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketAssignedTeamsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer } @java.lang.Override - public TicketAssignedTeamsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketAssignedTeamsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketAssigneesItem.java b/src/main/java/com/merge/api/ticketing/types/TicketAssigneesItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketAssigneesItem.java rename to src/main/java/com/merge/api/ticketing/types/TicketAssigneesItem.java index ac19f3c6a..dac1343cb 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketAssigneesItem.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketAssigneesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketAssigneesItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketAssigneesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketAttachmentsItem.java b/src/main/java/com/merge/api/ticketing/types/TicketAttachmentsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketAttachmentsItem.java rename to src/main/java/com/merge/api/ticketing/types/TicketAttachmentsItem.java index 9ea890ef8..58352a927 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketAttachmentsItem.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketAttachmentsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketAttachmentsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketAttachmentsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketCollectionsItem.java b/src/main/java/com/merge/api/ticketing/types/TicketCollectionsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketCollectionsItem.java rename to src/main/java/com/merge/api/ticketing/types/TicketCollectionsItem.java index 2db51ea5f..1194ff7eb 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketCollectionsItem.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketCollectionsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketCollectionsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketCollectionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketContact.java b/src/main/java/com/merge/api/ticketing/types/TicketContact.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketContact.java rename to src/main/java/com/merge/api/ticketing/types/TicketContact.java index 44dc32a38..6d19e5aac 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketContact.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketContact.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketCreator.java b/src/main/java/com/merge/api/ticketing/types/TicketCreator.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketCreator.java rename to src/main/java/com/merge/api/ticketing/types/TicketCreator.java index 6b72e6c9f..c31ca7c36 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketCreator.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketCreator.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketCreator deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketCreator deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketEndpointRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketEndpointRequest.java similarity index 97% rename from src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketEndpointRequest.java rename to src/main/java/com/merge/api/ticketing/types/TicketEndpointRequest.java index a32538680..b4c5709c4 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketEndpointRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketEndpointRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.types.TicketRequest; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketParentTicket.java b/src/main/java/com/merge/api/ticketing/types/TicketParentTicket.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketParentTicket.java rename to src/main/java/com/merge/api/ticketing/types/TicketParentTicket.java index fff5aab0c..bd299759d 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketParentTicket.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketParentTicket.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketParentTicket deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketParentTicket deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketRequest.java similarity index 94% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketRequest.java rename to src/main/java/com/merge/api/ticketing/types/TicketRequest.java index 122774387..96dbc19dc 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -33,7 +33,7 @@ public final class TicketRequest { private final Optional dueDate; - private final Optional status; + private final Optional status; private final Optional description; @@ -57,7 +57,7 @@ public final class TicketRequest { private final Optional ticketUrl; - private final Optional priority; + private final Optional priority; private final Optional> integrationParams; @@ -73,7 +73,7 @@ private TicketRequest( Optional>> assignedTeams, Optional creator, Optional dueDate, - Optional status, + Optional status, Optional description, Optional>> collections, Optional ticketType, @@ -85,7 +85,7 @@ private TicketRequest( Optional>> roles, Optional completedAt, Optional ticketUrl, - Optional priority, + Optional priority, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -123,7 +123,7 @@ public Optional getName() { } /** - * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. + * @return The individual Users who are assigned to this ticket. This does not include Users who just have view access to this ticket. To fetch all Users and Teams that can access the ticket, use the GET /tickets/{ticket_id}/viewers endpoint. */ @JsonProperty("assignees") public Optional>> getAssignees() { @@ -131,7 +131,7 @@ public Optional>> getAssignees() { } /** - * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. + * @return The Teams that are assigned to this ticket. This does not include Teams who just have view access to this ticket. To fetch all Users and Teams that can access this ticket, use the GET /tickets/{ticket_id}/viewers endpoint. */ @JsonProperty("assigned_teams") public Optional>> getAssignedTeams() { @@ -164,7 +164,7 @@ public Optional getDueDate() { * */ @JsonProperty("status") - public Optional getStatus() { + public Optional getStatus() { return status; } @@ -257,7 +257,7 @@ public Optional getTicketUrl() { * */ @JsonProperty("priority") - public Optional getPriority() { + public Optional getPriority() { return priority; } @@ -358,7 +358,7 @@ public static final class Builder { private Optional dueDate = Optional.empty(); - private Optional status = Optional.empty(); + private Optional status = Optional.empty(); private Optional description = Optional.empty(); @@ -382,7 +382,7 @@ public static final class Builder { private Optional ticketUrl = Optional.empty(); - private Optional priority = Optional.empty(); + private Optional priority = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -476,12 +476,12 @@ public Builder dueDate(OffsetDateTime dueDate) { } @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { + public Builder status(Optional status) { this.status = status; return this; } - public Builder status(TicketRequestStatus status) { + public Builder status(TicketStatusEnum status) { this.status = Optional.ofNullable(status); return this; } @@ -608,12 +608,12 @@ public Builder ticketUrl(String ticketUrl) { } @JsonSetter(value = "priority", nulls = Nulls.SKIP) - public Builder priority(Optional priority) { + public Builder priority(Optional priority) { this.priority = priority; return this; } - public Builder priority(TicketRequestPriority priority) { + public Builder priority(PriorityEnum priority) { this.priority = Optional.ofNullable(priority); return this; } diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestAccount.java b/src/main/java/com/merge/api/ticketing/types/TicketRequestAccount.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketRequestAccount.java rename to src/main/java/com/merge/api/ticketing/types/TicketRequestAccount.java index 2b3e79031..2aa4512aa 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestAccount.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketRequestAccount.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketRequestAccount deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestAssignedTeamsItem.java b/src/main/java/com/merge/api/ticketing/types/TicketRequestAssignedTeamsItem.java similarity index 96% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketRequestAssignedTeamsItem.java rename to src/main/java/com/merge/api/ticketing/types/TicketRequestAssignedTeamsItem.java index 341b39fee..ca95ac3fd 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestAssignedTeamsItem.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketRequestAssignedTeamsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,8 @@ static final class Deserializer extends StdDeserializer T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketRequestContact deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestCreator.java b/src/main/java/com/merge/api/ticketing/types/TicketRequestCreator.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketRequestCreator.java rename to src/main/java/com/merge/api/ticketing/types/TicketRequestCreator.java index 81b1ea3a3..e5ee0698c 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestCreator.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketRequestCreator.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public TicketRequestCreator deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public TicketRequestCreator deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestParentTicket.java b/src/main/java/com/merge/api/ticketing/types/TicketRequestParentTicket.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/TicketRequestParentTicket.java rename to src/main/java/com/merge/api/ticketing/types/TicketRequestParentTicket.java index 5888ade95..753672806 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/TicketRequestParentTicket.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketRequestParentTicket.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer> expand; + private final Optional accountId; private final Optional assigneeIds; @@ -47,8 +47,6 @@ public final class TicketsListRequest { private final Optional dueBefore; - private final Optional expand; - private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -92,6 +90,7 @@ public final class TicketsListRequest { private final Map additionalProperties; private TicketsListRequest( + Optional> expand, Optional accountId, Optional assigneeIds, Optional collectionIds, @@ -103,7 +102,6 @@ private TicketsListRequest( Optional cursor, Optional dueAfter, Optional dueBefore, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeRemoteFields, @@ -125,6 +123,7 @@ private TicketsListRequest( Optional ticketType, Optional ticketUrl, Map additionalProperties) { + this.expand = expand; this.accountId = accountId; this.assigneeIds = assigneeIds; this.collectionIds = collectionIds; @@ -136,7 +135,6 @@ private TicketsListRequest( this.cursor = cursor; this.dueAfter = dueAfter; this.dueBefore = dueBefore; - this.expand = expand; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; @@ -160,6 +158,14 @@ private TicketsListRequest( this.additionalProperties = additionalProperties; } + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + /** * @return If provided, will only return tickets for this account. */ @@ -248,14 +254,6 @@ public Optional getDueBefore() { return dueBefore; } - /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; - } - /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -434,7 +432,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(TicketsListRequest other) { - return accountId.equals(other.accountId) + return expand.equals(other.expand) + && accountId.equals(other.accountId) && assigneeIds.equals(other.assigneeIds) && collectionIds.equals(other.collectionIds) && completedAfter.equals(other.completedAfter) @@ -445,7 +444,6 @@ private boolean equalTo(TicketsListRequest other) { && cursor.equals(other.cursor) && dueAfter.equals(other.dueAfter) && dueBefore.equals(other.dueBefore) - && expand.equals(other.expand) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) @@ -471,6 +469,7 @@ private boolean equalTo(TicketsListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.expand, this.accountId, this.assigneeIds, this.collectionIds, @@ -482,7 +481,6 @@ public int hashCode() { this.cursor, this.dueAfter, this.dueBefore, - this.expand, this.includeDeletedData, this.includeRemoteData, this.includeRemoteFields, @@ -516,6 +514,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> expand = Optional.empty(); + private Optional accountId = Optional.empty(); private Optional assigneeIds = Optional.empty(); @@ -538,8 +538,6 @@ public static final class Builder { private Optional dueBefore = Optional.empty(); - private Optional expand = Optional.empty(); - private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -586,6 +584,7 @@ public static final class Builder { private Builder() {} public Builder from(TicketsListRequest other) { + expand(other.getExpand()); accountId(other.getAccountId()); assigneeIds(other.getAssigneeIds()); collectionIds(other.getCollectionIds()); @@ -597,7 +596,6 @@ public Builder from(TicketsListRequest other) { cursor(other.getCursor()); dueAfter(other.getDueAfter()); dueBefore(other.getDueBefore()); - expand(other.getExpand()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); @@ -621,6 +619,22 @@ public Builder from(TicketsListRequest other) { return this; } + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(TicketsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) public Builder accountId(Optional accountId) { this.accountId = accountId; @@ -742,17 +756,6 @@ public Builder dueBefore(OffsetDateTime dueBefore) { return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; - return this; - } - - public Builder expand(TicketsListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); - return this; - } - @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -975,6 +978,7 @@ public Builder ticketUrl(String ticketUrl) { public TicketsListRequest build() { return new TicketsListRequest( + expand, accountId, assigneeIds, collectionIds, @@ -986,7 +990,6 @@ public TicketsListRequest build() { cursor, dueAfter, dueBefore, - expand, includeDeletedData, includeRemoteData, includeRemoteFields, diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestExpandItem.java new file mode 100644 index 000000000..73b1e9352 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestExpandItem.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsListRequestExpandItem { + ACCOUNT("account"), + + ASSIGNED_TEAMS("assigned_teams"), + + ASSIGNEES("assignees"), + + ATTACHMENTS("attachments"), + + COLLECTIONS("collections"), + + CONTACT("contact"), + + CREATOR("creator"), + + PARENT_TICKET("parent_ticket"); + + private final String value; + + TicketsListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestPriority.java b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestPriority.java similarity index 89% rename from src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestPriority.java rename to src/main/java/com/merge/api/ticketing/types/TicketsListRequestPriority.java index 0c77785d9..51df2265a 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestPriority.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestPriority.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestRemoteFields.java b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestRemoteFields.java similarity index 92% rename from src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestRemoteFields.java rename to src/main/java/com/merge/api/ticketing/types/TicketsListRequestRemoteFields.java index 76baada05..4dd164569 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestRemoteFields.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestShowEnumOrigins.java similarity index 92% rename from src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/ticketing/types/TicketsListRequestShowEnumOrigins.java index b291eaf0e..e9e767823 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsListRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java similarity index 91% rename from src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsRemoteFieldClassesListRequest.java rename to src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java index b9c1165fb..59c1ca0e8 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -22,6 +22,8 @@ public final class TicketsRemoteFieldClassesListRequest { private final Optional cursor; + private final Optional ids; + private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -36,6 +38,7 @@ public final class TicketsRemoteFieldClassesListRequest { private TicketsRemoteFieldClassesListRequest( Optional cursor, + Optional ids, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -43,6 +46,7 @@ private TicketsRemoteFieldClassesListRequest( Optional pageSize, Map additionalProperties) { this.cursor = cursor; + this.ids = ids; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -59,6 +63,14 @@ public Optional getCursor() { return cursor; } + /** + * @return If provided, will only return remote field classes with the ids in this list + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + /** * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. */ @@ -113,6 +125,7 @@ public Map getAdditionalProperties() { private boolean equalTo(TicketsRemoteFieldClassesListRequest other) { return cursor.equals(other.cursor) + && ids.equals(other.ids) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -124,6 +137,7 @@ private boolean equalTo(TicketsRemoteFieldClassesListRequest other) { public int hashCode() { return Objects.hash( this.cursor, + this.ids, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -144,6 +158,8 @@ public static Builder builder() { public static final class Builder { private Optional cursor = Optional.empty(); + private Optional ids = Optional.empty(); + private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -161,6 +177,7 @@ private Builder() {} public Builder from(TicketsRemoteFieldClassesListRequest other) { cursor(other.getCursor()); + ids(other.getIds()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -180,6 +197,17 @@ public Builder cursor(String cursor) { return this; } + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) public Builder includeDeletedData(Optional includeDeletedData) { this.includeDeletedData = includeDeletedData; @@ -238,6 +266,7 @@ public Builder pageSize(Integer pageSize) { public TicketsRemoteFieldClassesListRequest build() { return new TicketsRemoteFieldClassesListRequest( cursor, + ids, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequest.java similarity index 78% rename from src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsRetrieveRequest.java rename to src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequest.java index d2f358ea3..67ed5cbd9 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,10 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.tickets.types.TicketsRetrieveRequestExpand; -import com.merge.api.resources.ticketing.tickets.types.TicketsRetrieveRequestRemoteFields; -import com.merge.api.resources.ticketing.tickets.types.TicketsRetrieveRequestShowEnumOrigins; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -23,12 +22,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TicketsRetrieveRequest.Builder.class) public final class TicketsRetrieveRequest { - private final Optional expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeRemoteFields; + private final Optional includeShellData; + private final Optional remoteFields; private final Optional showEnumOrigins; @@ -36,15 +37,17 @@ public final class TicketsRetrieveRequest { private final Map additionalProperties; private TicketsRetrieveRequest( - Optional expand, + Optional> expand, Optional includeRemoteData, Optional includeRemoteFields, + Optional includeShellData, Optional remoteFields, Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; this.remoteFields = remoteFields; this.showEnumOrigins = showEnumOrigins; this.additionalProperties = additionalProperties; @@ -54,7 +57,7 @@ private TicketsRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional getExpand() { + public Optional> getExpand() { return expand; } @@ -74,6 +77,14 @@ public Optional getIncludeRemoteFields() { return includeRemoteFields; } + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + /** * @return Deprecated. Use show_enum_origins. */ @@ -105,6 +116,7 @@ private boolean equalTo(TicketsRetrieveRequest other) { return expand.equals(other.expand) && includeRemoteData.equals(other.includeRemoteData) && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) && remoteFields.equals(other.remoteFields) && showEnumOrigins.equals(other.showEnumOrigins); } @@ -112,7 +124,12 @@ private boolean equalTo(TicketsRetrieveRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.expand, this.includeRemoteData, this.includeRemoteFields, this.remoteFields, this.showEnumOrigins); + this.expand, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); } @java.lang.Override @@ -126,12 +143,14 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); private Optional includeRemoteFields = Optional.empty(); + private Optional includeShellData = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional showEnumOrigins = Optional.empty(); @@ -145,22 +164,28 @@ public Builder from(TicketsRetrieveRequest other) { expand(other.getExpand()); includeRemoteData(other.getIncludeRemoteData()); includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); remoteFields(other.getRemoteFields()); showEnumOrigins(other.getShowEnumOrigins()); return this; } @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(TicketsRetrieveRequestExpand expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } + public Builder expand(TicketsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) public Builder includeRemoteData(Optional includeRemoteData) { this.includeRemoteData = includeRemoteData; @@ -183,6 +208,17 @@ public Builder includeRemoteFields(Boolean includeRemoteFields) { return this; } + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; @@ -210,6 +246,7 @@ public TicketsRetrieveRequest build() { expand, includeRemoteData, includeRemoteFields, + includeShellData, remoteFields, showEnumOrigins, additionalProperties); diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..ddc4c07e7 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestExpandItem.java @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsRetrieveRequestExpandItem { + ACCOUNT("account"), + + ASSIGNED_TEAMS("assigned_teams"), + + ASSIGNEES("assignees"), + + ATTACHMENTS("attachments"), + + COLLECTIONS("collections"), + + CONTACT("contact"), + + CREATOR("creator"), + + PARENT_TICKET("parent_ticket"); + + private final String value; + + TicketsRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestRemoteFields.java similarity index 92% rename from src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestRemoteFields.java rename to src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestRemoteFields.java index bc837ba26..19aac210a 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestRemoteFields.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestRemoteFields.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestShowEnumOrigins.java similarity index 92% rename from src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestShowEnumOrigins.java rename to src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestShowEnumOrigins.java index 6bc2cb3e0..d2e5b6d92 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/types/TicketsRetrieveRequestShowEnumOrigins.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestShowEnumOrigins.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsViewersListRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequest.java similarity index 90% rename from src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsViewersListRequest.java rename to src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequest.java index 50e6f5c63..c724f405f 100644 --- a/src/main/java/com/merge/api/resources/ticketing/tickets/requests/TicketsViewersListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequest.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.tickets.requests; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -12,8 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; -import com.merge.api.resources.ticketing.tickets.types.TicketsViewersListRequestExpand; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,9 +22,9 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TicketsViewersListRequest.Builder.class) public final class TicketsViewersListRequest { - private final Optional cursor; + private final Optional> expand; - private final Optional expand; + private final Optional cursor; private final Optional includeDeletedData; @@ -36,15 +37,15 @@ public final class TicketsViewersListRequest { private final Map additionalProperties; private TicketsViewersListRequest( + Optional> expand, Optional cursor, - Optional expand, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, Optional pageSize, Map additionalProperties) { - this.cursor = cursor; this.expand = expand; + this.cursor = cursor; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -53,19 +54,19 @@ private TicketsViewersListRequest( } /** - * @return The pagination cursor value. + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ - @JsonProperty("cursor") - public Optional getCursor() { - return cursor; + @JsonProperty("expand") + public Optional> getExpand() { + return expand; } /** - * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + * @return The pagination cursor value. */ - @JsonProperty("expand") - public Optional getExpand() { - return expand; + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; } /** @@ -112,8 +113,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(TicketsViewersListRequest other) { - return cursor.equals(other.cursor) - && expand.equals(other.expand) + return expand.equals(other.expand) + && cursor.equals(other.cursor) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -123,8 +124,8 @@ private boolean equalTo(TicketsViewersListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.cursor, this.expand, + this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -142,9 +143,9 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional cursor = Optional.empty(); + private Optional> expand = Optional.empty(); - private Optional expand = Optional.empty(); + private Optional cursor = Optional.empty(); private Optional includeDeletedData = Optional.empty(); @@ -160,8 +161,8 @@ public static final class Builder { private Builder() {} public Builder from(TicketsViewersListRequest other) { - cursor(other.getCursor()); expand(other.getExpand()); + cursor(other.getCursor()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -169,25 +170,30 @@ public Builder from(TicketsViewersListRequest other) { return this; } - @JsonSetter(value = "cursor", nulls = Nulls.SKIP) - public Builder cursor(Optional cursor) { - this.cursor = cursor; + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; return this; } - public Builder cursor(String cursor) { - this.cursor = Optional.ofNullable(cursor); + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); return this; } - @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional expand) { - this.expand = expand; + public Builder expand(TicketsViewersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); return this; } - public Builder expand(TicketsViewersListRequestExpand expand) { - this.expand = Optional.ofNullable(expand); + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); return this; } @@ -237,8 +243,8 @@ public Builder pageSize(Integer pageSize) { public TicketsViewersListRequest build() { return new TicketsViewersListRequest( - cursor, expand, + cursor, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequestExpandItem.java new file mode 100644 index 000000000..784065c26 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum TicketsViewersListRequestExpandItem { + TEAM("team"), + + USER("user"); + + private final String value; + + TicketsViewersListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/User.java b/src/main/java/com/merge/api/ticketing/types/User.java new file mode 100644 index 000000000..9a44c7d63 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/User.java @@ -0,0 +1,439 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = User.Builder.class) +public final class User { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional emailAddress; + + private final Optional isActive; + + private final Optional>> teams; + + private final Optional>> roles; + + private final Optional avatar; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private User( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional emailAddress, + Optional isActive, + Optional>> teams, + Optional>> roles, + Optional avatar, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.emailAddress = emailAddress; + this.isActive = isActive; + this.teams = teams; + this.roles = roles; + this.avatar = avatar; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The user's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The user's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return Whether or not the user is active. + */ + @JsonProperty("is_active") + public Optional getIsActive() { + return isActive; + } + + @JsonProperty("teams") + public Optional>> getTeams() { + return teams; + } + + @JsonProperty("roles") + public Optional>> getRoles() { + return roles; + } + + /** + * @return The user's avatar picture. + */ + @JsonProperty("avatar") + public Optional getAvatar() { + return avatar; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof User && equalTo((User) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(User other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && emailAddress.equals(other.emailAddress) + && isActive.equals(other.isActive) + && teams.equals(other.teams) + && roles.equals(other.roles) + && avatar.equals(other.avatar) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.emailAddress, + this.isActive, + this.teams, + this.roles, + this.avatar, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional isActive = Optional.empty(); + + private Optional>> teams = Optional.empty(); + + private Optional>> roles = Optional.empty(); + + private Optional avatar = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(User other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + emailAddress(other.getEmailAddress()); + isActive(other.getIsActive()); + teams(other.getTeams()); + roles(other.getRoles()); + avatar(other.getAvatar()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "is_active", nulls = Nulls.SKIP) + public Builder isActive(Optional isActive) { + this.isActive = isActive; + return this; + } + + public Builder isActive(Boolean isActive) { + this.isActive = Optional.ofNullable(isActive); + return this; + } + + @JsonSetter(value = "teams", nulls = Nulls.SKIP) + public Builder teams(Optional>> teams) { + this.teams = teams; + return this; + } + + public Builder teams(List> teams) { + this.teams = Optional.ofNullable(teams); + return this; + } + + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional>> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List> roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + @JsonSetter(value = "avatar", nulls = Nulls.SKIP) + public Builder avatar(Optional avatar) { + this.avatar = avatar; + return this; + } + + public Builder avatar(String avatar) { + this.avatar = Optional.ofNullable(avatar); + return this; + } + + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public User build() { + return new User( + id, + remoteId, + createdAt, + modifiedAt, + name, + emailAddress, + isActive, + teams, + roles, + avatar, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/UserRolesItem.java b/src/main/java/com/merge/api/ticketing/types/UserRolesItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/UserRolesItem.java rename to src/main/java/com/merge/api/ticketing/types/UserRolesItem.java index 512e7f7ac..af138cd63 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/UserRolesItem.java +++ b/src/main/java/com/merge/api/ticketing/types/UserRolesItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public UserRolesItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public UserRolesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/UserTeamsItem.java b/src/main/java/com/merge/api/ticketing/types/UserTeamsItem.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/UserTeamsItem.java rename to src/main/java/com/merge/api/ticketing/types/UserTeamsItem.java index 1f986f204..bf81ba061 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/UserTeamsItem.java +++ b/src/main/java/com/merge/api/ticketing/types/UserTeamsItem.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public UserTeamsItem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public UserTeamsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java b/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java new file mode 100644 index 000000000..3de44011f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java @@ -0,0 +1,459 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersListRequest.Builder.class) +public final class UsersListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional emailAddress; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Optional team; + + private final Map additionalProperties; + + private UsersListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional emailAddress, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Optional team, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.emailAddress = emailAddress; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.team = team; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return users with emails equal to this value (case insensitive). + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return users matching in this team. + */ + @JsonProperty("team") + public Optional getTeam() { + return team; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListRequest && equalTo((UsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && emailAddress.equals(other.emailAddress) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && team.equals(other.team); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.emailAddress, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId, + this.team); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional team = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + emailAddress(other.getEmailAddress()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + team(other.getTeam()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(UsersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "team", nulls = Nulls.SKIP) + public Builder team(Optional team) { + this.team = team; + return this; + } + + public Builder team(String team) { + this.team = Optional.ofNullable(team); + return this; + } + + public UsersListRequest build() { + return new UsersListRequest( + expand, + createdAfter, + createdBefore, + cursor, + emailAddress, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + team, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/UsersListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/UsersListRequestExpandItem.java new file mode 100644 index 000000000..56f8927f1 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/UsersListRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UsersListRequestExpandItem { + ROLES("roles"), + + TEAMS("teams"); + + private final String value; + + UsersListRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/UsersRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/UsersRetrieveRequest.java new file mode 100644 index 000000000..9e379367d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/UsersRetrieveRequest.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) +public final class UsersRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private UsersRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(UsersRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public UsersRetrieveRequest build() { + return new UsersRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/UsersRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/UsersRetrieveRequestExpandItem.java new file mode 100644 index 000000000..cc7e4715a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/UsersRetrieveRequestExpandItem.java @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; + +public enum UsersRetrieveRequestExpandItem { + ROLES("roles"), + + TEAMS("teams"); + + private final String value; + + UsersRetrieveRequestExpandItem(String value) { + this.value = value; + } + + @JsonValue + @java.lang.Override + public String toString() { + return this.value; + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ValidationProblemSource.java b/src/main/java/com/merge/api/ticketing/types/ValidationProblemSource.java new file mode 100644 index 000000000..4ea728a7a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ValidationProblemSource.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ValidationProblemSource.Builder.class) +public final class ValidationProblemSource { + private final String pointer; + + private final Map additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/resources/ticketing/types/Viewer.java b/src/main/java/com/merge/api/ticketing/types/Viewer.java similarity index 99% rename from src/main/java/com/merge/api/resources/ticketing/types/Viewer.java rename to src/main/java/com/merge/api/ticketing/types/Viewer.java index 94c69cba2..ff2c688b7 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/Viewer.java +++ b/src/main/java/com/merge/api/ticketing/types/Viewer.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ViewerTeam.java b/src/main/java/com/merge/api/ticketing/types/ViewerTeam.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/ViewerTeam.java rename to src/main/java/com/merge/api/ticketing/types/ViewerTeam.java index 6ddd8dbf8..7cec00039 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/ViewerTeam.java +++ b/src/main/java/com/merge/api/ticketing/types/ViewerTeam.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ViewerTeam deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ViewerTeam deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/resources/ticketing/types/ViewerUser.java b/src/main/java/com/merge/api/ticketing/types/ViewerUser.java similarity index 95% rename from src/main/java/com/merge/api/resources/ticketing/types/ViewerUser.java rename to src/main/java/com/merge/api/ticketing/types/ViewerUser.java index 02c64b78b..42de0d927 100644 --- a/src/main/java/com/merge/api/resources/ticketing/types/ViewerUser.java +++ b/src/main/java/com/merge/api/ticketing/types/ViewerUser.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.resources.ticketing.types; +package com.merge.api.ticketing.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -29,6 +29,7 @@ public Object get() { return this.value; } + @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); @@ -78,7 +79,7 @@ static final class Deserializer extends StdDeserializer { } @java.lang.Override - public ViewerUser deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + public ViewerUser deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/ticketing/types/WarningValidationProblem.java b/src/main/java/com/merge/api/ticketing/types/WarningValidationProblem.java new file mode 100644 index 000000000..1e13e7a4e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/WarningValidationProblem.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.source, this.title, this.detail, this.problemType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/WebhookReceiver.java b/src/main/java/com/merge/api/ticketing/types/WebhookReceiver.java new file mode 100644 index 000000000..11c47568d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/ticketing/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..cc21a2292 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/test/java/com/merge/api/core/QueryStringMapperTest.java b/src/test/java/com/merge/api/core/QueryStringMapperTest.java new file mode 100644 index 000000000..15fe80b35 --- /dev/null +++ b/src/test/java/com/merge/api/core/QueryStringMapperTest.java @@ -0,0 +1,339 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.HttpUrl; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public final class QueryStringMapperTest { + @Test + public void testObjectWithQuotedString_indexedArrays() { + Map map = new HashMap() { + { + put("hello", "\"world\""); + } + }; + + String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; + + String actualQueryString = queryString( + new HashMap() { + { + put("withquoted", map); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectWithQuotedString_arraysAsRepeats() { + Map map = new HashMap() { + { + put("hello", "\"world\""); + } + }; + + String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; + + String actualQueryString = queryString( + new HashMap() { + { + put("withquoted", map); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObject_indexedArrays() { + Map map = new HashMap() { + { + put("foo", "bar"); + put("baz", "qux"); + } + }; + + String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; + + String actualQueryString = queryString( + new HashMap() { + { + put("metadata", map); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObject_arraysAsRepeats() { + Map map = new HashMap() { + { + put("foo", "bar"); + put("baz", "qux"); + } + }; + + String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; + + String actualQueryString = queryString( + new HashMap() { + { + put("metadata", map); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testNestedObject_indexedArrays() { + Map> nestedMap = new HashMap>() { + { + put("mapkey1", new HashMap() { + { + put("mapkey1mapkey1", "mapkey1mapkey1value"); + put("mapkey1mapkey2", "mapkey1mapkey2value"); + } + }); + put("mapkey2", new HashMap() { + { + put("mapkey2mapkey1", "mapkey2mapkey1value"); + } + }); + } + }; + + String expectedQueryString = + "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" + + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; + + String actualQueryString = queryString( + new HashMap() { + { + put("nested", nestedMap); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testNestedObject_arraysAsRepeats() { + Map> nestedMap = new HashMap>() { + { + put("mapkey1", new HashMap() { + { + put("mapkey1mapkey1", "mapkey1mapkey1value"); + put("mapkey1mapkey2", "mapkey1mapkey2value"); + } + }); + put("mapkey2", new HashMap() { + { + put("mapkey2mapkey1", "mapkey2mapkey1value"); + } + }); + } + }; + + String expectedQueryString = + "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" + + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; + + String actualQueryString = queryString( + new HashMap() { + { + put("nested", nestedMap); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testDateTime_indexedArrays() { + OffsetDateTime dateTime = + OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); + + String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; + + String actualQueryString = queryString( + new HashMap() { + { + put("datetime", dateTime); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testDateTime_arraysAsRepeats() { + OffsetDateTime dateTime = + OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); + + String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; + + String actualQueryString = queryString( + new HashMap() { + { + put("datetime", dateTime); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectArray_indexedArrays() { + List> mapArray = new ArrayList>() { + { + add(new HashMap() { + { + put("key", "hello"); + put("value", "world"); + } + }); + add(new HashMap() { + { + put("key", "foo"); + put("value", "bar"); + } + }); + add(new HashMap<>()); + } + }; + + String expectedQueryString = "objects%5B0%5D%5Bvalue%5D=world&objects%5B0%5D%5Bkey%5D=hello&objects%5B1%5D" + + "%5Bvalue%5D=bar&objects%5B1%5D%5Bkey%5D=foo"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objects", mapArray); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectArray_arraysAsRepeats() { + List> mapArray = new ArrayList>() { + { + add(new HashMap() { + { + put("key", "hello"); + put("value", "world"); + } + }); + add(new HashMap() { + { + put("key", "foo"); + put("value", "bar"); + } + }); + add(new HashMap<>()); + } + }; + + String expectedQueryString = + "objects%5Bvalue%5D=world&objects%5Bkey%5D=hello&objects%5Bvalue" + "%5D=bar&objects%5Bkey%5D=foo"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objects", mapArray); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectWithArray_indexedArrays() { + Map objectWithArray = new HashMap() { + { + put("id", "abc123"); + put("contactIds", new ArrayList() { + { + add("id1"); + add("id2"); + add("id3"); + } + }); + } + }; + + String expectedQueryString = + "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds%5D%5B0%5D=id1&objectwitharray" + + "%5BcontactIds%5D%5B1%5D=id2&objectwitharray%5BcontactIds%5D%5B2%5D=id3"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objectwitharray", objectWithArray); + } + }, + false); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + @Test + public void testObjectWithArray_arraysAsRepeats() { + Map objectWithArray = new HashMap() { + { + put("id", "abc123"); + put("contactIds", new ArrayList() { + { + add("id1"); + add("id2"); + add("id3"); + } + }); + } + }; + + String expectedQueryString = "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds" + + "%5D=id1&objectwitharray%5BcontactIds%5D=id2&objectwitharray%5BcontactIds%5D=id3"; + + String actualQueryString = queryString( + new HashMap() { + { + put("objectwitharray", objectWithArray); + } + }, + true); + + Assertions.assertEquals(expectedQueryString, actualQueryString); + } + + private static String queryString(Map params, boolean arraysAsRepeats) { + HttpUrl.Builder httpUrl = HttpUrl.parse("http://www.fakewebsite.com/").newBuilder(); + params.forEach((paramName, paramValue) -> + QueryStringMapper.addQueryParameter(httpUrl, paramName, paramValue, arraysAsRepeats)); + return httpUrl.build().encodedQuery(); + } +}